diff options
Diffstat (limited to 'CIAO/tools/Config_Handlers/pcd.cpp')
-rw-r--r-- | CIAO/tools/Config_Handlers/pcd.cpp | 498 |
1 files changed, 207 insertions, 291 deletions
diff --git a/CIAO/tools/Config_Handlers/pcd.cpp b/CIAO/tools/Config_Handlers/pcd.cpp index 1021d178ad6..b74723f1265 100644 --- a/CIAO/tools/Config_Handlers/pcd.cpp +++ b/CIAO/tools/Config_Handlers/pcd.cpp @@ -9,6 +9,12 @@ * Will Otte <wotte@dre.vanderbilt.edu> */ +// Fix for Borland compilers, which seem to have a broken +// <string> include. +#ifdef __BORLANDC__ +# include <string.h> +#endif + #include "pcd.hpp" namespace CIAO @@ -16,21 +22,21 @@ namespace CIAO namespace Config_Handlers { // ComponentPackageImport - // + // ComponentPackageImport:: ComponentPackageImport () - : - ::XSCRT::Type (), - regulator__ () + : + ::XSCRT::Type (), + regulator__ () { } ComponentPackageImport:: ComponentPackageImport (::CIAO::Config_Handlers::ComponentPackageImport const& s) - : - ::XSCRT::Type (), - regulator__ () + : + ::XSCRT::Type (), + regulator__ () { { for (location_const_iterator i (s.location_.begin ());i != s.location_.end ();++i) add_location (*i); @@ -50,7 +56,7 @@ namespace CIAO // ComponentPackageImport - // + // ComponentPackageImport::location_iterator ComponentPackageImport:: begin_location () { @@ -89,29 +95,28 @@ namespace CIAO // PackageConfiguration - // + // PackageConfiguration:: PackageConfiguration () - : - ::XSCRT::Type (), - regulator__ () + : + ::XSCRT::Type (), + regulator__ () { } PackageConfiguration:: PackageConfiguration (::CIAO::Config_Handlers::PackageConfiguration const& s) - : - ::XSCRT::Type (), - label_ (s.label_.get () ? new ::XMLSchema::string< ACE_TCHAR > (*s.label_) : 0), - UUID_ (s.UUID_.get () ? new ::XMLSchema::string< ACE_TCHAR > (*s.UUID_) : 0), - basePackage_ (s.basePackage_.get () ? new ::CIAO::Config_Handlers::ComponentPackageDescription (*s.basePackage_) : 0), - specializedConfig_ (s.specializedConfig_.get () ? new ::CIAO::Config_Handlers::PackageConfiguration (*s.specializedConfig_) : 0), - importedPackage_ (s.importedPackage_.get () ? new ::CIAO::Config_Handlers::ComponentPackageImport (*s.importedPackage_) : 0), - referencedPackage_ (s.referencedPackage_.get () ? new ::CIAO::Config_Handlers::ComponentPackageReference (*s.referencedPackage_) : 0), - contentLocation_ (s.contentLocation_.get () ? new ::XMLSchema::string< ACE_TCHAR > (*s.contentLocation_) : 0), - href_ (s.href_.get () ? new ::XMLSchema::string< ACE_TCHAR > (*s.href_) : 0), - regulator__ () + : + ::XSCRT::Type (), + label_ (s.label_.get () ? new ::XMLSchema::string< ACE_TCHAR > (*s.label_) : 0), + UUID_ (s.UUID_.get () ? new ::XMLSchema::string< ACE_TCHAR > (*s.UUID_) : 0), + basePackage_ (s.basePackage_.get () ? new ::CIAO::Config_Handlers::ComponentPackageDescription (*s.basePackage_) : 0), + specializedConfig_ (s.specializedConfig_.get () ? new ::CIAO::Config_Handlers::PackageConfiguration (*s.specializedConfig_) : 0), + importedPackage_ (s.importedPackage_.get () ? new ::CIAO::Config_Handlers::ComponentPackageImport (*s.importedPackage_) : 0), + referencedPackage_ (s.referencedPackage_.get () ? new ::CIAO::Config_Handlers::ComponentPackageReference (*s.referencedPackage_) : 0), + contentLocation_ (s.contentLocation_.get () ? new ::XMLSchema::string< ACE_TCHAR > (*s.contentLocation_) : 0), + regulator__ () { if (label_.get ()) label_->container (this); if (UUID_.get ()) UUID_->container (this); @@ -128,7 +133,6 @@ namespace CIAO } if (contentLocation_.get ()) contentLocation_->container (this); - if (href_.get ()) href_->container (this); } ::CIAO::Config_Handlers::PackageConfiguration& PackageConfiguration:: @@ -165,15 +169,12 @@ namespace CIAO if (s.contentLocation_.get ()) contentLocation (*(s.contentLocation_)); else contentLocation_ = ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > (0); - if (s.href_.get ()) href (*(s.href_)); - else href_ = ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > (0); - return *this; } // PackageConfiguration - // + // bool PackageConfiguration:: label_p () const { @@ -190,19 +191,19 @@ namespace CIAO label (::XMLSchema::string< ACE_TCHAR > const& e) { if (label_.get ()) - { - *label_ = e; - } + { + *label_ = e; + } else - { - label_ = ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > (new ::XMLSchema::string< ACE_TCHAR > (e)); - label_->container (this); - } + { + label_ = ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > (new ::XMLSchema::string< ACE_TCHAR > (e)); + label_->container (this); + } } // PackageConfiguration - // + // bool PackageConfiguration:: UUID_p () const { @@ -219,19 +220,19 @@ namespace CIAO UUID (::XMLSchema::string< ACE_TCHAR > const& e) { if (UUID_.get ()) - { - *UUID_ = e; - } + { + *UUID_ = e; + } else - { - UUID_ = ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > (new ::XMLSchema::string< ACE_TCHAR > (e)); - UUID_->container (this); - } + { + UUID_ = ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > (new ::XMLSchema::string< ACE_TCHAR > (e)); + UUID_->container (this); + } } // PackageConfiguration - // + // bool PackageConfiguration:: basePackage_p () const { @@ -248,19 +249,19 @@ namespace CIAO basePackage (::CIAO::Config_Handlers::ComponentPackageDescription const& e) { if (basePackage_.get ()) - { - *basePackage_ = e; - } + { + *basePackage_ = e; + } else - { - basePackage_ = ::std::auto_ptr< ::CIAO::Config_Handlers::ComponentPackageDescription > (new ::CIAO::Config_Handlers::ComponentPackageDescription (e)); - basePackage_->container (this); - } + { + basePackage_ = ::std::auto_ptr< ::CIAO::Config_Handlers::ComponentPackageDescription > (new ::CIAO::Config_Handlers::ComponentPackageDescription (e)); + basePackage_->container (this); + } } // PackageConfiguration - // + // bool PackageConfiguration:: specializedConfig_p () const { @@ -277,19 +278,19 @@ namespace CIAO specializedConfig (::CIAO::Config_Handlers::PackageConfiguration const& e) { if (specializedConfig_.get ()) - { - *specializedConfig_ = e; - } + { + *specializedConfig_ = e; + } else - { - specializedConfig_ = ::std::auto_ptr< ::CIAO::Config_Handlers::PackageConfiguration > (new ::CIAO::Config_Handlers::PackageConfiguration (e)); - specializedConfig_->container (this); - } + { + specializedConfig_ = ::std::auto_ptr< ::CIAO::Config_Handlers::PackageConfiguration > (new ::CIAO::Config_Handlers::PackageConfiguration (e)); + specializedConfig_->container (this); + } } // PackageConfiguration - // + // bool PackageConfiguration:: importedPackage_p () const { @@ -306,19 +307,19 @@ namespace CIAO importedPackage (::CIAO::Config_Handlers::ComponentPackageImport const& e) { if (importedPackage_.get ()) - { - *importedPackage_ = e; - } + { + *importedPackage_ = e; + } else - { - importedPackage_ = ::std::auto_ptr< ::CIAO::Config_Handlers::ComponentPackageImport > (new ::CIAO::Config_Handlers::ComponentPackageImport (e)); - importedPackage_->container (this); - } + { + importedPackage_ = ::std::auto_ptr< ::CIAO::Config_Handlers::ComponentPackageImport > (new ::CIAO::Config_Handlers::ComponentPackageImport (e)); + importedPackage_->container (this); + } } // PackageConfiguration - // + // bool PackageConfiguration:: referencedPackage_p () const { @@ -335,19 +336,19 @@ namespace CIAO referencedPackage (::CIAO::Config_Handlers::ComponentPackageReference const& e) { if (referencedPackage_.get ()) - { - *referencedPackage_ = e; - } + { + *referencedPackage_ = e; + } else - { - referencedPackage_ = ::std::auto_ptr< ::CIAO::Config_Handlers::ComponentPackageReference > (new ::CIAO::Config_Handlers::ComponentPackageReference (e)); - referencedPackage_->container (this); - } + { + referencedPackage_ = ::std::auto_ptr< ::CIAO::Config_Handlers::ComponentPackageReference > (new ::CIAO::Config_Handlers::ComponentPackageReference (e)); + referencedPackage_->container (this); + } } // PackageConfiguration - // + // PackageConfiguration::selectRequirement_iterator PackageConfiguration:: begin_selectRequirement () { @@ -385,7 +386,7 @@ namespace CIAO } // PackageConfiguration - // + // PackageConfiguration::configProperty_iterator PackageConfiguration:: begin_configProperty () { @@ -423,7 +424,7 @@ namespace CIAO } // PackageConfiguration - // + // bool PackageConfiguration:: contentLocation_p () const { @@ -440,50 +441,15 @@ namespace CIAO contentLocation (::XMLSchema::string< ACE_TCHAR > const& e) { if (contentLocation_.get ()) - { - *contentLocation_ = e; - } - - else - { - contentLocation_ = ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > (new ::XMLSchema::string< ACE_TCHAR > (e)); - contentLocation_->container (this); - } - } - - // PackageConfiguration - // - bool PackageConfiguration:: - href_p () const - { - return href_.get () != 0; - } - - ::XMLSchema::string< ACE_TCHAR > const& PackageConfiguration:: - href () const - { - return *href_; - } - - ::XMLSchema::string< ACE_TCHAR >& PackageConfiguration:: - href () - { - return *href_; - } - - void PackageConfiguration:: - href (::XMLSchema::string< ACE_TCHAR > const& e) - { - if (href_.get ()) - { - *href_ = e; - } + { + *contentLocation_ = e; + } else - { - href_ = ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > (new ::XMLSchema::string< ACE_TCHAR > (e)); - href_->container (this); - } + { + contentLocation_ = ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > (new ::XMLSchema::string< ACE_TCHAR > (e)); + contentLocation_->container (this); + } } } } @@ -497,26 +463,26 @@ namespace CIAO ComponentPackageImport:: ComponentPackageImport (::XSCRT::XML::Element< ACE_TCHAR > const& e) - :Base__ (e), regulator__ () + :Base (e), regulator__ () { ::XSCRT::Parser< ACE_TCHAR > p (e); while (p.more_elements ()) + { + ::XSCRT::XML::Element< ACE_TCHAR > e (p.next_element ()); + ::std::basic_string< ACE_TCHAR > n (::XSCRT::XML::uq_name (e.name ())); + + if (n == "location") + { + ::XMLSchema::string< ACE_TCHAR > t (e); + add_location (t); + } + + else { - ::XSCRT::XML::Element< ACE_TCHAR > e (p.next_element ()); - ::std::basic_string< ACE_TCHAR > n (::XSCRT::XML::uq_name (e.name ())); - - if (n == "location") - { - ::XMLSchema::string< ACE_TCHAR > t (e); - add_location (t); - } - - else - { - } } + } } // PackageConfiguration @@ -524,89 +490,74 @@ namespace CIAO PackageConfiguration:: PackageConfiguration (::XSCRT::XML::Element< ACE_TCHAR > const& e) - :Base__ (e), regulator__ () + :Base (e), regulator__ () { ::XSCRT::Parser< ACE_TCHAR > p (e); while (p.more_elements ()) + { + ::XSCRT::XML::Element< ACE_TCHAR > e (p.next_element ()); + ::std::basic_string< ACE_TCHAR > n (::XSCRT::XML::uq_name (e.name ())); + + if (n == "label") + { + ::XMLSchema::string< ACE_TCHAR > t (e); + label (t); + } + + else if (n == "UUID") + { + ::XMLSchema::string< ACE_TCHAR > t (e); + UUID (t); + } + + else if (n == "basePackage") + { + ::CIAO::Config_Handlers::ComponentPackageDescription t (e); + basePackage (t); + } + + else if (n == "specializedConfig") + { + ::CIAO::Config_Handlers::PackageConfiguration t (e); + specializedConfig (t); + } + + else if (n == "importedPackage") + { + ::CIAO::Config_Handlers::ComponentPackageImport t (e); + importedPackage (t); + } + + else if (n == "referencedPackage") + { + ::CIAO::Config_Handlers::ComponentPackageReference t (e); + referencedPackage (t); + } + + else if (n == "selectRequirement") + { + ::CIAO::Config_Handlers::Requirement t (e); + add_selectRequirement (t); + } + + else if (n == "configProperty") + { + ::CIAO::Config_Handlers::Property t (e); + add_configProperty (t); + } + + else if (n == "contentLocation") { - ::XSCRT::XML::Element< ACE_TCHAR > e (p.next_element ()); - ::std::basic_string< ACE_TCHAR > n (::XSCRT::XML::uq_name (e.name ())); - - if (n == "label") - { - ::XMLSchema::string< ACE_TCHAR > t (e); - label (t); - } - - else if (n == "UUID") - { - ::XMLSchema::string< ACE_TCHAR > t (e); - UUID (t); - } - - else if (n == "basePackage") - { - ::CIAO::Config_Handlers::ComponentPackageDescription t (e); - basePackage (t); - } - - else if (n == "specializedConfig") - { - ::CIAO::Config_Handlers::PackageConfiguration t (e); - specializedConfig (t); - } - - else if (n == "importedPackage") - { - ::CIAO::Config_Handlers::ComponentPackageImport t (e); - importedPackage (t); - } - - else if (n == "referencedPackage") - { - ::CIAO::Config_Handlers::ComponentPackageReference t (e); - referencedPackage (t); - } - - else if (n == "selectRequirement") - { - ::CIAO::Config_Handlers::Requirement t (e); - add_selectRequirement (t); - } - - else if (n == "configProperty") - { - ::CIAO::Config_Handlers::Property t (e); - add_configProperty (t); - } - - else if (n == "contentLocation") - { - ::XMLSchema::string< ACE_TCHAR > t (e); - contentLocation (t); - } - - else - { - } + ::XMLSchema::string< ACE_TCHAR > t (e); + contentLocation (t); } - while (p.more_attributes ()) + else { - ::XSCRT::XML::Attribute< ACE_TCHAR > a (p.next_attribute ()); - ::std::basic_string< ACE_TCHAR > n (::XSCRT::XML::uq_name (a.name ())); - if (n == "href") - { - ::XMLSchema::string< ACE_TCHAR > t (a); - href (t); - } - - else - { - } } + } } } } @@ -703,16 +654,16 @@ namespace CIAO ComponentPackageImport::Type::location_iterator b (o.begin_location()), e (o.end_location()); if (b != e) + { + location_pre (o); + for (; b != e;) { - location_pre (o); - for (; b != e;) - { - dispatch (*b); - if (++b != e) location_next (o); - } - - location_post (o); + dispatch (*b); + if (++b != e) location_next (o); } + + location_post (o); + } } void ComponentPackageImport:: @@ -723,16 +674,16 @@ namespace CIAO ComponentPackageImport::Type::location_const_iterator b (o.begin_location()), e (o.end_location()); if (b != e) + { + location_pre (o); + for (; b != e;) { - location_pre (o); - for (; b != e;) - { - dispatch (*b); - if (++b != e) location_next (o); - } - - location_post (o); + dispatch (*b); + if (++b != e) location_next (o); } + + location_post (o); + } } void ComponentPackageImport:: @@ -799,8 +750,6 @@ namespace CIAO configProperty (o); if (o.contentLocation_p ()) contentLocation (o); else contentLocation_none (o); - if (o.href_p ()) href (o); - else href_none (o); post (o); } @@ -824,8 +773,6 @@ namespace CIAO configProperty (o); if (o.contentLocation_p ()) contentLocation (o); else contentLocation_none (o); - if (o.href_p ()) href (o); - else href_none (o); post (o); } @@ -979,17 +926,17 @@ namespace CIAO PackageConfiguration::Type::selectRequirement_iterator b (o.begin_selectRequirement()), e (o.end_selectRequirement()); if (b != e) + { + selectRequirement_pre (o); + for (; b != e;) { - selectRequirement_pre (o); - for (; b != e;) - { - dispatch (*b); - if (++b != e) selectRequirement_next (o); - } - - selectRequirement_post (o); + dispatch (*b); + if (++b != e) selectRequirement_next (o); } + selectRequirement_post (o); + } + else selectRequirement_none (o); } @@ -1001,17 +948,17 @@ namespace CIAO PackageConfiguration::Type::selectRequirement_const_iterator b (o.begin_selectRequirement()), e (o.end_selectRequirement()); if (b != e) + { + selectRequirement_pre (o); + for (; b != e;) { - selectRequirement_pre (o); - for (; b != e;) - { - dispatch (*b); - if (++b != e) selectRequirement_next (o); - } - - selectRequirement_post (o); + dispatch (*b); + if (++b != e) selectRequirement_next (o); } + selectRequirement_post (o); + } + else selectRequirement_none (o); } @@ -1063,17 +1010,17 @@ namespace CIAO PackageConfiguration::Type::configProperty_iterator b (o.begin_configProperty()), e (o.end_configProperty()); if (b != e) + { + configProperty_pre (o); + for (; b != e;) { - configProperty_pre (o); - for (; b != e;) - { - dispatch (*b); - if (++b != e) configProperty_next (o); - } - - configProperty_post (o); + dispatch (*b); + if (++b != e) configProperty_next (o); } + configProperty_post (o); + } + else configProperty_none (o); } @@ -1085,17 +1032,17 @@ namespace CIAO PackageConfiguration::Type::configProperty_const_iterator b (o.begin_configProperty()), e (o.end_configProperty()); if (b != e) + { + configProperty_pre (o); + for (; b != e;) { - configProperty_pre (o); - for (; b != e;) - { - dispatch (*b); - if (++b != e) configProperty_next (o); - } - - configProperty_post (o); + dispatch (*b); + if (++b != e) configProperty_next (o); } + configProperty_post (o); + } + else configProperty_none (o); } @@ -1162,28 +1109,6 @@ namespace CIAO } void PackageConfiguration:: - href (Type& o) - { - dispatch (o.href ()); - } - - void PackageConfiguration:: - href (Type const& o) - { - dispatch (o.href ()); - } - - void PackageConfiguration:: - href_none (Type&) - { - } - - void PackageConfiguration:: - href_none (Type const&) - { - } - - void PackageConfiguration:: post (Type&) { } @@ -1208,7 +1133,7 @@ namespace CIAO ComponentPackageImport:: ComponentPackageImport (::XSCRT::XML::Element< ACE_TCHAR >& e) - : ::XSCRT::Writer< ACE_TCHAR > (e) + : ::XSCRT::Writer< ACE_TCHAR > (e) { } @@ -1248,7 +1173,7 @@ namespace CIAO PackageConfiguration:: PackageConfiguration (::XSCRT::XML::Element< ACE_TCHAR >& e) - : ::XSCRT::Writer< ACE_TCHAR > (e) + : ::XSCRT::Writer< ACE_TCHAR > (e) { } @@ -1356,15 +1281,6 @@ namespace CIAO Traversal::PackageConfiguration::contentLocation (o); pop_ (); } - - void PackageConfiguration:: - href (Type const& o) - { - ::XSCRT::XML::Attribute< ACE_TCHAR > a ("href", "", top_ ()); - attr_ (&a); - Traversal::PackageConfiguration::href (o); - attr_ (0); - } } } } |