mirror of
https://github.com/jezhiggins/arabica
synced 2024-12-25 21:58:21 +01:00
more namespace and file moving shenanigans
This commit is contained in:
parent
0281c34a61
commit
17248585af
17 changed files with 60 additions and 59 deletions
|
@ -26,7 +26,7 @@
|
|||
|
||||
#include <iostream>
|
||||
#include <algorithm>
|
||||
#include <XML/UnicodeCharacters.hpp>
|
||||
#include <text/UnicodeCharacters.hpp>
|
||||
#include <XML/escaper.hpp>
|
||||
|
||||
namespace Arabica
|
||||
|
@ -87,7 +87,7 @@ void check_and_output_node_name(std::basic_ostream<charT, traitsT>& stream,
|
|||
current[namespaceURI] = prefix.second = node.getPrefix();
|
||||
|
||||
if(!prefix.second.empty())
|
||||
stream << prefix.second << Arabica::Unicode<charT>::COLON;
|
||||
stream << prefix.second << Arabica::text::Unicode<charT>::COLON;
|
||||
stream << node.getLocalName();
|
||||
}
|
||||
else
|
||||
|
@ -97,7 +97,7 @@ void check_and_output_node_name(std::basic_ostream<charT, traitsT>& stream,
|
|||
template<class stringT, class charT>
|
||||
bool isXmlns(const stringT& str)
|
||||
{
|
||||
typedef Arabica::Unicode<charT> UnicodeT;
|
||||
typedef Arabica::text::Unicode<charT> UnicodeT;
|
||||
|
||||
if(str.size() != 5)
|
||||
return false;
|
||||
|
@ -115,7 +115,7 @@ template<class stringT, class string_adaptorT, class charT, class traitsT>
|
|||
int prefix_mapper(std::basic_ostream<charT, traitsT>& stream,
|
||||
DOM::Node<stringT, string_adaptorT>& node)
|
||||
{
|
||||
typedef Arabica::Unicode<charT> UnicodeT;
|
||||
typedef Arabica::text::Unicode<charT> UnicodeT;
|
||||
|
||||
static const int index = std::ios_base::xalloc();
|
||||
std::vector<std::map<stringT, stringT> >* prefix_stack;
|
||||
|
@ -211,7 +211,7 @@ std::basic_ostream<charT, traitsT>&
|
|||
operator<<(std::basic_ostream<charT, traitsT>& stream,
|
||||
DOM::Node<stringT, string_adaptorT>& node)
|
||||
{
|
||||
typedef Arabica::Unicode<charT> UnicodeT;
|
||||
typedef Arabica::text::Unicode<charT> UnicodeT;
|
||||
|
||||
switch(node.getNodeType())
|
||||
{
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
#include <SAX/ArabicaConfig.hpp>
|
||||
#include <SAX/helpers/XMLFilterImpl.hpp>
|
||||
#include <XML/UnicodeCharacters.hpp>
|
||||
#include <text/UnicodeCharacters.hpp>
|
||||
#include <ostream>
|
||||
|
||||
namespace Arabica
|
||||
|
@ -22,7 +22,7 @@ class PYXWriter : public XMLFilterImpl<string_type, T0, T1>
|
|||
typedef typename string_type::value_type charT;
|
||||
typedef typename string_type::traits_type traitsT;
|
||||
typedef std::basic_ostream<charT, traitsT> ostreamT;
|
||||
typedef Arabica::Unicode<charT> UnicodeT;
|
||||
typedef Arabica::text::Unicode<charT> UnicodeT;
|
||||
private:
|
||||
using XMLFilterT::getParent;
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
#include <SAX/helpers/XMLFilterImpl.hpp>
|
||||
|
||||
#include <Utils/normalize_whitespace.hpp>
|
||||
#include <text/normalize_whitespace.hpp>
|
||||
|
||||
namespace Arabica
|
||||
{
|
||||
|
@ -30,7 +30,7 @@ class WhitespaceStripper : public SAX::XMLFilterImpl<string_type, T0, T1>
|
|||
|
||||
virtual void characters(const string_type& ch)
|
||||
{
|
||||
XMLFilterT::characters(Arabica::string::normalize_whitespace<string_type, string_adaptor>(ch));
|
||||
XMLFilterT::characters(Arabica::text::normalize_whitespace<string_type, string_adaptor>(ch));
|
||||
} // characters
|
||||
|
||||
virtual void ignorableWhitespace(const string_type& ch)
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
#include <SAX/helpers/XMLFilterImpl.hpp>
|
||||
#include <SAX/ext/LexicalHandler.hpp>
|
||||
#include <SAX/ext/DeclHandler.hpp>
|
||||
#include <XML/UnicodeCharacters.hpp>
|
||||
#include <text/UnicodeCharacters.hpp>
|
||||
#include <SAX/helpers/PropertyNames.hpp>
|
||||
#include <XML/escaper.hpp>
|
||||
#include <Utils/StringAdaptor.hpp>
|
||||
|
@ -34,7 +34,7 @@ class Writer : public XMLFilterImpl<string_type, T0, T1>
|
|||
typedef XMLReaderInterface<string_type, T0, T1> XMLReaderT;
|
||||
typedef XMLFilterImpl<string_type, T0, T1> XMLFilterT;
|
||||
typedef typename XMLFilterImpl<string_type, T0, T1>::AttributesT AttributesT;
|
||||
typedef Arabica::Unicode<charT> UnicodeT;
|
||||
typedef Arabica::text::Unicode<charT> UnicodeT;
|
||||
typedef Arabica::XML::text_escaper<charT, traitsT> text_escaperT;
|
||||
typedef Arabica::XML::attribute_escaper<charT, traitsT> attribute_escaperT;
|
||||
private:
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
#include <stack>
|
||||
#include <utility>
|
||||
#include <sstream>
|
||||
#include <XML/UnicodeCharacters.hpp>
|
||||
#include <text/UnicodeCharacters.hpp>
|
||||
#include <io/uri.hpp>
|
||||
|
||||
namespace Arabica
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#define ARABICA_UTILS_ESCAPER_HPP
|
||||
|
||||
#include <iostream>
|
||||
#include <XML/UnicodeCharacters.hpp>
|
||||
#include <text/UnicodeCharacters.hpp>
|
||||
|
||||
namespace Arabica {
|
||||
namespace XML {
|
||||
|
@ -14,7 +14,7 @@ class text_escaper
|
|||
typedef char_type charT;
|
||||
typedef traits_type traitsT;
|
||||
typedef std::basic_ostream<charT, traitsT> ostreamT;
|
||||
typedef Arabica::Unicode<charT> UnicodeT;
|
||||
typedef Arabica::text::Unicode<charT> UnicodeT;
|
||||
|
||||
public:
|
||||
text_escaper(ostreamT& stream) : stream_(stream) { }
|
||||
|
@ -60,7 +60,7 @@ class attribute_escaper : private text_escaper<char_type, traits_type>
|
|||
typedef char_type charT;
|
||||
typedef traits_type traitsT;
|
||||
typedef std::basic_ostream<charT, traitsT> ostreamT;
|
||||
typedef Arabica::Unicode<charT> UnicodeT;
|
||||
typedef Arabica::text::Unicode<charT> UnicodeT;
|
||||
|
||||
public:
|
||||
attribute_escaper(ostreamT& stream) : text_escaper<char_type, traits_type>(stream) { }
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
#include <boost/shared_ptr.hpp>
|
||||
#include <cmath>
|
||||
#include <XML/XMLCharacterClasses.hpp>
|
||||
#include <XML/UnicodeCharacters.hpp>
|
||||
#include <Utils/normalize_whitespace.hpp>
|
||||
#include <text/UnicodeCharacters.hpp>
|
||||
#include <text/normalize_whitespace.hpp>
|
||||
#include "xpath_value.hpp"
|
||||
#include "xpath_execution_context.hpp"
|
||||
|
||||
|
@ -408,7 +408,7 @@ public:
|
|||
const ExecutionContext<string_type, string_adaptor>& executionContext) const
|
||||
{
|
||||
string_type initial = ((baseT::argCount() > 0) ? baseT::argAsString(0, context, executionContext) : nodeStringValue<string_type, string_adaptor>(context));
|
||||
string_type value = Arabica::string::normalize_whitespace<string_type, string_adaptor>(initial);
|
||||
string_type value = Arabica::text::normalize_whitespace<string_type, string_adaptor>(initial);
|
||||
return new StringValue<string_type, string_adaptor>(value);
|
||||
} // evaluate
|
||||
}; // class NormalizeSpaceFn
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
#endif
|
||||
#include <cmath>
|
||||
#include <Utils/StringAdaptor.hpp>
|
||||
#include <Utils/normalize_whitespace.hpp>
|
||||
#include <text/normalize_whitespace.hpp>
|
||||
#include "xpath_axis_enumerator.hpp"
|
||||
|
||||
namespace Arabica
|
||||
|
@ -344,7 +344,7 @@ template<class string_type, class string_adaptor>
|
|||
double stringAsNumber(const string_type& str)
|
||||
{
|
||||
try {
|
||||
return boost::lexical_cast<double>(Arabica::string::normalize_whitespace<string_type, string_adaptor>(str));
|
||||
return boost::lexical_cast<double>(Arabica::text::normalize_whitespace<string_type, string_adaptor>(str));
|
||||
} // try
|
||||
catch(const boost::bad_lexical_cast&) {
|
||||
return NaN;
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
|
||||
namespace Arabica
|
||||
{
|
||||
namespace text
|
||||
{
|
||||
|
||||
template<typename charT>
|
||||
struct Unicode
|
||||
|
@ -283,6 +285,7 @@ const charT Unicode<charT>::LOWERCASE_Z = 0x7A;
|
|||
template<typename charT>
|
||||
const charT Unicode<charT>::VERTICAL_BAR = 0x7C; // |
|
||||
|
||||
} // namespace text
|
||||
} // namespace Arabica
|
||||
|
||||
#endif
|
|
@ -3,12 +3,11 @@
|
|||
|
||||
#include <Utils/StringAdaptor.hpp>
|
||||
#include <XML/XMLCharacterClasses.hpp>
|
||||
#include <XML/UnicodeCharacters.hpp>
|
||||
#include <text/UnicodeCharacters.hpp>
|
||||
|
||||
namespace Arabica
|
||||
{
|
||||
|
||||
namespace string
|
||||
namespace text
|
||||
{
|
||||
|
||||
template<class string_type, class string_adaptor>
|
||||
|
@ -37,7 +36,7 @@ std::string normalize_whitespace<std::string, Arabica::default_string_adaptor<st
|
|||
while((i != ie) && (Arabica::XML::is_space(static_cast<char>(*i))))
|
||||
++i;
|
||||
if(i != ie)
|
||||
*p++ = Arabica::Unicode<char>::SPACE;
|
||||
*p++ = Arabica::text::Unicode<char>::SPACE;
|
||||
} // while ...
|
||||
if(p != pe)
|
||||
value.erase(p, pe);
|
||||
|
@ -45,8 +44,7 @@ std::string normalize_whitespace<std::string, Arabica::default_string_adaptor<st
|
|||
return value;
|
||||
} // normalize_whitespace
|
||||
|
||||
} // namespace string
|
||||
|
||||
} // namespace text
|
||||
} // namespace Arabica
|
||||
#endif
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
|
||||
#include <XML/XMLCharacterClasses.hpp>
|
||||
#include <XML/UnicodeCharacters.hpp>
|
||||
#include <text/UnicodeCharacters.hpp>
|
||||
#include <SAX/ArabicaConfig.hpp>
|
||||
|
||||
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<wchar_t>::HORIZONTAL_TABULATION) ||
|
||||
(c == Unicode<wchar_t>::LINE_FEED) ||
|
||||
(c == Unicode<wchar_t>::CARRIAGE_RETURN) ||
|
||||
return (c == text::Unicode<wchar_t>::HORIZONTAL_TABULATION) ||
|
||||
(c == text::Unicode<wchar_t>::LINE_FEED) ||
|
||||
(c == text::Unicode<wchar_t>::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<wchar_t>::SPACE) ||
|
||||
(c == Unicode<wchar_t>::HORIZONTAL_TABULATION) ||
|
||||
(c == Unicode<wchar_t>::CARRIAGE_RETURN) ||
|
||||
(c == Unicode<wchar_t>::LINE_FEED);
|
||||
return (c == text::Unicode<wchar_t>::SPACE) ||
|
||||
(c == text::Unicode<wchar_t>::HORIZONTAL_TABULATION) ||
|
||||
(c == text::Unicode<wchar_t>::CARRIAGE_RETURN) ||
|
||||
(c == text::Unicode<wchar_t>::LINE_FEED);
|
||||
} // is_space
|
||||
|
||||
bool Arabica::XML::is_name_char(wchar_t c)
|
||||
{
|
||||
return is_letter(c) ||
|
||||
is_digit(c) ||
|
||||
(c == Unicode<wchar_t>::FULL_STOP) || // .
|
||||
(c == Unicode<wchar_t>::HYPHEN_MINUS) || // -
|
||||
(c == Unicode<wchar_t>::LOW_LINE) || // _
|
||||
(c == Unicode<wchar_t>::COLON) || // :
|
||||
(c == text::Unicode<wchar_t>::FULL_STOP) || // .
|
||||
(c == text::Unicode<wchar_t>::HYPHEN_MINUS) || // -
|
||||
(c == text::Unicode<wchar_t>::LOW_LINE) || // _
|
||||
(c == text::Unicode<wchar_t>::COLON) || // :
|
||||
is_combining_char(c) ||
|
||||
is_extender(c);
|
||||
} // is_identifier
|
||||
|
|
|
@ -3,9 +3,7 @@
|
|||
#include <convert/impl/ucs2_utf16.hpp>
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
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)
|
||||
{
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
#include "../CppUnit/framework/TestSuite.h"
|
||||
#include "../CppUnit/framework/TestCaller.h"
|
||||
|
||||
#include <Utils/normalize_whitespace.hpp>
|
||||
#include <text/normalize_whitespace.hpp>
|
||||
|
||||
template<class string_type, class string_adaptor>
|
||||
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<string_type, string_adaptor>(s);
|
||||
return Arabica::text::normalize_whitespace<string_type, string_adaptor>(s);
|
||||
} // normalize
|
||||
};
|
||||
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
#include <DOM/SAX2DOM/SAX2DOM.hpp>
|
||||
#include <DOM/Utils/Stream.hpp>
|
||||
#include <XSLT/XSLT.hpp>
|
||||
#include <Utils/normalize_whitespace.hpp>
|
||||
|
||||
#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<std::string, Arabica::default_string_adaptor<std::string> >(ss.str());
|
||||
return Arabica::text::normalize_whitespace<std::string, Arabica::default_string_adaptor<std::string> >(ss.str());
|
||||
} // docToString
|
||||
|
||||
void stripWhitespace(Arabica::DOM::Node<std::string> doc)
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
#include "silly_string.hpp"
|
||||
|
||||
#include <Utils/convertstream.hpp>
|
||||
#include <Utils/utf8ucs2codecvt.hpp>
|
||||
#include <Utils/ucs2utf8codecvt.hpp>
|
||||
#include <convert/utf8ucs2codecvt.hpp>
|
||||
#include <convert/ucs2utf8codecvt.hpp>
|
||||
|
||||
silly_string::silly_string()
|
||||
{
|
||||
|
|
|
@ -790,10 +790,6 @@
|
|||
RelativePath="..\include\Utils\getparam.hpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\include\Utils\normalize_whitespace.hpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\include\Utils\StringAdaptor.hpp"
|
||||
>
|
||||
|
@ -814,10 +810,6 @@
|
|||
RelativePath="..\include\Xml\escaper.hpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\include\Xml\UnicodeCharacters.hpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\include\Xml\XMLCharacterClasses.hpp"
|
||||
>
|
||||
|
@ -891,6 +883,18 @@
|
|||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="text"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\include\text\normalize_whitespace.hpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\include\text\UnicodeCharacters.hpp"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="src"
|
||||
|
|
Loading…
Reference in a new issue