Cleaning up formatting in the C++ interface.
authorPadraig O'Sullivan <osullivan.padraig@gmail.com>
Fri, 10 Jul 2009 06:18:50 +0000 (02:18 -0400)
committerPadraig O'Sullivan <osullivan.padraig@gmail.com>
Fri, 10 Jul 2009 06:18:50 +0000 (02:18 -0400)
libmemcached/memcached.hh

index 4e22b61cd22edc5e0c21eaa7a3e7f18d1df1f07b..d777e1392ef71001cfeabfb32fdbe8879c618257 100644 (file)
@@ -27,7 +27,7 @@ public:
     memcached_free(&memc);
   }
 
-  std::string fetch(std::stringkey, size_t *key_length, size_t *value_length)
+  std::string fetch(std::string &key, size_t *key_length, size_t *value_length)
   {
     uint32_t flags;
     memcached_return rc;
@@ -42,7 +42,7 @@ public:
     return ret_val;
   }
 
-  std::string get(const std::stringkey, size_t *value_length) 
+  std::string get(const std::string &key, size_t *value_length) 
   {
     uint32_t flags;
     memcached_return rc;
@@ -57,8 +57,8 @@ public:
     return ret_val;
   }
 
-  std::string get_by_key(const std::stringmaster_key, 
-                         const std::stringkey, 
+  std::string get_by_key(const std::string &master_key, 
+                         const std::string &key, 
                          size_t *value_length)
   {
     uint32_t flags;
@@ -83,7 +83,7 @@ public:
     return (rc == MEMCACHED_SUCCESS);
   }
 
-  bool set(const std::string& key, const std::string& value)
+  bool set(const std::string &key, const std::string &value)
   {
     memcached_return rc= memcached_set(&memc, 
                                        key.c_str(), key.length(),
@@ -92,9 +92,9 @@ public:
     return (rc == MEMCACHED_SUCCESS);
   }
 
-  bool set_by_key(const std::stringmaster_key, 
-                  const std::stringkey, 
-                  const std::stringvalue)
+  bool set_by_key(const std::string &master_key, 
+                  const std::string &key, 
+                  const std::string &value)
   {
     memcached_return rc= memcached_set_by_key(&memc, master_key.c_str(), 
                                               master_key.length(),
@@ -105,14 +105,14 @@ public:
     return (rc == MEMCACHED_SUCCESS);
   }
 
-  bool increment(const std::stringkey, unsigned int offset, uint64_t *value)
+  bool increment(const std::string &key, unsigned int offset, uint64_t *value)
   {
     memcached_return rc= memcached_increment(&memc, key.c_str(), key.length(),
                                              offset, value);
     return (rc == MEMCACHED_SUCCESS);
   }
 
-  bool decrement(const std::stringkey, unsigned int offset, uint64_t *value)
+  bool decrement(const std::string &key, unsigned int offset, uint64_t *value)
   {
     memcached_return rc= memcached_decrement(&memc, key.c_str(), 
                                              key.length(),
@@ -121,15 +121,16 @@ public:
   }
 
 
-  bool add(const std::string& key, const std::string& value, size_t value_length)
+  bool add(const std::string &key, const std::string &value)
   {
     memcached_return rc= memcached_add(&memc, key.c_str(), key.length(), 
-                                       value.c_str(), value_length, 0, 0);
+                                       value.c_str(), value.length(), 0, 0);
     return (rc == MEMCACHED_SUCCESS);
   }
 
-  bool add_by_key(const std::string& master_key, const std::string& key, 
-                  const std::string& value, size_t value_length)
+  bool add_by_key(const std::string &master_key, 
+                  const std::string &key, 
+                  const std::string &value)
   {
     memcached_return rc= memcached_add_by_key(&memc, 
                                               master_key.c_str(),
@@ -137,22 +138,22 @@ public:
                                               key.c_str(),
                                               key.length(),
                                               value.c_str(), 
-                                              value_length,
+                                              value.length(),
                                               0, 0);
     return (rc == MEMCACHED_SUCCESS);
   }
 
-  bool replace(const std::string& key, const std::string& value, 
-               size_t value_length)
+  bool replace(const std::string &key, const std::string &value)
   {
     memcached_return rc= memcached_replace(&memc, key.c_str(), key.length(),
-                                           value.c_str(), value_length,
+                                           value.c_str(), value.length(),
                                            0, 0);
     return (rc == MEMCACHED_SUCCESS);
   }
 
-  bool replace_by_key(const std::string& master_key, const std::string& key, 
-                      const std::string& value, size_t value_length)
+  bool replace_by_key(const std::string &master_key, 
+                      const std::string &key, 
+                      const std::string &value)
   {
     memcached_return rc= memcached_replace_by_key(&memc, 
                                                   master_key.c_str(), 
@@ -160,21 +161,21 @@ public:
                                                   key.c_str(), 
                                                   key.length(),
                                                   value.c_str(), 
-                                                  value_length
+                                                  value.length()
                                                   0, 0);
     return (rc == MEMCACHED_SUCCESS);
   }
 
-  bool prepend(const std::string& key, const std::string& value, 
-               size_t value_length)
+  bool prepend(const std::string &key, const std::string &value)
   {
     memcached_return rc= memcached_prepend(&memc, key.c_str(), key.length(),
-                                           value.c_str(), value_length, 0, 0);
+                                           value.c_str(), value.length(), 0, 0);
     return (rc == MEMCACHED_SUCCESS);
   }
 
-  bool prepend_by_key(const std::string& master_key, const std::string& key, 
-                      const std::string& value, size_t value_length)
+  bool prepend_by_key(const std::string &master_key, 
+                      const std::string &key, 
+                      const std::string &value)
   {
     memcached_return rc= memcached_prepend_by_key(&memc, 
                                                   master_key.c_str(), 
@@ -182,25 +183,26 @@ public:
                                                   key.c_str(), 
                                                   key.length(),
                                                   value.c_str(), 
-                                                  value_length,
+                                                  value.length(),
                                                   0,
                                                   0);
     return (rc == MEMCACHED_SUCCESS);
   }
 
-  bool append(const std::string& key, const std::string& value, 
-              size_t value_length)
+  bool append(const std::string &key, const std::string &value)
   {
     memcached_return rc= memcached_append(&memc, 
                                           key.c_str(), 
                                           key.length(),
                                           value.c_str(), 
-                                          value_length, 0, 0);
+                                          value.length(), 
+                                          0, 0);
     return (rc == MEMCACHED_SUCCESS);
   }
 
-  bool append_by_key(const std::string& master_key, const std::string& key, 
-                     const std::string& value, size_t value_length)
+  bool append_by_key(const std::string &master_key, 
+                     const std::string &key, 
+                     const std::string &value)
   {
     memcached_return rc= memcached_append_by_key(&memc,
                                                  master_key.c_str(), 
@@ -208,20 +210,24 @@ public:
                                                  key.c_str(), 
                                                  key.length(),
                                                  value.c_str(), 
-                                                 value_length, 0, 0);
+                                                 value.length(), 
+                                                 0, 0);
     return (rc == MEMCACHED_SUCCESS);
   }
 
