]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
add include/stringify.h
authorSage Weil <sage.weil@dreamhost.com>
Sun, 4 Mar 2012 05:06:12 +0000 (21:06 -0800)
committerSage Weil <sage.weil@dreamhost.com>
Fri, 30 Mar 2012 17:52:23 +0000 (10:52 -0700)
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
src/Makefile.am
src/include/stringify.h [new file with mode: 0644]

index a37392d436fcf8ba65cc05d61d94823fe9166c00..6f070b45d342b8a933a1be48433656092742fa8a 100644 (file)
@@ -1253,6 +1253,7 @@ noinst_HEADERS = \
        include/rbd_types.h\
         include/statlite.h\
        include/str_list.h\
+       include/stringify.h\
         include/triple.h\
         include/types.h\
         include/utime.h\
diff --git a/src/include/stringify.h b/src/include/stringify.h
new file mode 100644 (file)
index 0000000..f87bd98
--- /dev/null
@@ -0,0 +1,14 @@
+#ifndef __CEPH_STRINGIFY_H
+#define __CEPH_STRINGIFY_H
+
+#include <string>
+#include <sstream>
+
+template<typename T>
+inline std::string stringify(T a) {
+  std::stringstream ss;
+  ss << a;
+  return ss.str();
+}
+
+#endif