diff options
Diffstat (limited to 'node/Utils.hpp')
-rw-r--r-- | node/Utils.hpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/node/Utils.hpp b/node/Utils.hpp index e6bef5e5..b1917b27 100644 --- a/node/Utils.hpp +++ b/node/Utils.hpp @@ -34,6 +34,7 @@ #include <time.h> #include <sys/time.h> #include <arpa/inet.h> + #include <string> #include <stdexcept> #include <vector> @@ -392,6 +393,18 @@ public: static std::string trim(const std::string &s); /** + * Like sprintf, but appends to std::string + * + * @param s String to append to + * @param fmt Printf format string + * @param ... Format arguments + * @throws std::bad_alloc Memory allocation failure + * @throws std::length_error Format + args exceeds internal buffer maximum + */ + static void stdsprintf(std::string &s,const char *fmt,...) + throw(std::bad_alloc,std::length_error); + + /** * Count the number of bits set in an integer * * @param v 32-bit integer |