allow an std::string to be an attribute
authorMathieu Lacage <mathieu.lacage@sophia.inria.fr>
Fri, 11 Apr 2008 11:24:42 -0700
changeset 2949 a42da8051124
parent 2948 858fc65447a5
child 2950 9e20fb862cd8
allow an std::string to be an attribute
src/core/string.cc
src/core/string.h
--- a/src/core/string.cc	Thu Apr 10 13:01:53 2008 -0700
+++ b/src/core/string.cc	Fri Apr 11 11:24:42 2008 -0700
@@ -27,6 +27,11 @@
   return m_value;
 }
 
+String::operator std::string () const
+{
+  return m_value;
+}
+
 std::ostream & operator << (std::ostream &os, const String &value)
 {
   os << value.Get ();
--- a/src/core/string.h	Thu Apr 10 13:01:53 2008 -0700
+++ b/src/core/string.h	Fri Apr 11 11:24:42 2008 -0700
@@ -22,6 +22,8 @@
   void Set (const char *value);
   std::string Get (void) const;
 
+  operator std::string () const;
+
   ATTRIBUTE_HELPER_HEADER_1 (String);
 private:
   std::string m_value;