Changeset 114 for XMLIO_V2/dev/dev_rv


Ignore:
Timestamp:
06/23/10 10:29:45 (14 years ago)
Author:
hozdoba
Message:

Le code respecte davantage la norme C++ 98 pour le portage sur les différentes plate-formes,

Une compilation plus restrictive passe sans problÚme sous gcc avec les options de compilation suivantes :
"-W -Wall -Wextra -Werror -ansi -pedantic "
et le retrait de certain avertissements :
-Wno-ignored-qualifiers < plusieurs avertissements dans Blitz.
-Wno-unused-parameter < des paramÚtres ne sont pas utilisés dans la classe BaseAttribut? (voir les get/set)
-Wno-long-long < besoin des long long pour le calendrier.

Location:
XMLIO_V2/dev/dev_rv/src/XMLIO
Files:
2 deleted
16 edited

Legend:

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

    r113 r114  
    9090 
    9191   }; // class Attribut 
    92 }; // namespace XMLIOSERVER 
     92} // namespace XMLIOSERVER 
    9393 
    9494#endif //__ATTRIBUT__ 
  • XMLIO_V2/dev/dev_rv/src/XMLIO/attribut_registrar.hpp

    r113 r114  
    6565 
    6666   }; // class AttributRegistrar 
    67 }; // namespace XMLIOSERVER 
     67} // namespace XMLIOSERVER 
    6868 
    6969 
  • XMLIO_V2/dev/dev_rv/src/XMLIO/axis.hpp

    r113 r114  
    2323   }; // class CAxis 
    2424 
    25 }; // namespace XMLIOSERVER 
     25} // namespace XMLIOSERVER 
    2626 
    27 DECLARE_GROUP(Axis); 
     27DECLARE_GROUP(Axis) 
    2828 
    2929#endif // __AXIS__ 
  • XMLIO_V2/dev/dev_rv/src/XMLIO/base_attribut.hpp

    r113 r114  
    5656#endif //__BASE_ATTRIBUT__ 
    5757 
     58 
     59 
     60 
  • XMLIO_V2/dev/dev_rv/src/XMLIO/c_interface.cpp

    r112 r114  
    1 /*using namespace XMLIOSERVER; 
     1#include "xmlio.hpp" 
     2 
     3using namespace XMLIOSERVER; 
    24using namespace XMLIOSERVER::XML; 
    35using namespace std; 
    46 
    5 extern "C" 
    6 { // Début du code C 
    7     
    8    typedef void *XMLIOhandle; 
    9     
    10    // VIDE TEMPORAIREMENT 
    11     
    12 }*/ 
     7extern "C" void main_c_(void) ; 
    138 
     9void main_c_ (void) 
     10{ 
     11   try 
     12   { 
     13      string file("/local/XMLIOSERVER_DEV/dev_rv/test/iodef_test.xml"); 
     14      //string file("/local/XMLIOSERVER_DEV/dev_rv/iodef_test.xml"); 
     15 
     16      ifstream istr( file.c_str() , ifstream::in ); 
     17 
     18      // On commence la lecture du flux de donnée xml qui doit posséder pour racine un unique noeud nommé "simulation". 
     19      XMLNode node = XMLNode::CreateNode(istr, Context::GetRootName()); 
     20      // On parse le fichier xml noeud par noeud (ie on construit dynamiquement notre arbre d'objets). 
     21      XMLParser::Parse(node); 
     22 
     23      // On résoud les héritages descendants ainsi que les héritages par référence. 
     24      Context::ResolveInheritance(); 
     25 
     26      // On écrit l'arborescence résultante du traitement sur la sortie. 
     27      Context::ShowTree(std::clog); 
     28 
     29   } 
     30   catch(const Exception &exc) 
     31   {  // Pour tout type d'exceptions, on note les informations sur la sortie paramétrée. 
     32      ERROR(exc.displayText()); 
     33      // On retourne le code d'erreur en fin d'application pour traitements éventuels. 
     34      // return (exc.code()); 
     35   } 
     36 
     37// return (0); 
     38} 
  • XMLIO_V2/dev/dev_rv/src/XMLIO/container.hpp

    r113 r114  
    9898   }; // class StrHashMap 
    9999 
    100 }; // namespace XMLIOSERVER 
     100} // namespace XMLIOSERVER 
    101101 
    102102#endif // __XMLIO_CONTAINER__ 
  • XMLIO_V2/dev/dev_rv/src/XMLIO/context.hpp

    r113 r114  
    1616         static void ShowTree(ostream& os = std::clog) 
    1717         { 
    18             clog << NIndent << "<?xml version=\"1.0\"?>" << std::endl; 
    19             clog << NIndent << "<"<< Context::GetRootName() << ">" << std::endl; 
     18            os << NIndent << "<?xml version=\"1.0\"?>" << std::endl; 
     19            os << NIndent << "<"<< Context::GetRootName() << ">" << std::endl; 
    2020            HashMap<string, StrHashMap<Context> > &AllListContext = Context::GetAllListObject(); 
    2121            for (HashMap<string, StrHashMap<Context> >::Iterator it = AllListContext.begin(); it != AllListContext.end(); it++) 
    2222               // On sort chacun des contextes successivement. 
    23             { Context::SetCurrentContext((*it).first); clog << *((*it).second)[(*it).first] << std::endl; } 
    24             clog << NIndent << "</" << Context::GetRootName() << ">" << std::endl  ; 
     23            { Context::SetCurrentContext((*it).first); os << *((*it).second)[(*it).first] << std::endl; } 
     24            os << NIndent << "</" << Context::GetRootName() << ">" << std::endl  ; 
    2525         } 
    2626 
     
    9191 
    9292                  if (name.compare(FieldDefinition::GetDefName()) == 0) // Parsing définition des champs. 
    93                   { fieldDef = CreateInstanceAndParse<FieldDefinition>(attributes, _node, FieldDefinition::GetDefName().c_str()); continue; } 
     93                  { fieldDef = CreateInstanceAndParse<FieldDefinition>(_node, FieldDefinition::GetDefName().c_str()); continue; } 
    9494 
    9595                  if (name.compare(FileDefinition::GetDefName()) == 0) // Parsing définition des fichiers. 
    96                   { fileDef  = CreateInstanceAndParse<FileDefinition >(attributes, _node, FileDefinition ::GetDefName().c_str()); continue; } 
     96                  { fileDef  = CreateInstanceAndParse<FileDefinition >(_node, FileDefinition ::GetDefName().c_str()); continue; } 
    9797 
    9898                  if (name.compare(AxisDefinition::GetDefName()) == 0) // Parsing pour la définition des axes. 
    99                   { axisDef  = CreateInstanceAndParse<AxisDefinition >(attributes, _node, AxisDefinition ::GetDefName().c_str()); continue; } 
     99                  { axisDef  = CreateInstanceAndParse<AxisDefinition >(_node, AxisDefinition ::GetDefName().c_str()); continue; } 
    100100 
    101101                  if (name.compare(GridDefinition::GetDefName()) == 0) // Parsing pour la définition des grilles. 
    102                   { gridDef  = CreateInstanceAndParse<GridDefinition >(attributes, _node, GridDefinition ::GetDefName().c_str()); continue; } 
     102                  { gridDef  = CreateInstanceAndParse<GridDefinition >(_node, GridDefinition ::GetDefName().c_str()); continue; } 
    103103 
    104104                  WARNING("La définition est invalide, seules les champs, grilles, axes et fichiers peuvent être définis !"); 
     
    125125            if(gridDef != NULL)  out << *(GridDefinition*) gridDef  << std::endl; 
    126126         } 
     127 
    127128         virtual void resolveDescInheritance(const AttributRegistrar* _parent = 0) 
    128129         { 
     130            if (_parent != 0) return; 
    129131            // Résolution des héritages descendants pour chacun des groupes de définitions. 
    130132            if(fieldDef != NULL) fieldDef->resolveDescInheritance(); 
  • XMLIO_V2/dev/dev_rv/src/XMLIO/declare_group.hpp

    r112 r114  
    1414      }; \ 
    1515      typedef child_type##Group child_type##Definition; \ 
    16    }; 
     16   } 
    1717 
    1818#endif // __DECLARE_GROUP__ 
  • XMLIO_V2/dev/dev_rv/src/XMLIO/exception.hpp

    r112 r114  
    11#ifndef __XMLIO_EXCEPTION__ 
    2 #define __XMLIO_EXCEPTION__  
     2#define __XMLIO_EXCEPTION__ 
    33 
    44// Classes utilisées issues de la STL 
     
    1313   { 
    1414      public : 
    15              
    16          XMLIOException(int _code): Exception(_code)                                                    
    17          { /* Ne rien faire de plus */ }                                                                      
    18          XMLIOException(const std::string& _msg, int _code): Exception(_msg, _code)                               
    19          { /* Ne rien faire de plus */ }                                                                         
    20          XMLIOException(const std::string& _msg, const std::string& _arg, int _code): Exception(_msg, _arg, _code)       
    21          { /* Ne rien faire de plus */ }                                                                         
    22          XMLIOException(const std::string& _msg, const Poco::Exception& _exc, int _code): Exception(_msg, _exc, _code)    
    23          { /* Ne rien faire de plus */ }    
    24           
    25                                                                                
    26          XMLIOException(const XMLIOException& _exc): Exception(_exc)                                                 
     15 
     16         XMLIOException(int _code): Exception(_code) 
    2717         { /* Ne rien faire de plus */ } 
    28           
     18         XMLIOException(const std::string& _msg, int _code): Exception(_msg, _code) 
     19         { /* Ne rien faire de plus */ } 
     20         XMLIOException(const std::string& _msg, const std::string& _arg, int _code): Exception(_msg, _arg, _code) 
     21         { /* Ne rien faire de plus */ } 
     22         XMLIOException(const std::string& _msg, const Poco::Exception& _exc, int _code): Exception(_msg, _exc, _code) 
     23         { /* Ne rien faire de plus */ } 
     24 
     25 
     26         XMLIOException(const XMLIOException& _exc): Exception(_exc) 
     27         { /* Ne rien faire de plus */ } 
     28 
    2929         ~XMLIOException() throw() 
    3030         { /* Ne rien faire de plus */ } 
    31           
    32          XMLIOException& operator = (const XMLIOException& _exc)                                              
    33          { Exception::operator = (_exc); return *this; }    
    34                                                                             
    35          virtual const char* name(void) const throw() { return ("XMLIO>XMLIOException"); }                                                                      
    36          virtual const char* className(void) const throw() { return (typeid(*this).name()); }       
    37                                                                       
    38          virtual Exception* clone(void) const {   return new XMLIOException(*this); }                                                                      
     31 
     32         XMLIOException& operator = (const XMLIOException& _exc) 
     33         { Exception::operator = (_exc); return *this; } 
     34 
     35         virtual const char* name(void) const throw() { return ("XMLIO>XMLIOException"); } 
     36         virtual const char* className(void) const throw() { return (typeid(*this).name()); } 
     37 
     38         virtual Exception* clone(void) const {   return new XMLIOException(*this); } 
    3939         virtual void rethrow(void) const { throw *this; } 
    40                 
     40 
    4141   };// class XMLIOException 
    42     
     42 
    4343   class XMLIOUndefinedValueException : public XMLIOException 
    4444   { 
     
    4646         XMLIOUndefinedValueException(const std::string& _msg): XMLIOException(_msg, 1001) {} 
    4747         const char* name(void) const throw() { return ("XMLIO>UndefinedValueException"); } 
    48              
     48 
    4949   }; //class XMLIOUndefinedException 
    50     
     50 
    5151   class XMLIOStreamException : public XMLIOException 
    5252   { 
     
    5454         XMLIOStreamException(const std::string& _msg): XMLIOException(_msg, 1002) {} 
    5555         const char* name(void) const throw() { return ("XMLIO>StreamException"); } 
    56              
     56 
    5757   }; //class XMLIOStreamException 
    58     
     58 
    5959   class XMLParsingException : public XMLIOException 
    6060   { 
     
    6262         XMLParsingException(const std::string& _msg): XMLIOException(_msg, 1003) {} 
    6363         const char* name(void) const throw() { return ("XMLIO>XMLParsingException"); } 
    64              
     64 
    6565   }; //class XMLParsingException 
    66     
     66 
    6767   class XMLIOIncompatibleTypeException : public XMLIOException 
    6868   { 
     
    7070         XMLIOIncompatibleTypeException(const std::string& _msg): XMLIOException(_msg, 1003) {} 
    7171         const char* name(void) const throw() { return ("XMLIO>XMLIOIncompatibeTypeException"); } 
    72              
     72 
    7373   }; //class XMLIOIncompatibeTypeException 
    74     
     74 
    7575   // A compléter. 
    76     
    77 };// namespace XMLIOSERVER 
    7876 
    79 #endif // __XMLIO_EXCEPTION__  
     77}// namespace XMLIOSERVER 
     78 
     79#endif // __XMLIO_EXCEPTION__ 
  • XMLIO_V2/dev/dev_rv/src/XMLIO/field.hpp

    r113 r114  
    3232   }; // class CField 
    3333 
    34 }; // namespace XMLIOSERVER 
     34} // namespace XMLIOSERVER 
    3535 
    36 DECLARE_GROUP(Field); 
     36DECLARE_GROUP(Field) 
    3737 
    3838#endif // __FIELD__ 
  • XMLIO_V2/dev/dev_rv/src/XMLIO/file.hpp

    r113 r114  
    3232            { // Si la définition du fichier intégre des champs et si le fichier est identifié. 
    3333               _node.goToParentElement(); 
    34                vfieldGroup = CreateInstanceAndParse<FieldGroup>(attributes, _node, getId().c_str(), false ); 
     34               vfieldGroup = CreateInstanceAndParse<FieldGroup>(_node, getId().c_str(), false ); 
    3535            } 
    3636         } 
     
    6464   }; // class CFile 
    6565 
    66 }; // namespace XMLIOSERVER 
     66} // namespace XMLIOSERVER 
    6767 
    68 DECLARE_GROUP(File); 
     68DECLARE_GROUP(File) 
    6969 
    7070 
  • XMLIO_V2/dev/dev_rv/src/XMLIO/grid.hpp

    r113 r114  
    2323   }; // class CGrid 
    2424 
    25 }; // namespace XMLIOSERVER 
     25} // namespace XMLIOSERVER 
    2626 
    27 DECLARE_GROUP(Grid); 
     27DECLARE_GROUP(Grid) 
    2828 
    2929#endif // __GRID__ 
  • XMLIO_V2/dev/dev_rv/src/XMLIO/logger.hpp

    r112 r114  
    3535      public : 
    3636 
    37          ILogger(const string& _fileLogName, bool _withConsole = true) 
     37         ILogger() 
    3838         { 
    3939            // Perte mémoire faible ici (/ still reachable: 84 bytes in 2 blocks /) 
     
    9696 
    9797   // Initialisation de la classe de Logging 
    98    static ILogger LOGGER("xmlio.log"); 
     98   static ILogger LOGGER; 
    9999 
    100100   ///////////////////////////////////////////////////////////////////// 
     
    114114   ///////////////////////////////////////////////////////////////////// 
    115115 
    116 }; // namespace XMLIOSERVER 
     116} // namespace XMLIOSERVER 
    117117 
    118118#define   ERROR(MSG)   (XMLIOSERVER::ILogger::GetConsoleLogger().error(MSG)) 
  • XMLIO_V2/dev/dev_rv/src/XMLIO/object_template.hpp

    r112 r114  
    4545 
    4646         virtual bool hasChild(void) const { return (false); } 
    47          virtual void printChild(ostream& out) const { /* Ne rien faire de plus */ } 
     47         virtual void printChild(ostream& out) const { out << NIndent << "<!-- No child -->" << std::endl; } 
    4848 
    4949         virtual void resolveDescInheritance(const AttributRegistrar* _parent = 0) { addAttributes(*_parent); } 
     
    127127         } 
    128128 
    129          template <class V> static V* CreateInstanceAndParse( THashAttributes& attributes, XMLNode& _node, const char* defaultId, bool parseAttr = true ) 
     129         template <class V> static V* CreateInstanceAndParse(XMLNode& _node, const char* defaultId, bool parseAttr = true ) 
    130130         { 
    131131            V* instance_ptr = NULL; string did(defaultId); 
  • XMLIO_V2/dev/dev_rv/src/XMLIO/xml_node.hpp

    r113 r114  
    163163      };// class XMLNode 
    164164 
    165          }; // namespace XML 
     165   } // namespace XML 
    166166 
    167 };// namespace XMLIOSERVER 
     167}// namespace XMLIOSERVER 
    168168 
    169169 
  • XMLIO_V2/dev/dev_rv/src/XMLIO/xml_parser.hpp

    r112 r114  
    4343            } 
    4444      }; // class XMLParser 
    45    }; // namespace XML 
     45   } // namespace XML 
    4646 
    47 };// namespace XMLIOSERVER 
     47}// namespace XMLIOSERVER 
    4848 
    4949 
Note: See TracChangeset for help on using the changeset viewer.