]> git.stg.codes - stg.git/blobdiff - include/stg/user_property.h
Small fixes.
[stg.git] / include / stg / user_property.h
index 9030d37fa459af8c2fc2299602d1a52ab8dba4b9..1716296acd7300482c53f3014c41d7f13869574d 100644 (file)
@@ -24,7 +24,7 @@ $Author: faust $
 #include "notifer.h"
 #include "noncopyable.h"
 
 #include "notifer.h"
 #include "noncopyable.h"
 
-extern const volatile time_t stgTime;
+extern volatile time_t stgTime;
 
 //-----------------------------------------------------------------------------
 template<typename varT>
 
 //-----------------------------------------------------------------------------
 template<typename varT>
@@ -51,6 +51,7 @@ public:
     time_t  ModificationTime() const throw() { return modificationTime; }
     void    ModifyTime() throw();
 
     time_t  ModificationTime() const throw() { return modificationTime; }
     void    ModifyTime() throw();
 
+    std::string ToString() const;
 private:
     varT & value;
     time_t modificationTime;
 private:
     varT & value;
     time_t modificationTime;
@@ -295,8 +296,8 @@ if ((priv->userConf && !isStat) ||
     std::stringstream oldVal;
     std::stringstream newVal;
 
     std::stringstream oldVal;
     std::stringstream newVal;
 
-    oldVal.flags(oldVal.flags() | ios::fixed);
-    newVal.flags(newVal.flags() | ios::fixed);
+    oldVal.flags(oldVal.flags() | std::ios::fixed);
+    newVal.flags(newVal.flags() | std::ios::fixed);
 
     oldVal << USER_PROPERTY<varT>::ConstData();
     newVal << val;
 
     oldVal << USER_PROPERTY<varT>::ConstData();
     newVal << val;
@@ -377,10 +378,16 @@ else
 //-------------------------------------------------------------------------
 template<typename varT>
 inline
 //-------------------------------------------------------------------------
 template<typename varT>
 inline
-ostream & operator<< (ostream & stream, const USER_PROPERTY<varT> & value)
+std::ostream & operator<< (std::ostream & stream, const USER_PROPERTY<varT> & value)
 {
 return stream << value.ConstData();
 }
 //-----------------------------------------------------------------------------
 {
 return stream << value.ConstData();
 }
 //-----------------------------------------------------------------------------
-
+template<typename varT>
+std::string USER_PROPERTY<varT>::ToString() const
+{
+std::stringstream stream;
+stream << value;
+return stream.str();
+}
 #endif // USER_PROPERTY_H
 #endif // USER_PROPERTY_H