Remove cork from being optional, just use it as we need it.
[m6w6/libmemcached] / libmemcached / options / context.h
index 562d3dc1176d4aaf2db049eb01ac7318dfa43b59..9e4ecb3a32d5d873f25e2937a914a5838f0bbe30 100644 (file)
 class Context
 {
 public:
-  Context(const char *option_string, size_t option_string_length, memcached_st *memc_arg) :
+  Context(const char *option_string, size_t option_string_length, memcached_st *memc_arg,
+          memcached_return_t &rc_arg) :
     scanner(NULL),
     begin(NULL),
     pos(0),
-    memc(NULL)
+    memc(NULL),
+    rc(rc_arg),
+    _end(false)
   {
     buf= option_string;
     length= option_string_length;
     memc= memc_arg;
     init_scanner();
+    rc= MEMCACHED_SUCCESS;
+  }
+
+  bool end()
+  {
+    return _end;
+  }
+
+  void start();
+
+  void set_end()
+  {
+    rc= MEMCACHED_SUCCESS;
+    _end= true;
   }
 
   ~Context()
@@ -65,8 +82,12 @@ public:
   size_t pos;
   size_t length;
   memcached_st *memc;
+  memcached_return_t &rc;
 
 protected:
   void init_scanner();   
   void destroy_scanner();
+
+private:
+  bool _end;
 };