Added missing changes on file
authorandre Ebersold <andre.ebersold@free.fr>
Thu, 9 Mar 2023 12:58:06 +0000 (13:58 +0100)
committerandre Ebersold <andre.ebersold@free.fr>
Thu, 9 Mar 2023 12:58:06 +0000 (13:58 +0100)
src/xml/reqif/reqif_elements_parser_root.cpp

index f320874f46993b83014ef8e97c08565f545cef67..1b2f8f0297d8bd4f5c368ad2b57a93ead65dcdf3 100644 (file)
@@ -6,14 +6,14 @@
 #include <location.h>
 #include <parser_base.h>
 #include <logger.h>
-#include <ant_elements.h>
-#include <ant_elements_parser.h>
-#include <ant_element_factory.h>
+#include "reqif/reqif_element.h"
+#include "reqif/reqif_elements_parser.h"
+#include "xml/element_factory.h"
 
-#include <project.h>
-#include <projectComponent.h>
+//#include <project.h>
+//#include <projectComponent.h>
 
-namespace antcc {
+namespace reqif {
     namespace parser {
 
 
@@ -22,7 +22,7 @@ namespace antcc {
  * Implement RootElement parsing function 
  */
 
-RootElement::RootElement(antcc::antElement *_elt ) 
+RootElement::RootElement(reqif::Element *_elt ) 
   : EmptyElement(_elt)
 {
     ANTCC_PARSER_DEBUG("Cplx(%0x)::Cplx ctor m_CurElt=%0x"
@@ -31,7 +31,7 @@ RootElement::RootElement(antcc::antElement *_elt )
 }
 
 RootElement::RootElement(const RootElement &c)
-       : antcc::parser::EmptyElement(c.m_CurrentElement)
+       : reqif::parser::EmptyElement(c.m_CurrentElement)
 {
     ANTCC_PARSER_DEBUG("Cplx(%0x)::Cplx copy c.m_CurElt=%0x"
                         ,this
@@ -61,7 +61,7 @@ void RootElement::_startElement(const std::string &ns,const std::string &name,co
 {
     State       &s(m_context.back());
     std::string space;
-    ANTCC_PARSER_DEBUG("%sCplxE(%0x)::_startElement Enter name=%s s.depth=%d context.size=%d"
+    ANTCC_PARSER_DEBUG("%sRootE(%0x)::_startElement Enter name=%s s.depth=%d context.size=%d"
             ,space.insert(0,s.m_depth,' ').c_str()
             ,this
             ,name.c_str()
@@ -72,31 +72,31 @@ void RootElement::_startElement(const std::string &ns,const std::string &name,co
         //Should check if it's any first 
         if (s.m_parser)
         {
-            ANTCC_PARSER_DEBUG("CplxE::_startElement call s.m_parser->_startElement : %s",name.c_str());
+            ANTCC_PARSER_DEBUG("RootE::_startElement call s.m_parser->_startElement : %s",name.c_str());
             s.m_parser->_startElement(ns,name,type);
         } else {
-            ANTCC_PARSER_ERROR("CplxE::_startElement no parser stacked (s.m_parser==NULL) : %s",name.c_str());
+            ANTCC_PARSER_ERROR("RootE::_startElement no parser stacked (s.m_parser==NULL) : %s",name.c_str());
         }
     } else {
-        ANTCC_PARSER_DEBUG("CplxE::_startElement %s call startElementImpl",name.c_str());
+        ANTCC_PARSER_DEBUG("RootE::_startElement %s call startElementImpl",name.c_str());
         if (!startElementImpl(ns,name,type)) 
         {
-            ANTCC_PARSER_ERROR("CplxE::_startElement %s call startElementImpl returned false",name.c_str());
+            ANTCC_PARSER_ERROR("RootE::_startElement %s call startElementImpl returned false",name.c_str());
 #ifdef PARSER_DEBUG
-            std::cout<<"\tcplx _start call Any : unknown "<<name<<std::endl;
+            std::cout<<"\tRootElement _start call Any : unknown "<<name<<std::endl;
 #endif
            // Unexpectect element 
            //this->startAnyElement(ns,name);
             /* Element not recogized by us*/
         } else 
         {
-            ANTCC_PARSER_DEBUG("CplxE::_startElement %s called startElementImpl returned true ",name.c_str());
+            ANTCC_PARSER_DEBUG("RootE::_startElement %s called startElementImpl returned true ",name.c_str());
             if (s.m_parser != 0)
             {
                 s.m_parser->preImpl();
                 /* Need to call pre */
 #ifdef PARSER_DEBUG
-            std::cout<<"\tcplx _start Need to call pre- : "<<name<<std::endl;
+            std::cout<<"\tRootElt _start Need to call pre- : "<<name<<std::endl;
 #endif
             }
         }
@@ -108,7 +108,7 @@ void RootElement::_endElement(const std::string &ns,const std::string &name)
 {
     State &s(m_context.back());
     std::string space;
-    ANTCC_PARSER_DEBUG("%sCplx(%0x)::_endElement Enter name=%s s.depth=%d context.size=%d"
+    ANTCC_PARSER_DEBUG("%sRootE(%0x)::_endElement Enter name=%s s.depth=%d context.size=%d"
             ,space.insert(0,s.m_depth,' ').c_str()
             ,this
             ,name.c_str()
@@ -120,7 +120,7 @@ void RootElement::_endElement(const std::string &ns,const std::string &name)
         if (--ss.m_depth > 0)
         {
             // Indirect 
-            ANTCC_PARSER_DEBUG("CplxE::_endElement 1 name=%s ss.m_depth=%d m_context.size=%d"
+            ANTCC_PARSER_DEBUG("RootE::_endElement 1 name=%s ss.m_depth=%d m_context.size=%d"
                             ,name.c_str()
                             ,ss.m_depth
                             ,m_context.size());
@@ -133,20 +133,20 @@ void RootElement::_endElement(const std::string &ns,const std::string &name)
         } else
         {
             // Direct recursion
-            ANTCC_PARSER_DEBUG( "CplxE::_endElement %s 2 WARNING I pass by here Direct recursion: "
+            ANTCC_PARSER_DEBUG( "RootE::_endElement %s 2 WARNING I pass by here Direct recursion: "
                     ,name.c_str());
             if (this == ss.m_parser.get())
             {
-                ANTCC_PARSER_DEBUG( "CplxE::_endElement %s good this==ss.m_parser",name.c_str());
+                ANTCC_PARSER_DEBUG( "RootE::_endElement %s good this==ss.m_parser",name.c_str());
                  
                 this->postImpl();
                 if (!endElementImpl(ns,name))
                 {
-                    ANTCC_PARSER_ERROR( "CplxE::_endElement %s endElementImpl call failed",name.c_str());
+                    ANTCC_PARSER_ERROR( "RootE::_endElement %s endElementImpl call failed",name.c_str());
                 } 
             } else 
             {
-                ANTCC_PARSER_ERROR( "CplxE::_endElement %s Must NOT HAPPEN!!!",name.c_str());
+                ANTCC_PARSER_ERROR( "RootE::_endElement %s Must NOT HAPPEN!!!",name.c_str());
             }
         }
     }
@@ -156,7 +156,7 @@ void RootElement::_endElement(const std::string &ns,const std::string &name)
         if (--s.m_depth > 0) 
         {
             space = "";
-            ANTCC_PARSER_DEBUG("%sCplx(%0x)::_endElement 3 name=%s s.depth=%d context.size=%d"
+            ANTCC_PARSER_DEBUG("%sRoot(%0x)::_endElement 3 name=%s s.depth=%d context.size=%d"
                     ,space.insert(0,s.m_depth,' ').c_str()
                     ,this
                     ,name.c_str()
@@ -169,13 +169,13 @@ void RootElement::_endElement(const std::string &ns,const std::string &name)
                 std::cout<<"No parser here\n";
         
         } else {
-            ANTCC_PARSER_DEBUG("CplxE(%0x)::_endElement %s 4 %s same parser "
+            ANTCC_PARSER_DEBUG("RootE(%0x)::_endElement %s 4 %s same parser "
                     , this
                     , name.c_str()
                     , (this==s.m_parser.get())?"yes":"no");
             if (s.m_parser )
             {
-                ANTCC_PARSER_DEBUG("CplxE(%0x)::_endElement call postImpl %s"
+                ANTCC_PARSER_DEBUG("RootE(%0x)::_endElement call postImpl %s"
                                     ,this
                                     ,name.c_str());
                 s.m_parser->postImpl();
@@ -183,14 +183,14 @@ void RootElement::_endElement(const std::string &ns,const std::string &name)
 
             if (!endElementImpl(ns,name))
             {
-                ANTCC_PARSER_ERROR("CplxE::_endElement failed call endElementImpl %s"
+                ANTCC_PARSER_ERROR("RootE::_endElement failed call endElementImpl %s"
                         ,name.c_str());
                 // Wrong
                 //this->endAnyElement(ns,name);
             }
         }
     }
-    ANTCC_PARSER_DEBUG("CplxE::_endElement LEAVE this=%0x name=%s,s.m_depth=%d m_context.size=%d"
+    ANTCC_PARSER_DEBUG("RootE::_endElement LEAVE this=%0x name=%s,s.m_depth=%d m_context.size=%d"
             , this
             ,name.c_str()
             ,s.m_depth
@@ -209,19 +209,19 @@ void RootElement::_endElement(const std::string &ns,const std::string &name)
         State &s(m_context.back());
         if (s.m_any)
         {
-            ANTCC_PARSER_DEBUG_CPLX_ATTR("Cplx::_Attributre any name=%s",name.c_str());
+            ANTCC_PARSER_DEBUG_CPLX_ATTR("RootElt::_Attributre any name=%s",name.c_str());
             anyAttribute(ns,name,val);
         } else if (s.m_parser) 
         {
-            ANTCC_PARSER_DEBUG_CPLX_ATTR("Cplx::_Attributre with parser name=%s",name.c_str());
+            ANTCC_PARSER_DEBUG_CPLX_ATTR("RootElt::_Attributre with parser name=%s",name.c_str());
             s.m_parser->_Attribute(ns,name,val);
         } 
     } else 
     {
-        ANTCC_PARSER_DEBUG_CPLX_ATTR("Cplx::_Attributre call this->AttributeImpl name=%s",name.c_str());
+        ANTCC_PARSER_DEBUG_CPLX_ATTR("RootElt::_Attributre call this->AttributeImpl name=%s",name.c_str());
         if ( ! this->AttributeImpl(ns,name,val) )
        {
-            ANTCC_PARSER_ERROR("Cplx::_AttributeImpl name=%s unsupported"
+            ANTCC_PARSER_ERROR("RootElt::_AttributeImpl name=%s unsupported"
                            ,name.c_str());
        }
     }
@@ -238,22 +238,22 @@ void RootElement::_Characters(const std::string &val)
     {
         if (s.m_parser) {
 #ifdef PARSER_DEBUG_CHARACTER
-            std::cout<<"CplxE::_characters"<<val<<" sz="<<m_context.size()<<"call parser@ "<<s.m_parser<<"\n";
+            std::cout<<"RootE::_characters"<<val<<" sz="<<m_context.size()<<"call parser@ "<<s.m_parser<<"\n";
 #endif
             if (s.m_parser.get() == this) 
             {
-              std::cerr<<"CplxE::_Characters ERROR: I have serious trouble treating -("<<val<<")"<<s.m_depth<<"\n";
+              std::cerr<<"RootE::_Characters ERROR: I have serious trouble treating -("<<val<<")"<<s.m_depth<<"\n";
               if (!_CharactersImpl(val))
               {
                 // Call any characters
 #ifdef PARSER_DEBUG_CHARATER
-          std::cout<<"CplxE::_Characters what to do? call any_characters :"<<val<<" depth="<<s.m_depth<<std::endl;
+          std::cout<<"RootE::_Characters what to do? call any_characters :"<<val<<" depth="<<s.m_depth<<std::endl;
 #endif
               }
             } else
               s.m_parser->_Characters(val);
         } else {
-            std::cout<<"CplxE::_characters... what to do with char ("<<val<<") "<<m_context.size()<<" parser@="<<s.m_parser<<"\n";
+            std::cout<<"RootE::_characters... what to do with char ("<<val<<") "<<m_context.size()<<" parser@="<<s.m_parser<<"\n";
         }
 
     } else {
@@ -261,7 +261,7 @@ void RootElement::_Characters(const std::string &val)
         {
           // Call any characters
 #ifdef PARSER_DEBUG_CHARATER
-    std::cout<<"CplxE::_Characters what to do? call any_characters :"<<val<<" depth="<<s.m_depth<<std::endl;
+    std::cout<<"RootE::_Characters what to do? call any_characters :"<<val<<" depth="<<s.m_depth<<std::endl;
 #endif
         }
     }