00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef _MPCL_TEXT_CODEGEN_INSTRUCTION_TAG_STRING__
00027 #define _MPCL_TEXT_CODEGEN_INSTRUCTION_TAG_STRING__
00028
00029 #include "../../io/streamable.hh"
00030 #include "../regex/matcher.hh"
00031 #include "../string.hh"
00032
00033
00035 namespace mpcl
00036 {
00037
00039 namespace text
00040 {
00041
00043 namespace codegen
00044 {
00045
00046 using io::IStreamable;
00047 using std::basic_istream;
00048 using std::basic_ostream;
00049
00051 class TInstructionTagString;
00052
00057 template <typename TChar, typename TTraits>
00058 basic_istream<TChar, TTraits>&
00059 operator >> ( basic_istream<TChar, TTraits>& rtSOURCE_ISTREAM ,
00060 TInstructionTagString& ryTARGET_INSTRUCTION_TAG );
00061
00066 template <typename TChar, typename TTraits>
00067 basic_ostream<TChar, TTraits>&
00068 operator << ( basic_ostream<TChar, TTraits>& rtSOURCE_OSTREAM ,
00069 const TInstructionTagString& rkySOURCE_INSTRUCTION_TAG );
00070
00075 class TInstructionTagString :
00076 public TString ,
00077 public IStreamable<>
00078 {
00079
00080 public:
00081
00083 typedef
00084 IStreamable<>::char_type
00085 char_type;
00086
00088 typedef
00089 IStreamable<>::traits_type
00090 traits_type;
00091
00092
00093 public:
00094
00095
00096
00097
00098
00100 TInstructionTagString (void) :
00101 TString () ,
00102 IStreamable<> () {}
00103
00108 TInstructionTagString (const char* pkcSOURCE_TEXT) :
00109 TString (pkcSOURCE_TEXT) ,
00110 IStreamable<> () {}
00111
00116 TInstructionTagString (const TInstructionTagString& rkySOURCE_INSTRUCTION_TAG) :
00117 TString (rkySOURCE_INSTRUCTION_TAG) ,
00118 IStreamable<> () {}
00119
00120
00121 protected:
00122
00123
00124
00125
00126
00131 void read (basic_istream<char_type, traits_type>& rtSOURCE_ISTREAM);
00132
00133
00134 protected:
00135
00136
00137
00138
00139
00141 void write (basic_ostream<char_type, traits_type>& rtTARGET_OSTREAM) const;
00142
00143
00144 public:
00145
00146
00147
00148
00149
00150 friend basic_istream<value_type, traits_type>&
00151 operator >> <value_type, traits_type>
00152 (
00153 basic_istream<value_type, traits_type>& rtSOURCE_ISTREAM ,
00154 TInstructionTagString& ryTARGET_INSTRUCTION_TAG
00155 );
00156
00157 friend basic_ostream<value_type, traits_type>&
00158 operator << <value_type, traits_type>
00159 (
00160 basic_ostream<value_type, traits_type>& rtSOURCE_OSTREAM ,
00161 const TInstructionTagString& rkySOURCE_INSTRUCTION_TAG
00162 );
00163
00164 };
00165
00166
00167
00168
00169
00170 template <typename TChar, typename TTraits>
00171 basic_istream<TChar, TTraits>&
00172 operator >> ( basic_istream<TChar, TTraits>& rtSOURCE_ISTREAM ,
00173 TInstructionTagString& ryTARGET_INSTRUCTION_TAG )
00174 {
00175 ryTARGET_INSTRUCTION_TAG.read (rtSOURCE_ISTREAM);
00176 return rtSOURCE_ISTREAM;
00177 }
00178
00179 template <typename TChar, typename TTraits>
00180 basic_ostream<TChar, TTraits>&
00181 operator << ( basic_ostream<TChar, TTraits>& rtSOURCE_OSTREAM ,
00182 const TInstructionTagString& rkySOURCE_INSTRUCTION_TAG )
00183 {
00184 rkySOURCE_INSTRUCTION_TAG.write (rtSOURCE_OSTREAM);
00185 return rtSOURCE_OSTREAM;
00186 }
00187
00188 }
00189
00190 }
00191
00192 }
00193
00194
00195 #endif // not _MPCL_TEXT_CODEGEN_INSTRUCTION_TAG_STRING__