From 54110801525371740298d5cae378bfc778749935 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 22 Jun 2012 11:50:03 +0200 Subject: Get rid of dependency on libcult --- xsd/cxx/tree/generator.cxx | 53 +++++++++++++++++++--------------------------- 1 file changed, 22 insertions(+), 31 deletions(-) (limited to 'xsd/cxx/tree/generator.cxx') diff --git a/xsd/cxx/tree/generator.cxx b/xsd/cxx/tree/generator.cxx index 4eb4de2..ff2b705 100644 --- a/xsd/cxx/tree/generator.cxx +++ b/xsd/cxx/tree/generator.cxx @@ -3,6 +3,7 @@ // copyright : Copyright (c) 2005-2011 Code Synthesis Tools CC // license : GNU GPL v2 + exceptions; see accompanying LICENSE file +#include #include #include @@ -10,9 +11,6 @@ #include #include -#include -#include - #include #include #include @@ -50,10 +48,7 @@ #include "../../../libxsd/xsd/cxx/version.hxx" -using std::endl; -using std::wcerr; -using std::wcout; - +using namespace std; using namespace cutl; using namespace XSDFrontend::SemanticGraph; @@ -71,7 +66,7 @@ namespace CXX { namespace { - Char const copyright_gpl[] = + char const copyright_gpl[] = "// Copyright (c) 2005-2011 Code Synthesis Tools CC\n" "//\n" "// This program was generated by CodeSynthesis XSD, an XML Schema to\n" @@ -105,7 +100,7 @@ namespace CXX "// in the accompanying FLOSSE file.\n" "//\n\n"; - Char const copyright_proprietary[] = + char const copyright_proprietary[] = "// Copyright (c) 2005-2011 Code Synthesis Tools CC\n" "//\n" "// This program was generated by CodeSynthesis XSD, an XML Schema\n" @@ -116,7 +111,7 @@ namespace CXX "//\n\n"; } - Void Tree::Generator:: + void Tree::Generator:: usage () { CXX::Tree::options::print_usage (wcout); @@ -125,7 +120,7 @@ namespace CXX namespace { - Void + void open (WideInputFileStream& ifs, NarrowString const& path) { try @@ -150,7 +145,7 @@ namespace CXX } } - Void + void append (WideOutputFileStream& os, NarrowString const& path, WideInputFileStream& default_is) @@ -170,7 +165,7 @@ namespace CXX } } - Void + void append (WideOutputFileStream& os, NarrowStrings const& primary, NarrowStrings const& def) @@ -186,24 +181,20 @@ namespace CXX } - UnsignedLong Tree::Generator:: + size_t Tree::Generator:: generate (Tree::options const& ops, Schema& schema, Path const& file_path, - Boolean fpt, + bool fpt, StringLiteralMap const& string_literal_map, const WarningSet& disabled_warnings, FileList& file_list, AutoUnlinks& unlinks) { - using std::ios_base; - typedef cutl::re::regexsub Regex; - using Cult::Containers::Vector; - - typedef Vector Paths; - typedef Vector > WideOutputFileStreams; + typedef vector Paths; + typedef vector > WideOutputFileStreams; try { @@ -280,7 +271,7 @@ namespace CXX // // - Boolean generate_xml_schema (ops.generate_xml_schema ()); + bool generate_xml_schema (ops.generate_xml_schema ()); // We could be compiling several schemas at once in which case // handling of the --generate-xml-schema option gets tricky: we @@ -296,9 +287,9 @@ namespace CXX } } - Boolean inline_ (ops.generate_inline () && !generate_xml_schema); - Boolean forward (ops.generate_forward () && !generate_xml_schema); - Boolean source (!generate_xml_schema); + bool inline_ (ops.generate_inline () && !generate_xml_schema); + bool forward (ops.generate_forward () && !generate_xml_schema); + bool source (!generate_xml_schema); // Generate code. // @@ -370,7 +361,7 @@ namespace CXX { if (parts > 1) { - for (UnsignedLong i (0); i < parts; ++i) + for (size_t i (0); i < parts; ++i) { std::ostringstream os; os << i; @@ -430,7 +421,7 @@ namespace CXX ixx_path = out_dir / ixx_path; fwd_path = out_dir / fwd_path; - for (Paths::Iterator i (cxx_paths.begin ()); + for (Paths::iterator i (cxx_paths.begin ()); i != cxx_paths.end (); ++i) *i = out_dir / *i; } @@ -493,7 +484,7 @@ namespace CXX // if (source) { - for (Paths::Iterator i (cxx_paths.begin ()); + for (Paths::iterator i (cxx_paths.begin ()); i != cxx_paths.end (); ++i) { shared_ptr s ( @@ -514,7 +505,7 @@ namespace CXX // Print copyright and license. // - Char const* copyright ( + char const* copyright ( ops.proprietary_license () ? copyright_proprietary : copyright_gpl); if (forward) @@ -539,7 +530,7 @@ namespace CXX if (source) { - for (WideOutputFileStreams::Iterator i (cxx.begin ()); + for (WideOutputFileStreams::iterator i (cxx.begin ()); i != cxx.end (); ++i) **i << copyright; } @@ -568,7 +559,7 @@ namespace CXX // SLOC counter. // size_t sloc_total (0); - Boolean show_sloc (ops.show_sloc ()); + bool show_sloc (ops.show_sloc ()); typedef compiler::ostream_filter -- cgit v1.1