Update to support new warnings.
[m6w6/libmemcached] / libtest / cmdline.h
index 9dd9f813e82bdf307ce1b0567ce1f532b265ad32..46f7ad78a886f2997ad3e588920b9da9dd3f832b 100644 (file)
@@ -56,6 +56,26 @@ public:
     INVALID= 127
   };
 
+  static const char* toString(error_t arg)
+  {
+    switch (arg)
+    {
+    case Application::SUCCESS:
+      return "EXIT_SUCCESS";
+
+    case Application::FAILURE:
+      return "EXIT_FAILURE";
+
+    case Application::INVALID:
+      return "127";
+
+    default:
+      break;
+    }
+
+    return "EXIT_UNKNOWN";
+  }
+
   class Pipe {
   public:
     Pipe(int);
@@ -92,6 +112,7 @@ public:
   void add_long_option(const std::string& option_name, const std::string& option_value);
   error_t run(const char *args[]= NULL);
   error_t wait(bool nohang= true);
+  Application::error_t join();
 
   libtest::vchar_t stdout_result() const
   {
@@ -176,7 +197,7 @@ private:
   Pipe stdin_fd;
   Pipe stdout_fd;
   Pipe stderr_fd;
-  char * * built_argv;
+  libtest::vchar_ptr_t built_argv;
   pid_t _pid;
   libtest::vchar_t _stdout_buffer;
   libtest::vchar_t _stderr_buffer;
@@ -184,25 +205,7 @@ private:
 
 static inline std::ostream& operator<<(std::ostream& output, const enum Application::error_t &arg)
 {
-  switch (arg)
-  {
-    case Application::SUCCESS:
-      output << "EXIT_SUCCESS";
-      break;
-
-    case Application::FAILURE:
-      output << "EXIT_FAILURE";
-      break;
-
-    case Application::INVALID:
-      output << "127";
-      break;
-
-    default:
-      output << "EXIT_UNKNOWN";
-  }
-
-  return output;
+  return output << Application::toString(arg);
 }
 
 int exec_cmdline(const std::string& executable, const char *args[], bool use_libtool= false);