19 |
|
#include <menes-xml/textwriter.hpp> |
20 |
|
|
21 |
|
#include <map> |
22 |
+ |
#include <set> |
23 |
|
|
24 |
< |
struct Environment |
25 |
< |
{ |
26 |
< |
ext::String get(const ext::String& name) { try { return api::TheEnvironment.Get(name); } catch (ext::Exception) { return ext::String(); } } |
27 |
< |
}; |
24 |
> |
#define _sforeach(type, item, set) \ |
25 |
> |
for (bool _stop(true); _stop; ) \ |
26 |
> |
for (const type& _set = set; _stop; _stop = false) \ |
27 |
> |
_for (type::const_iterator, item, _set.begin(), _set.end()) |
28 |
|
|
29 |
< |
extern Environment env; |
29 |
> |
struct Item; |
30 |
|
|
31 |
|
class Represent |
32 |
|
{ |
35 |
|
void parse(); |
36 |
|
void headings(xml::TextWriter& xhtml); |
37 |
|
void form(xml::TextWriter& xhtml); |
38 |
+ |
void output(xml::TextWriter& xhtml); |
39 |
+ |
template <typename Type> void output(xml::TextWriter& xhtml, const Item& item, size_t index); |
40 |
+ |
template <typename Type> Type input(const Item& item); |
41 |
+ |
template <typename Type> void normal(xml::TextWriter& xhtml, const Type& type); |
42 |
+ |
template <typename Type> void binary(xml::TextWriter& xhtml, const Type& type); |
43 |
+ |
template <typename Type> void hexadecimal(xml::TextWriter& xhtml, const Type& type); |
44 |
|
public: |
45 |
|
Represent(); |
46 |
|
}; |