Ignore:
Timestamp:
06/17/10 16:44:31 (14 years ago)
Author:
hozdoba
Message:

Commit intermédiaire ...
Remontée de plusieurs fonctionnalités dans l'arbre des héritages.
Amélioration de la lisibilité du code.
etc.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XMLIO_V2/dev/dev_rv/src/XMLIO/file.hpp

    r106 r107  
    66 
    77namespace XMLIOSERVER 
    8 {  
     8{ 
    99   class CFile : public ObjectTemplate<CFile>, public FileAttribut 
    1010   { 
    1111      public: 
    12        
     12 
    1313         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) 
    1921         { 
    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; 
    3024 
    31                         void parse (XMLNode& _node) 
    32                         { 
    33             string name = _node.getElementName();             
    34             THashAttributes attributes; 
    35              
    3625            /// PARSING GESTION DES ATTRIBUTS /// 
    37             _node.getAttributes(attributes);   
     26            _node.getAttributes(attributes); 
    3827            this->setAttributes(attributes); 
    3928            attributes.clear(); 
    40                         
    41             /// PARSING POUR GESION DES ENFANTS 
     29 
     30            /// PARSING POUR GESION DES ENFANTS /// 
    4231            if (_node.goToChildElement() and hasId()) 
    4332            { // Si la définition du fichier intégre des champs et si le fichier est identifié. 
    44              
    4533               _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            } 
    5336         } 
    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 
    5543         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 
    6148      private : 
    62        
     49 
    6350         FieldGroup* vfieldGroup; // FieldGroup "virtuel" 
    64        
    65    }; // class CFile  
    66        
     51 
     52   }; // class CFile 
     53 
    6754}; // namespace XMLIOSERVER 
    68     
     55 
    6956#endif // __CFILE__ 
Note: See TracChangeset for help on using the changeset viewer.