Changeset 104 for XMLIO_V2/dev/dev_rv/src/XMLIO/field.hpp
- Timestamp:
- 06/07/10 18:34:17 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XMLIO_V2/dev/dev_rv/src/XMLIO/field.hpp
r98 r104 10 10 { 11 11 public: 12 12 13 Field(void) : ObjectTemplate<Field>(), FieldAttribut() 13 14 {/* Ne rien faire de plus */} … … 15 16 {/* Ne rien faire de plus */} 16 17 17 void setAttributes(const THashAttributes& attr)18 friend ostream& operator<< (ostream& out, const Field& c) 18 19 { 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; 20 out << "<" << c.getName(); 21 if(c.hasId()) out << " id=\"" << c.getId() << "\""; 22 for(unsigned int i = 0; i < c.attrList.getVectorSize(); i++) out << *c.attrList.getVector()[i]; 23 out << "/>"; 24 25 return (out); 24 26 } 25 27 26 virtual const char* getName(void) const {return ("Field"); } 28 void setAttributes(const THashAttributes& _attr) 29 { 30 for (THashAttributes::ConstIterator it = _attr.begin(); it != _attr.end(); it++) 31 if ((*it).first.compare(string("id"))) 32 // Non prise en compte de l'identifiant lors de l'affectation des attributs. 33 this->setSAttribut((*it).first, (*it).second); 34 } 35 36 void addAttributes(const StrHashMap<BaseAttribut>& _pattr) 37 { 38 StrHashMap<BaseAttribut>& _lattr = getAttributList(); 39 40 //_pattr contient les attributs du parent, _lattr les attributs locaux. 41 42 for(unsigned int i = 0; i < _lattr.getVectorSize(); i++) 43 { 44 if(_lattr.getVector()[i]->_hasValue() or !_pattr.getVector()[i]->_hasValue()) continue; 45 _lattr.getVector()[i]->assignValue(_pattr.getVector()[i]); 46 } 47 } 48 49 const char* getName(void) const {return ("Field"); } 27 50 28 51 void parse (XMLNode& _node)
Note: See TracChangeset
for help on using the changeset viewer.