From: Padraig O'Sullivan Date: Fri, 10 Jul 2009 05:06:00 +0000 (-0400) Subject: Added the lib_version() function to the C++ interface. X-Git-Tag: 0.32~17^2~7 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=2b050c60e5cbc2d5d289d8c5c34984eab4a1c9e2;p=awesomized%2Flibmemcached Added the lib_version() function to the C++ interface. --- diff --git a/libmemcached/memcached.hh b/libmemcached/memcached.hh index deceae82..8144a42c 100644 --- a/libmemcached/memcached.hh +++ b/libmemcached/memcached.hh @@ -1,13 +1,10 @@ -#include "libmemcached/memcached.h" -#include +#include +#include #include class Memcached { - memcached_st memc; - memcached_result_st result; - public: Memcached() @@ -79,11 +76,12 @@ public: return ret_val; } - memcached_return mget(char **keys, size_t *key_length, - unsigned int number_of_keys) + bool mget(char **keys, size_t *key_length, + unsigned int number_of_keys) { - return memcached_mget(&memc, keys, key_length, number_of_keys); + memcached_return rc= memcached_mget(&memc, keys, key_length, number_of_keys); + return (rc == MEMCACHED_SUCCESS); } bool set(const std::string& key, const char *value, size_t value_length) @@ -226,4 +224,15 @@ public: key, strlen(key), 0); return (rc == MEMCACHED_SUCCESS); } + + const std::string lib_version() const + { + const char *ver= memcached_lib_version(); + const std::string version(ver); + return version; + } + +private: + memcached_st memc; + memcached_result_st result; };