--- /dev/null
+// Roast+ License
+/*
+*/
+#ifndef __SFJP_ROAST__lexical2__string_HPP__
+#define __SFJP_ROAST__lexical2__string_HPP__
+
+#pragma warning(disable:4503)
+
+namespace roast
+{
+ namespace lexical
+ {
+ ///////////////////////////////////////////////////////////////////
+
+ template <typename _EncCheck>
+ struct string_// : not_lengthable
+ {
+ ::std::string m_str;
+
+ //////////////////////////////////////////////////
+ string_(){}
+ string_(const char* s) : m_str(s){}
+ string_(const ::std::string& s) : m_str(s){}
+
+ template <typename _It, typename _Param>
+ bool analyze(_It& it, _Param& param)
+ {
+ for(const char* p=m_str.c_str(); *p!='\0'; p++, it++)
+ {
+ // Check the char
+ const _It it_work = it;
+ _EncCheck checker;
+ if ( checker.analyze(it_work, param) == false )
+ break;
+
+ m_str.append(1,*p);
+ }
+ return true;
+ }
+
+ template <typename _Strm, typename _Document>
+ bool generate(_Strm& strm, _Document& doc) const
+ {
+ strm << m_str;
+ return true;
+ }
+
+ operator ::std::string() { return m_str; }
+ operator const ::std::string() const { return m_str; }
+ operator const char*() const { return m_str.c_str(); }
+ const char* c_str() const { return m_str.c_str(); }
+
+ bool operator == (const char* s) const {
+ return m_str == s;
+ }
+ bool operator != (const char* s) const {
+ return m_str != s;
+ }
+ };
+ /////
+ class string : public string_<chars::null>
+ {
+ private:
+ typedef string_<chars::null> _Base;
+ public:
+ string(){}
+ string(const char* s) : _Base(s){}
+ string(const ::std::string& s) : _Base(s){}
+
+ string operator = (const char* s){
+ _Base::m_str = s;
+ return *this;
+ }
+ string operator = (const ::std::string& s){
+ _Base::m_str = s;
+ return *this;
+ }
+ /*string operator = (const string& s){
+ _Base::m_str = s.m_str;
+ return *this;
+ }*/
+ };
+
+ ///////////////////////////////////////////////////////////////////
+ }
+}
+
+#endif//__SFJP_ROAST__lexical2__string_HPP__