Line | |
---|
1 | #ifndef __FIELD__ |
---|
2 | #define __FIELD__ |
---|
3 | |
---|
4 | using XMLIOSERVER::XML::XMLNode; |
---|
5 | using XMLIOSERVER::XML::THashAttributes; |
---|
6 | |
---|
7 | namespace XMLIOSERVER |
---|
8 | { |
---|
9 | class Field : public ObjectTemplate<Field>, public FieldAttribut |
---|
10 | { |
---|
11 | public: |
---|
12 | Field(void) : ObjectTemplate<Field>(), FieldAttribut() |
---|
13 | {/* Ne rien faire de plus */} |
---|
14 | Field(const string& _id) : ObjectTemplate<Field>(_id), FieldAttribut() |
---|
15 | {/* Ne rien faire de plus */} |
---|
16 | |
---|
17 | void setAttributes(const THashAttributes& attr) |
---|
18 | { |
---|
19 | for (THashAttributes::ConstIterator it = attr.begin(); it != attr.end(); it++) |
---|
20 | if ((*it).first.compare(string("id"))) // Non prise en compte de l'identifiant lors de l'affectation des attributs. |
---|
21 | this->setSAttribut((*it).first, (*it).second); |
---|
22 | |
---|
23 | return; |
---|
24 | } |
---|
25 | |
---|
26 | virtual const char* getName(void) const {return ("Field"); } |
---|
27 | |
---|
28 | void parse (XMLNode& _node) |
---|
29 | { |
---|
30 | string name = _node.getElementName(); |
---|
31 | THashAttributes attributes; |
---|
32 | |
---|
33 | /// PARSING GESTION DES ATTRIBUTS /// |
---|
34 | _node.getAttributes(attributes); |
---|
35 | this->setAttributes(attributes); |
---|
36 | attributes.clear(); |
---|
37 | |
---|
38 | /// PARSING POUR GESION DES ENFANTS |
---|
39 | // Rien à faire. |
---|
40 | |
---|
41 | return; |
---|
42 | } |
---|
43 | |
---|
44 | ~Field(void) |
---|
45 | { /* Ne rien faire de plus */ } |
---|
46 | |
---|
47 | }; // class Field |
---|
48 | |
---|
49 | }; // namespace XMLIOSERVER |
---|
50 | |
---|
51 | #endif // __FIELD__ |
---|
Note: See
TracBrowser
for help on using the repository browser.