From 26899a31d9a85e6ec6cfb782b0977af05e3330c1 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 22 Jun 2012 11:51:14 +0200 Subject: Get rid of dependency on libcult --- xsd-frontend/transformations/anonymous.cxx | 4 ---- xsd-frontend/transformations/anonymous.hxx | 14 ++++++-------- xsd-frontend/transformations/enum-synthesis.cxx | 3 --- xsd-frontend/transformations/enum-synthesis.hxx | 4 +--- xsd-frontend/transformations/restriction.cxx | 6 +----- xsd-frontend/transformations/restriction.hxx | 4 +--- xsd-frontend/transformations/schema-per-type.cxx | 18 ++++++------------ xsd-frontend/transformations/schema-per-type.hxx | 12 +++++------- xsd-frontend/transformations/simplifier.cxx | 2 -- xsd-frontend/transformations/simplifier.hxx | 4 +--- 10 files changed, 21 insertions(+), 50 deletions(-) (limited to 'xsd-frontend/transformations') diff --git a/xsd-frontend/transformations/anonymous.cxx b/xsd-frontend/transformations/anonymous.cxx index afaf66a..3fa4f00 100644 --- a/xsd-frontend/transformations/anonymous.cxx +++ b/xsd-frontend/transformations/anonymous.cxx @@ -17,10 +17,6 @@ using std::endl; namespace XSDFrontend { - using namespace Cult; - - typedef WideString String; - namespace { using Transformations::AnonymousNameTranslator; diff --git a/xsd-frontend/transformations/anonymous.hxx b/xsd-frontend/transformations/anonymous.hxx index 992b7ff..4f1dcdd 100644 --- a/xsd-frontend/transformations/anonymous.hxx +++ b/xsd-frontend/transformations/anonymous.hxx @@ -6,7 +6,7 @@ #ifndef XSD_FRONTEND_TRANSFORMATIONS_ANONYMOUS_HXX #define XSD_FRONTEND_TRANSFORMATIONS_ANONYMOUS_HXX -#include +#include #include // Path #include @@ -15,8 +15,6 @@ namespace XSDFrontend { namespace Transformations { - using namespace Cult::Types; - class AnonymousNameTranslator { public: @@ -26,11 +24,11 @@ namespace XSDFrontend // The file argument is empty for the currect translation // unit. // - virtual WideString - translate (WideString const& file, - WideString const& ns, - WideString const& name, - WideString const& xpath) = 0; + virtual String + translate (String const& file, + String const& ns, + String const& name, + String const& xpath) = 0; }; // This transformation morphs anonymous types into named ones diff --git a/xsd-frontend/transformations/enum-synthesis.cxx b/xsd-frontend/transformations/enum-synthesis.cxx index c1ef5a7..169d27e 100644 --- a/xsd-frontend/transformations/enum-synthesis.cxx +++ b/xsd-frontend/transformations/enum-synthesis.cxx @@ -12,9 +12,6 @@ namespace XSDFrontend { - using namespace Cult; - typedef WideString String; - namespace { typedef std::set Enumerators; diff --git a/xsd-frontend/transformations/enum-synthesis.hxx b/xsd-frontend/transformations/enum-synthesis.hxx index 97658a3..edbee07 100644 --- a/xsd-frontend/transformations/enum-synthesis.hxx +++ b/xsd-frontend/transformations/enum-synthesis.hxx @@ -6,7 +6,7 @@ #ifndef XSD_FRONTEND_TRANSFORMATIONS_ENUM_SYNTHESIS_HXX #define XSD_FRONTEND_TRANSFORMATIONS_ENUM_SYNTHESIS_HXX -#include +#include #include // Path #include @@ -15,8 +15,6 @@ namespace XSDFrontend { namespace Transformations { - using namespace Cult::Types; - // This transformation replaces unions of one or more enumerations // with the same base with an equivalent synthesized enumeration. // This transformation assumes that there are no anonymous types. diff --git a/xsd-frontend/transformations/restriction.cxx b/xsd-frontend/transformations/restriction.cxx index dae1f03..0d63a9f 100644 --- a/xsd-frontend/transformations/restriction.cxx +++ b/xsd-frontend/transformations/restriction.cxx @@ -11,14 +11,10 @@ #include -using std::wcerr; -using std::endl; +using namespace std; namespace XSDFrontend { - using namespace Cult; - - typedef WideString String; typedef Transformations::Restriction::Failed Failed; typedef std::vector BaseList; diff --git a/xsd-frontend/transformations/restriction.hxx b/xsd-frontend/transformations/restriction.hxx index 8cf4cd8..2adeb03 100644 --- a/xsd-frontend/transformations/restriction.hxx +++ b/xsd-frontend/transformations/restriction.hxx @@ -6,7 +6,7 @@ #ifndef XSD_FRONTEND_TRANSFORMATIONS_RESTRICTION_HXX #define XSD_FRONTEND_TRANSFORMATIONS_RESTRICTION_HXX -#include +#include #include // Path #include @@ -15,8 +15,6 @@ namespace XSDFrontend { namespace Transformations { - using namespace Cult::Types; - // This transformation performs two major tasks. It transfers omitted // attribute declarations from the base to derived-by-restriction type // and establishes correspondence between particles and compositors by diff --git a/xsd-frontend/transformations/schema-per-type.cxx b/xsd-frontend/transformations/schema-per-type.cxx index 69b43ca..caae52d 100644 --- a/xsd-frontend/transformations/schema-per-type.cxx +++ b/xsd-frontend/transformations/schema-per-type.cxx @@ -22,15 +22,9 @@ using std::endl; namespace XSDFrontend { - using namespace Cult; - - typedef WideString String; typedef Transformations::SchemaPerType::Failed Failed; - typedef std::vector Schemas; - typedef - std::map - TypeSchemaMap; + typedef std::map TypeSchemaMap; // Compare file paths case-insensitively. // @@ -143,7 +137,7 @@ namespace XSDFrontend // if (!tn) { - for (NarrowString::Iterator i (base.begin ()), e (base.end ()); + for (NarrowString::iterator i (base.begin ()), e (base.end ()); i != e; ++i) { if (*i == '/' || *i == '\\') @@ -182,7 +176,7 @@ namespace XSDFrontend throw Failed (); } } - catch (String::NonRepresentable const&) + catch (NonRepresentable const&) { wcerr << "error: '" << wbase << "' cannot be represented as a " << "narrow string" << endl; @@ -251,7 +245,7 @@ namespace XSDFrontend { Type (SemanticGraph::Schema& schema, SemanticGraph::Schema& root, - Char const* by_value_key, + char const* by_value_key, TypeSchemaMap& tsm) : schema_ (schema), root_ (root), @@ -333,7 +327,7 @@ namespace XSDFrontend private: SemanticGraph::Schema& schema_; SemanticGraph::Schema& root_; - Char const* by_value_key_; + char const* by_value_key_; TypeSchemaMap& tsm_; std::set type_set_; @@ -346,7 +340,7 @@ namespace XSDFrontend SchemaPerType:: SchemaPerType (SchemaPerTypeTranslator& trans, bool fat, - Char const* key) + char const* key) : fat_type_file_ (fat), by_value_key_ (key), trans_ (trans) { } diff --git a/xsd-frontend/transformations/schema-per-type.hxx b/xsd-frontend/transformations/schema-per-type.hxx index 6e034d6..9498d42 100644 --- a/xsd-frontend/transformations/schema-per-type.hxx +++ b/xsd-frontend/transformations/schema-per-type.hxx @@ -8,7 +8,7 @@ #include -#include +#include #include // Path #include @@ -17,8 +17,6 @@ namespace XSDFrontend { namespace Transformations { - using namespace Cult::Types; - class SchemaPerTypeTranslator { public: @@ -28,8 +26,8 @@ namespace XSDFrontend // The following two functions should return empty string if // there is no match. // - virtual WideString - translate_type (WideString const& ns, WideString const& name) = 0; + virtual String + translate_type (String const& ns, String const& name) = 0; virtual NarrowString translate_schema (NarrowString const& abs_path) = 0; @@ -49,14 +47,14 @@ namespace XSDFrontend // SchemaPerType (SchemaPerTypeTranslator&, bool fat_type_file, - Char const* by_value_key = 0); + char const* by_value_key = 0); std::vector transform (SemanticGraph::Schema&); private: bool fat_type_file_; - Char const* by_value_key_; + char const* by_value_key_; SchemaPerTypeTranslator& trans_; }; } diff --git a/xsd-frontend/transformations/simplifier.cxx b/xsd-frontend/transformations/simplifier.cxx index ba6b04f..16f07a1 100644 --- a/xsd-frontend/transformations/simplifier.cxx +++ b/xsd-frontend/transformations/simplifier.cxx @@ -10,8 +10,6 @@ namespace XSDFrontend { - using namespace Cult; - namespace { struct Compositor: Traversal::All, diff --git a/xsd-frontend/transformations/simplifier.hxx b/xsd-frontend/transformations/simplifier.hxx index 44a3429..d516943 100644 --- a/xsd-frontend/transformations/simplifier.hxx +++ b/xsd-frontend/transformations/simplifier.hxx @@ -6,7 +6,7 @@ #ifndef XSD_FRONTEND_TRANSFORMATIONS_SIMPLIFIER_HXX #define XSD_FRONTEND_TRANSFORMATIONS_SIMPLIFIER_HXX -#include +#include #include // Path #include @@ -15,8 +15,6 @@ namespace XSDFrontend { namespace Transformations { - using namespace Cult::Types; - // This transformation performs various schema simplifications // (e.g., removing empty compositors, etc). This transformation // assumes that there are no anonymous types. -- cgit v1.1