diff --git a/include/DOM/Utils/Stream.hpp b/include/DOM/Utils/Stream.hpp index 0ffce48d..dcc1871f 100644 --- a/include/DOM/Utils/Stream.hpp +++ b/include/DOM/Utils/Stream.hpp @@ -26,7 +26,7 @@ #include #include -#include +#include #include namespace Arabica @@ -87,7 +87,7 @@ void check_and_output_node_name(std::basic_ostream& stream, current[namespaceURI] = prefix.second = node.getPrefix(); if(!prefix.second.empty()) - stream << prefix.second << Arabica::Unicode::COLON; + stream << prefix.second << Arabica::text::Unicode::COLON; stream << node.getLocalName(); } else @@ -97,7 +97,7 @@ void check_and_output_node_name(std::basic_ostream& stream, template bool isXmlns(const stringT& str) { - typedef Arabica::Unicode UnicodeT; + typedef Arabica::text::Unicode UnicodeT; if(str.size() != 5) return false; @@ -115,7 +115,7 @@ template int prefix_mapper(std::basic_ostream& stream, DOM::Node& node) { - typedef Arabica::Unicode UnicodeT; + typedef Arabica::text::Unicode UnicodeT; static const int index = std::ios_base::xalloc(); std::vector >* prefix_stack; @@ -211,7 +211,7 @@ std::basic_ostream& operator<<(std::basic_ostream& stream, DOM::Node& node) { - typedef Arabica::Unicode UnicodeT; + typedef Arabica::text::Unicode UnicodeT; switch(node.getNodeType()) { diff --git a/include/SAX/filter/PYXWriter.hpp b/include/SAX/filter/PYXWriter.hpp index 63fa49da..96c7ec58 100644 --- a/include/SAX/filter/PYXWriter.hpp +++ b/include/SAX/filter/PYXWriter.hpp @@ -3,7 +3,7 @@ #include #include -#include +#include #include namespace Arabica @@ -22,7 +22,7 @@ class PYXWriter : public XMLFilterImpl typedef typename string_type::value_type charT; typedef typename string_type::traits_type traitsT; typedef std::basic_ostream ostreamT; - typedef Arabica::Unicode UnicodeT; + typedef Arabica::text::Unicode UnicodeT; private: using XMLFilterT::getParent; diff --git a/include/SAX/filter/WhitespaceStripperFilter.hpp b/include/SAX/filter/WhitespaceStripperFilter.hpp index 7b493dcc..7d834abe 100644 --- a/include/SAX/filter/WhitespaceStripperFilter.hpp +++ b/include/SAX/filter/WhitespaceStripperFilter.hpp @@ -3,7 +3,7 @@ #include -#include +#include namespace Arabica { @@ -30,7 +30,7 @@ class WhitespaceStripper : public SAX::XMLFilterImpl virtual void characters(const string_type& ch) { - XMLFilterT::characters(Arabica::string::normalize_whitespace(ch)); + XMLFilterT::characters(Arabica::text::normalize_whitespace(ch)); } // characters virtual void ignorableWhitespace(const string_type& ch) diff --git a/include/SAX/filter/Writer.hpp b/include/SAX/filter/Writer.hpp index bac9b6b1..6158d97a 100644 --- a/include/SAX/filter/Writer.hpp +++ b/include/SAX/filter/Writer.hpp @@ -5,7 +5,7 @@ #include #include #include -#include +#include #include #include #include @@ -34,7 +34,7 @@ class Writer : public XMLFilterImpl typedef XMLReaderInterface XMLReaderT; typedef XMLFilterImpl XMLFilterT; typedef typename XMLFilterImpl::AttributesT AttributesT; - typedef Arabica::Unicode UnicodeT; + typedef Arabica::text::Unicode UnicodeT; typedef Arabica::XML::text_escaper text_escaperT; typedef Arabica::XML::attribute_escaper attribute_escaperT; private: diff --git a/include/SAX/helpers/XMLBaseSupport.hpp b/include/SAX/helpers/XMLBaseSupport.hpp index fe183a03..f87fee7e 100644 --- a/include/SAX/helpers/XMLBaseSupport.hpp +++ b/include/SAX/helpers/XMLBaseSupport.hpp @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include namespace Arabica diff --git a/include/XML/escaper.hpp b/include/XML/escaper.hpp index 99fa7811..41646210 100644 --- a/include/XML/escaper.hpp +++ b/include/XML/escaper.hpp @@ -2,7 +2,7 @@ #define ARABICA_UTILS_ESCAPER_HPP #include -#include +#include namespace Arabica { namespace XML { @@ -14,7 +14,7 @@ class text_escaper typedef char_type charT; typedef traits_type traitsT; typedef std::basic_ostream ostreamT; - typedef Arabica::Unicode UnicodeT; + typedef Arabica::text::Unicode UnicodeT; public: text_escaper(ostreamT& stream) : stream_(stream) { } @@ -60,7 +60,7 @@ class attribute_escaper : private text_escaper typedef char_type charT; typedef traits_type traitsT; typedef std::basic_ostream ostreamT; - typedef Arabica::Unicode UnicodeT; + typedef Arabica::text::Unicode UnicodeT; public: attribute_escaper(ostreamT& stream) : text_escaper(stream) { } diff --git a/include/XPath/impl/xpath_function.hpp b/include/XPath/impl/xpath_function.hpp index 9f1379a5..e3874a38 100644 --- a/include/XPath/impl/xpath_function.hpp +++ b/include/XPath/impl/xpath_function.hpp @@ -4,8 +4,8 @@ #include #include #include -#include -#include +#include +#include #include "xpath_value.hpp" #include "xpath_execution_context.hpp" @@ -408,7 +408,7 @@ public: const ExecutionContext& executionContext) const { string_type initial = ((baseT::argCount() > 0) ? baseT::argAsString(0, context, executionContext) : nodeStringValue(context)); - string_type value = Arabica::string::normalize_whitespace(initial); + string_type value = Arabica::text::normalize_whitespace(initial); return new StringValue(value); } // evaluate }; // class NormalizeSpaceFn diff --git a/include/XPath/impl/xpath_object.hpp b/include/XPath/impl/xpath_object.hpp index 29b3888d..857d34af 100644 --- a/include/XPath/impl/xpath_object.hpp +++ b/include/XPath/impl/xpath_object.hpp @@ -13,7 +13,7 @@ #endif #include #include -#include +#include #include "xpath_axis_enumerator.hpp" namespace Arabica @@ -344,7 +344,7 @@ template double stringAsNumber(const string_type& str) { try { - return boost::lexical_cast(Arabica::string::normalize_whitespace(str)); + return boost::lexical_cast(Arabica::text::normalize_whitespace(str)); } // try catch(const boost::bad_lexical_cast&) { return NaN; diff --git a/include/XML/UnicodeCharacters.hpp b/include/text/UnicodeCharacters.hpp similarity index 99% rename from include/XML/UnicodeCharacters.hpp rename to include/text/UnicodeCharacters.hpp index a679041e..4a61a4b2 100644 --- a/include/XML/UnicodeCharacters.hpp +++ b/include/text/UnicodeCharacters.hpp @@ -3,6 +3,8 @@ namespace Arabica { +namespace text +{ template struct Unicode @@ -283,6 +285,7 @@ const charT Unicode::LOWERCASE_Z = 0x7A; template const charT Unicode::VERTICAL_BAR = 0x7C; // | +} // namespace text } // namespace Arabica #endif diff --git a/include/Utils/normalize_whitespace.hpp b/include/text/normalize_whitespace.hpp similarity index 91% rename from include/Utils/normalize_whitespace.hpp rename to include/text/normalize_whitespace.hpp index 842a79fe..2ec858b6 100644 --- a/include/Utils/normalize_whitespace.hpp +++ b/include/text/normalize_whitespace.hpp @@ -3,12 +3,11 @@ #include #include -#include +#include namespace Arabica { - -namespace string +namespace text { template @@ -37,7 +36,7 @@ std::string normalize_whitespace(*i)))) ++i; if(i != ie) - *p++ = Arabica::Unicode::SPACE; + *p++ = Arabica::text::Unicode::SPACE; } // while ... if(p != pe) value.erase(p, pe); @@ -45,8 +44,7 @@ std::string normalize_whitespace -#include +#include #include const wchar_t base_char_ranges[][2] = @@ -77,9 +77,9 @@ const wchar_t base_char_ranges[][2] = bool Arabica::XML::is_char(wchar_t c) { - return (c == Unicode::HORIZONTAL_TABULATION) || - (c == Unicode::LINE_FEED) || - (c == Unicode::CARRIAGE_RETURN) || + return (c == text::Unicode::HORIZONTAL_TABULATION) || + (c == text::Unicode::LINE_FEED) || + (c == text::Unicode::CARRIAGE_RETURN) || ((c >= 0x0020) && (c <= 0xD7FF)) || ((c >= 0xE000) && (c <= 0xFFFD)) #ifndef ARABICA_NO_WCHAR_T @@ -90,20 +90,20 @@ bool Arabica::XML::is_char(wchar_t c) bool Arabica::XML::is_space(wchar_t c) { - return (c == Unicode::SPACE) || - (c == Unicode::HORIZONTAL_TABULATION) || - (c == Unicode::CARRIAGE_RETURN) || - (c == Unicode::LINE_FEED); + return (c == text::Unicode::SPACE) || + (c == text::Unicode::HORIZONTAL_TABULATION) || + (c == text::Unicode::CARRIAGE_RETURN) || + (c == text::Unicode::LINE_FEED); } // is_space bool Arabica::XML::is_name_char(wchar_t c) { return is_letter(c) || is_digit(c) || - (c == Unicode::FULL_STOP) || // . - (c == Unicode::HYPHEN_MINUS) || // - - (c == Unicode::LOW_LINE) || // _ - (c == Unicode::COLON) || // : + (c == text::Unicode::FULL_STOP) || // . + (c == text::Unicode::HYPHEN_MINUS) || // - + (c == text::Unicode::LOW_LINE) || // _ + (c == text::Unicode::COLON) || // : is_combining_char(c) || is_extender(c); } // is_identifier diff --git a/src/convert/impl/ucs2_utf16.cpp b/src/convert/impl/ucs2_utf16.cpp index faea6028..ca1e0502 100644 --- a/src/convert/impl/ucs2_utf16.cpp +++ b/src/convert/impl/ucs2_utf16.cpp @@ -3,9 +3,7 @@ #include // -------------------------------------------------------------------------- -using namespace Arabica::convert::impl; - -std::codecvt_base::result utf16_2_ucs2(bool be, +std::codecvt_base::result Arabica::convert::impl::utf16_2_ucs2(bool be, char const* from, char const* from_end, char const*& from_next, wchar_t* to, wchar_t* to_limit, wchar_t*& to_next) { @@ -23,7 +21,7 @@ std::codecvt_base::result utf16_2_ucs2(bool be, return (from_next == from_end) ? std::codecvt_base::ok : std::codecvt_base::partial; } // utf16_2_ucs2 -std::codecvt_base::result ucs2_2_utf16(bool be, +std::codecvt_base::result Arabica::convert::impl::ucs2_2_utf16(bool be, wchar_t const* from, wchar_t const* from_end, wchar_t const*& from_next, char* to, char* to_limit, char*& to_next) { diff --git a/src/convert/impl/ucs2_utf8.cpp b/src/convert/impl/ucs2_utf8.cpp index 8368732e..929b52ac 100644 --- a/src/convert/impl/ucs2_utf8.cpp +++ b/src/convert/impl/ucs2_utf8.cpp @@ -27,9 +27,8 @@ namespace { }; } // namespace -using namespace Arabica::convert::impl; -std::codecvt_base::result ucs2_2_utf8( +std::codecvt_base::result Arabica::convert::impl::ucs2_2_utf8( const wchar_t* from, const wchar_t* from_end, const wchar_t*& from_next, char* to, char* to_limit, char*& to_next) { @@ -64,7 +63,7 @@ std::codecvt_base::result ucs2_2_utf8( return std::codecvt_base::ok; } // ucs2_2_utf8 -std::codecvt_base::result utf8_2_ucs2( +std::codecvt_base::result Arabica::convert::impl::utf8_2_ucs2( const char* from, const char* from_end, const char*& from_next, wchar_t* to, wchar_t* to_limit, wchar_t*& to_next) { diff --git a/tests/Utils/test_normalize_whitespace.hpp b/tests/Utils/test_normalize_whitespace.hpp index 6b1fd887..d5a7ded9 100644 --- a/tests/Utils/test_normalize_whitespace.hpp +++ b/tests/Utils/test_normalize_whitespace.hpp @@ -5,7 +5,7 @@ #include "../CppUnit/framework/TestSuite.h" #include "../CppUnit/framework/TestCaller.h" -#include +#include template class NormalizeWhitespaceTest : public TestCase @@ -70,7 +70,7 @@ class NormalizeWhitespaceTest : public TestCase private: string_type normalize(const string_type& s) { - return Arabica::string::normalize_whitespace(s); + return Arabica::text::normalize_whitespace(s); } // normalize }; diff --git a/tests/XSLT/xslt_test.hpp b/tests/XSLT/xslt_test.hpp index 32ab1c0d..c03c814a 100644 --- a/tests/XSLT/xslt_test.hpp +++ b/tests/XSLT/xslt_test.hpp @@ -5,7 +5,6 @@ #include #include #include -#include #ifdef ARABICA_WINDOWS const std::string PATH_PREFIX="../tests/XSLT/testsuite/TESTS/"; @@ -200,7 +199,7 @@ protected: { std::ostringstream ss; ss << node; - return Arabica::string::normalize_whitespace >(ss.str()); + return Arabica::text::normalize_whitespace >(ss.str()); } // docToString void stripWhitespace(Arabica::DOM::Node doc) diff --git a/tests/silly_string/silly_string.cpp b/tests/silly_string/silly_string.cpp index fcfc5eee..5655a90a 100644 --- a/tests/silly_string/silly_string.cpp +++ b/tests/silly_string/silly_string.cpp @@ -1,8 +1,8 @@ #include "silly_string.hpp" #include -#include -#include +#include +#include silly_string::silly_string() { diff --git a/vs8/lib_arabica.vcproj b/vs8/lib_arabica.vcproj index f5814ea8..cb4ed64f 100644 --- a/vs8/lib_arabica.vcproj +++ b/vs8/lib_arabica.vcproj @@ -790,10 +790,6 @@ RelativePath="..\include\Utils\getparam.hpp" > - - @@ -814,10 +810,6 @@ RelativePath="..\include\Xml\escaper.hpp" > - - @@ -891,6 +883,18 @@ > + + + + + +