-  bool cas(const std::string& key, const std::string& value, 
-           size_t value_length, uint64_t cas_arg)
+  bool cas(const std::string &key, 
+           const std::string &value, 
+           uint64_t cas_arg)
   {
     memcached_return rc= memcached_cas(&memc, key.c_str(), key.length(),
-                                       value.c_str(), value_length, 0, 0, cas_arg);
+                                       value.c_str(), value.length(), 
+                                       0, 0, cas_arg);
     return (rc == MEMCACHED_SUCCESS);
   }
 
-  bool cas_by_key(const std::string& master_key, const std::string& key, 
-                  const std::string& value, size_t value_length, 
+  bool cas_by_key(const std::string &master_key, 
+                  const std::string &key, 
+                  const std::string &value, 
                   uint64_t cas_arg)
   {
     memcached_return rc= memcached_cas_by_key(&memc,
@@ -230,20 +236,20 @@ public:
                                               key.c_str(), 
                                               key.length(),
                                               value.c_str(), 
-                                              value_length,
+                                              value.length(),
                                               0, 0, cas_arg);
     return (rc == MEMCACHED_SUCCESS);
   }
 
   // using 'remove' vs. 'delete' since 'delete' is a keyword 
-  bool remove(const std::stringkey)
+  bool remove(const std::string &key)
   {
     memcached_return rc= memcached_delete(&memc, key.c_str(), key.length(), 0);
     return (rc == MEMCACHED_SUCCESS);
   }
 
-  bool delete_by_key(const std::stringmaster_key, 
-                     const std::stringkey)
+  bool delete_by_key(const std::string &master_key, 
+                     const std::string &key)
   {
     memcached_return rc= memcached_delete_by_key(&memc, 
                                                  master_key.c_str(),