include/xot/string.h in xot-0.1.6 vs include/xot/string.h in xot-0.1.7
- old
+ new
@@ -6,38 +6,57 @@
#include <stdarg.h>
#include <string>
+#define XOT_STRINGF(format, result) \
+ Xot::String result; \
+ do \
+ { \
+ if (format) \
+ { \
+ va_list args; \
+ va_start(args, format); \
+ result = Xot::stringf(format, args); \
+ va_end(args); \
+ } \
+ } \
+ while (false)
+
+
namespace Xot
{
- typedef std::string String;
+ class String : public std::string
+ {
+ typedef std::string Super;
+ public:
+
+ String ();
+
+ String (const char* str);
+
+ operator const char* () const;
+
+ friend String operator + (const String& lhs, const String& rhs);
+
+ friend String operator + (const String& lhs, const char* rhs);
+
+ friend String operator + (const char* lhs, const String& rhs);
+
+ };// String
+
+
String stringf (const char* format, ...);
String stringf (const char* format, va_list args);
template <typename T> String to_s (const T& val);
}// Xot
-
-
-#define XOT_STRINGF(format, result) \
- Xot::String result; \
- do \
- { \
- if (format) \
- { \
- va_list args; \
- va_start(args, format); \
- result = Xot::stringf(format, args); \
- va_end(args); \
- } \
- } \
- while (false)
#endif//EOH