Changeset 107 for XMLIO_V2/dev/dev_rv/src/XMLIO/file.hpp
- Timestamp:
- 06/17/10 16:44:31 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XMLIO_V2/dev/dev_rv/src/XMLIO/file.hpp
r106 r107 6 6 7 7 namespace XMLIOSERVER 8 { 8 { 9 9 class CFile : public ObjectTemplate<CFile>, public FileAttribut 10 10 { 11 11 public: 12 12 13 13 CFile(void) : ObjectTemplate<CFile>(), FileAttribut(), vfieldGroup(NULL) 14 {/* Ne rien faire de plus */} 15 CFile(const string& _id) : ObjectTemplate<CFile>(_id), FileAttribut(), vfieldGroup(NULL) 16 {/* Ne rien faire de plus */} 17 18 friend ostream& operator<< (ostream& out, const CFile& c) 14 {/* Ne rien faire de plus */} 15 CFile(const string& _id) : ObjectTemplate<CFile>(_id), FileAttribut(), vfieldGroup(NULL) 16 {/* Ne rien faire de plus */} 17 18 static string GetName(void) { return ("file"); } 19 20 void parse (XMLNode& _node) 19 21 { 20 21 const AttributRegistrar &ar = c; 22 out << IncIndent << "<" << c.getName() << c.printId() << ar << ">" << std::endl; 23 if(c.vfieldGroup != NULL) out << *c.vfieldGroup << std::endl; 24 out << NIndent << "</" << c.getName()<< ">" << DecEndl; 25 26 return (out); 27 } 28 29 const char* getName(void) const {return ("File"); } 22 string name = _node.getElementName(); 23 THashAttributes attributes; 30 24 31 void parse (XMLNode& _node)32 {33 string name = _node.getElementName();34 THashAttributes attributes;35 36 25 /// PARSING GESTION DES ATTRIBUTS /// 37 _node.getAttributes(attributes); 26 _node.getAttributes(attributes); 38 27 this->setAttributes(attributes); 39 28 attributes.clear(); 40 41 /// PARSING POUR GESION DES ENFANTS 29 30 /// PARSING POUR GESION DES ENFANTS /// 42 31 if (_node.goToChildElement() and hasId()) 43 32 { // Si la définition du fichier intégre des champs et si le fichier est identifié. 44 45 33 _node.goToParentElement(); 46 47 vfieldGroup = (FieldGroup*)(&FieldGroup::CreateObject(getId())); 48 vfieldGroup->parse(_node, false); 49 50 } else _node.goToParentElement(); 51 52 return; 34 vfieldGroup = CreateInstanceAndParse<FieldGroup>(attributes, _node, getId().c_str(), false ); 35 } 53 36 } 54 37 38 virtual bool hasChild(void) const { return (vfieldGroup != NULL); } 39 virtual void printChild(ostream& out) const { out << *vfieldGroup << std::endl; } 40 virtual void resolveDescInheritance(const AttributRegistrar* _parent = 0) 41 { addAttributes(*_parent); if(vfieldGroup != NULL) vfieldGroup->resolveDescInheritance(); } 42 55 43 FieldGroup* getVirtualFieldGroup(void) { return (vfieldGroup); } 56 bool hasVirtualFieldGroup(void) { return (vfieldGroup != NULL); } 57 58 ~CFile(void) 59 { if(vfieldGroup != NULL) delete vfieldGroup; } 60 44 45 ~CFile(void) 46 { if(vfieldGroup != NULL) delete vfieldGroup; } 47 61 48 private : 62 49 63 50 FieldGroup* vfieldGroup; // FieldGroup "virtuel" 64 65 }; // class CFile 66 51 52 }; // class CFile 53 67 54 }; // namespace XMLIOSERVER 68 55 69 56 #endif // __CFILE__
Note: See TracChangeset
for help on using the changeset viewer.