7 #ifndef __data_AsciiReader_h__ 8 #define __data_AsciiReader_h__ 15 class FE_DL_EXPORT AsciiReader :
public Reader
18 AsciiReader(sp<Scope> spScope);
19 virtual ~AsciiReader(
void);
20 virtual sp<RecordGroup> input(std::istream &istrm);
45 if(m_pBlock) { deallocate(m_pBlock); }
47 Token(
const Token &other)
52 Token &operator=(
const Token &other)
54 if(&other ==
this) {
return *
this; }
60 if(m_pBlock) { deallocate(m_pBlock); }
62 m_pBlock = allocate(m_size);
64 void copy(
const Token &other)
66 if(m_pBlock) { deallocate(m_pBlock); }
69 m_pBlock = allocate(other.m_size);
70 m_size = other.m_size;
71 memcpy(m_pBlock, other.m_pBlock, m_size);
73 m_string = other.m_string;
74 m_args = other.m_args;
80 bool isString(
void)
const 81 {
return (m_pBlock==NULL);}
86 if(m_pBlock) { deallocate(m_pBlock); }
91 if(!isString()) { feX(
"token not string"); }
94 operator const String &()
const 96 if(!isString()) { feX(
"token not string"); }
101 if(isString()) { feX(
"token is string"); }
104 const char *c_str(
void)
106 if(isString()) {
return m_string.c_str(); }
107 else return "[binary]";
109 String args(
void)
const 111 if(!isString()) { feX(
"token not string"); }
116 if(!isString()) { feX(
"token not string"); }
121 bool readToken(std::istream &a_istrm, Token &a_token);
124 void dispatchBlock(BlockType a_type,
126 Array<Token> &a_tokens);
127 void handleGroup(Array<Token> &a_tokens,
129 void handleAttribute(Array<Token> &a_tokens);
130 void handleLayout(Array<Token> &a_tokens);
131 void handleTemplate(Array<Token> &a_tokens);
132 void handleRecord(Array<Token> &a_tokens);
133 void handleInfo(Array<Token> &a_tokens);
134 void handleComment(Array<Token> &a_tokens);
135 void handleEnd(Array<Token> &a_tokens);
141 std::list<String> m_typenames;
142 sp<Attribute> m_spAttribute;
145 typedef std::map<String, AttributeInfo> t_attrinfo;
148 sp<Layout> m_spLayout;
149 t_attrinfo m_attributeInfos;
151 typedef std::map<String, LayoutInfo> t_id_layoutinfo;
154 struct RecordWiringInfo
157 Accessor<Record> m_aRecord;
160 typedef std::list<RecordWiringInfo> t_wiring;
162 struct WeakRecordWiringInfo
165 Accessor<WeakRecord> m_aRecord;
168 typedef std::list<WeakRecordWiringInfo> t_wk_wiring;
171 void readLayout(std::istream &istrm);
172 void readAttribute(std::istream &istrm);
173 void readState(std::istream &istrm);
174 void readRecord(std::istream &istrm, LayoutInfo &l_i);
175 void readRecordGroup(std::istream &istrm);
176 void wireRecords(
void);
177 void recordGroupsToArrays(
void);
178 void skip(std::istream &istrm,
int skipsize);
180 void fail(
const String &a_message);
183 void wireRecords(
void);
184 void recordGroupsToArrays(
void);
186 void tokenize(Array<String> &a_tokens,
187 std::string &a_string);
190 typedef std::map<String, Record> t_str_r;
191 typedef std::map<String, sp<RecordGroup> > t_id_rg;
192 typedef std::map<String, sp<RecordArray> > t_id_ra;
194 t_id_layoutinfo m_layoutInfos;
198 t_attrinfo m_attrInfos;
199 t_wiring m_wiringList;
200 t_wk_wiring m_wkWiringList;
202 sp<BaseType> m_spRecordGroupType;
203 sp<BaseType> m_spRecordArrayType;
204 sp<BaseType> m_spRecordType;
205 sp<BaseType> m_spWeakRecordType;
206 std::vector< sp<RecordGroup> > m_spDefaultRGs;
207 sp<RecordGroup> m_spDefaultRG;
209 sp<Scope> findScope(
const String &a_name);
211 unsigned int m_next_subst_id;
kernel
Definition: namespace.dox:3