Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
fix windows build
[simgrid.git] / include / xbt / string.hpp
index 2fcd61a..cafddcb 100644 (file)
@@ -1,5 +1,4 @@
-/* Copyright (c) 2015. The SimGrid Team.
- * All rights reserved.                                                     */
+/* Copyright (c) 2015-2017. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -11,8 +10,9 @@
 
 #include <string>
 #include <cstdarg>
+#include <stdlib.h>
 
-#if HAVE_MC
+#if SIMGRID_HAVE_MC
 
 #include <stdexcept>
 #include <cstddef>
@@ -27,7 +27,7 @@
 namespace simgrid {
 namespace xbt {
 
-#if HAVE_MC
+#if SIMGRID_HAVE_MC
 
 /** POD structure representation of a string
  */
@@ -165,10 +165,7 @@ public:
     return data()[i];
   }
   // Conversion
-  operator std::string() const
-  {
-    return std::string(this->c_str(), this->size());
-  }
+  operator std::string() const { return std::string(this->c_str(), this->size()); }
 
   // Iterators
   iterator begin()               { return data(); }
@@ -208,7 +205,7 @@ public:
   template<class X>
   bool operator!=(X const& that) const
   {
-    return !((*this) == that);
+    return not (*this == that);
   }
 
   // Compare:
@@ -298,9 +295,18 @@ typedef std::string string;
 
 #endif
 
-std::string string_vprintf(const char *fmt, va_list ap);
+/** Create a C++ string from a C-style format
+ *
+ * @ingroup XBT_str
+*/
 std::string string_printf(const char *fmt, ...);
 
+/** Create a C++ string from a C-style format
+ *
+ * @ingroup XBT_str
+*/
+std::string string_vprintf(const char *fmt, va_list ap);
+
 }
 }