… | |
… | |
166 | }; |
166 | }; |
167 | |
167 | |
168 | INTERFACE_CLASS(object_thawer) |
168 | INTERFACE_CLASS(object_thawer) |
169 | struct object_thawer |
169 | struct object_thawer |
170 | { |
170 | { |
|
|
171 | static bool errors_are_fatal; // true during server startup only |
|
|
172 | |
171 | char *line; // current beginning of line |
173 | char *line; // current beginning of line |
172 | SV *text; // text part |
174 | SV *text; // text part |
173 | AV *av; // perl part |
175 | AV *av; // perl part |
174 | int linenum; |
176 | int linenum; |
175 | keyword kw; |
177 | keyword kw; |
… | |
… | |
179 | const char *name; |
181 | const char *name; |
180 | |
182 | |
181 | operator bool () const { return !!text; } |
183 | operator bool () const { return !!text; } |
182 | |
184 | |
183 | object_thawer (const_utf8_string path = 0); |
185 | object_thawer (const_utf8_string path = 0); |
|
|
186 | object_thawer (const_utf8_string dir, const_utf8_string file); |
184 | object_thawer (const_utf8_string data, AV *perlav); |
187 | object_thawer (const_utf8_string data, AV *perlav); |
185 | ~object_thawer (); |
188 | ~object_thawer (); |
186 | |
189 | |
187 | void get (attachable *obj, int oid); |
190 | void get (attachable *obj, int oid); |
188 | |
191 | |
… | |
… | |
190 | MTH void next (); |
193 | MTH void next (); |
191 | |
194 | |
192 | // parse next line, as a single value |
195 | // parse next line, as a single value |
193 | // skips initial whitespace and comments |
196 | // skips initial whitespace and comments |
194 | // and sets kw to KW_value on success. |
197 | // and sets kw to KW_value on success. |
195 | MTH void next_line (); |
198 | MTH bool next_line (); |
196 | |
199 | |
197 | // skip the current key-value (usually fetch next line, for |
200 | // skip the current key-value (usually fetch next line, for |
198 | // multiline-fields, skips till the corresponding end-kw |
201 | // multiline-fields, skips till the corresponding end-kw |
199 | MTH void skip (); |
202 | MTH void skip (); |
200 | MTH void skip_block (); // skips till and over KW_end |
203 | MTH void skip_block (); // skips till and over KW_end |
… | |
… | |
234 | }; |
237 | }; |
235 | std::vector<delayed_ref> delrefs; |
238 | std::vector<delayed_ref> delrefs; |
236 | |
239 | |
237 | void delayed_deref (attachable *op, object_ptr &ptr, const_utf8_string ref); |
240 | void delayed_deref (attachable *op, object_ptr &ptr, const_utf8_string ref); |
238 | MTH void resolve_delayed_derefs (bool deref = true); |
241 | MTH void resolve_delayed_derefs (bool deref = true); |
|
|
242 | private: |
|
|
243 | void new_from_path (const_utf8_string path); |
239 | }; |
244 | }; |
240 | |
245 | |
241 | #endif |
246 | #endif |
242 | |
247 | |