]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
include: Update util.h to work without using namespace
authorAdam C. Emerson <aemerson@redhat.com>
Fri, 29 Mar 2019 01:01:48 +0000 (21:01 -0400)
committerAdam C. Emerson <aemerson@redhat.com>
Fri, 29 Mar 2019 14:30:36 +0000 (10:30 -0400)
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
src/include/util.h

index 9c377aa1413da7fefe2bf58396f9e2e403216247..1268288e2770f6c3faa94a689875a8a7c868ab3a 100644 (file)
@@ -33,7 +33,7 @@ struct ceph_data_stats
     avail_percent(0)
   { }
 
-  void dump(Formatter *f) const {
+  void dump(ceph::Formatter *f) const {
     ceph_assert(f != NULL);
     f->dump_int("total", byte_total);
     f->dump_int("used", byte_used);
@@ -41,7 +41,7 @@ struct ceph_data_stats
     f->dump_int("avail_percent", avail_percent);
   }
 
-  void encode(bufferlist &bl) const {
+  void encode(ceph::buffer::list &bl) const {
     ENCODE_START(1, 1, bl);
     encode(byte_total, bl);
     encode(byte_used, bl);
@@ -50,7 +50,7 @@ struct ceph_data_stats
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator &p) {
+  void decode(ceph::buffer::list::const_iterator &p) {
     DECODE_START(1, p);
     decode(byte_total, p);
     decode(byte_used, p);
@@ -59,7 +59,7 @@ struct ceph_data_stats
     DECODE_FINISH(p);
   }
 
-  static void generate_test_instances(list<ceph_data_stats*>& ls) {
+  static void generate_test_instances(std::list<ceph_data_stats*>& ls) {
     ls.push_back(new ceph_data_stats);
     ls.push_back(new ceph_data_stats);
     ls.back()->byte_total = 1024*1024;
@@ -77,21 +77,24 @@ int get_fs_stats(ceph_data_stats_t &stats, const char *path);
 int get_cgroup_memory_limit(uint64_t *limit);
 
 /// collect info from @p uname(2), @p /proc/meminfo and @p /proc/cpuinfo
-void collect_sys_info(map<string, string> *m, CephContext *cct);
+void collect_sys_info(std::map<std::string, std::string> *m, CephContext *cct);
 
 /// dump service ids grouped by their host to the specified formatter
 /// @param f formatter for the output
 /// @param services a map from hostname to a list of service id hosted by this host
 /// @param type the service type of given @p services, for example @p osd or @p mon.
-void dump_services(Formatter* f, const map<string, list<int> >& services, const char* type);
+void dump_services(ceph::Formatter* f,
+                  const std::map<std::string, std::list<int> >& services,
+                  const char* type);
 /// dump service names grouped by their host to the specified formatter
 /// @param f formatter for the output
 /// @param services a map from hostname to a list of service name hosted by this host
 /// @param type the service type of given @p services, for example @p osd or @p mon.
-void dump_services(Formatter* f, const map<string, list<string> >& services, const char* type);
+void dump_services(ceph::Formatter* f, const std::map<std::string,
+                  std::list<std::string> >& services, const char* type);
 
-string cleanbin(bufferlist &bl, bool &b64);
-string cleanbin(string &str);
+std::string cleanbin(ceph::buffer::list &bl, bool &b64);
+std::string cleanbin(std::string &str);
 
 namespace ceph::util {