mirror of
https://github.com/jezhiggins/arabica
synced 2025-01-29 08:36:45 +01:00
*** empty log message ***
This commit is contained in:
parent
0de640587e
commit
193f570096
2 changed files with 41 additions and 10 deletions
10
SAX/SAX.dsp
10
SAX/SAX.dsp
|
@ -41,7 +41,8 @@ RSC=rc.exe
|
||||||
# PROP Intermediate_Dir "Release"
|
# PROP Intermediate_Dir "Release"
|
||||||
# PROP Target_Dir ""
|
# PROP Target_Dir ""
|
||||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
|
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
|
||||||
# ADD CPP /nologo /W3 /GR /GX /O2 /I "..\\" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
|
# ADD CPP /nologo /W3 /GR /GX /O2 /I "..\\" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /FD /c
|
||||||
|
# SUBTRACT CPP /YX
|
||||||
# ADD BASE RSC /l 0x809 /d "NDEBUG"
|
# ADD BASE RSC /l 0x809 /d "NDEBUG"
|
||||||
# ADD RSC /l 0x809 /d "NDEBUG"
|
# ADD RSC /l 0x809 /d "NDEBUG"
|
||||||
BSC32=bscmake.exe
|
BSC32=bscmake.exe
|
||||||
|
@ -64,7 +65,8 @@ LIB32=link.exe -lib
|
||||||
# PROP Intermediate_Dir "Debug"
|
# PROP Intermediate_Dir "Debug"
|
||||||
# PROP Target_Dir ""
|
# PROP Target_Dir ""
|
||||||
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
|
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
|
||||||
# ADD CPP /nologo /W3 /Gm /GR /GX /ZI /Od /I "..\\" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /FR /YX /FD /GZ /c
|
# ADD CPP /nologo /W3 /Gm /GR /GX /ZI /Od /I "..\\" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /FR /FD /GZ /c
|
||||||
|
# SUBTRACT CPP /YX
|
||||||
# ADD BASE RSC /l 0x809 /d "_DEBUG"
|
# ADD BASE RSC /l 0x809 /d "_DEBUG"
|
||||||
# ADD RSC /l 0x809 /d "_DEBUG"
|
# ADD RSC /l 0x809 /d "_DEBUG"
|
||||||
BSC32=bscmake.exe
|
BSC32=bscmake.exe
|
||||||
|
@ -464,8 +466,8 @@ SOURCE=.\ParserConfig.S
|
||||||
InputPath=.\ParserConfig.S
|
InputPath=.\ParserConfig.S
|
||||||
|
|
||||||
BuildCmds= \
|
BuildCmds= \
|
||||||
cl /TC /D USE_MSXML /EP ParserConfig.S > ParserConfig.h \
|
cl /TC /D USE_XERCES /EP ParserConfig.S > ParserConfig.h \
|
||||||
cl /TC /D USE_MSXML /EP saxlib.S > saxlib.cpp \
|
cl /TC /D USE_XERCES /EP saxlib.S > saxlib.cpp \
|
||||||
|
|
||||||
|
|
||||||
"ParserConfig.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
"ParserConfig.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||||
|
|
|
@ -202,9 +202,10 @@ class xerces_wrapper : public SAX::basic_ProgressiveParser<string_type>
|
||||||
|
|
||||||
typedef std::vector<wchar_t> wVector;
|
typedef std::vector<wchar_t> wVector;
|
||||||
|
|
||||||
|
#ifndef ARABICA_NO_WCHAR_T
|
||||||
string_type makeStringT(const XMLCh* str) const
|
string_type makeStringT(const XMLCh* str) const
|
||||||
{
|
{
|
||||||
if (str)
|
if(str)
|
||||||
{
|
{
|
||||||
wVector buffer;
|
wVector buffer;
|
||||||
std::insert_iterator<wVector> inserter(buffer, buffer.begin());
|
std::insert_iterator<wVector> inserter(buffer, buffer.begin());
|
||||||
|
@ -243,12 +244,40 @@ class xerces_wrapper : public SAX::basic_ProgressiveParser<string_type>
|
||||||
return base::makeStringT("");
|
return base::makeStringT("");
|
||||||
}
|
}
|
||||||
} // makeStringT
|
} // makeStringT
|
||||||
|
#else
|
||||||
|
// alternative version for the wchar_t impaired
|
||||||
|
string_type makeStringT(const XMLCh* str) const
|
||||||
|
{
|
||||||
|
if(str)
|
||||||
|
{
|
||||||
|
char* cstr = XERCES_CPP_NAMESPACE::XMLString::transcode(str);
|
||||||
|
string_type st(base::makeStringT(cstr));
|
||||||
|
XERCES_CPP_NAMESPACE::XMLString::release(&cstr);
|
||||||
|
return st;
|
||||||
|
}
|
||||||
|
return base::makeStringT("");
|
||||||
|
} // makeStringT
|
||||||
|
|
||||||
|
string_type makeStringT(const XMLCh* str, int length) const
|
||||||
|
{
|
||||||
|
// this isn't pretty, but Xerces doesn't provide a transcode with takes
|
||||||
|
// a length
|
||||||
|
if(str && length)
|
||||||
|
{
|
||||||
|
std::vector<XMLCh> wv(length + 1);
|
||||||
|
std::copy(str, str+length, std::insert_iterator<std::vector<XMLCh> >(wv, wv.begin()));
|
||||||
|
wv.push_back(0);
|
||||||
|
|
||||||
|
return makeStringT(&wv[0]);
|
||||||
|
}
|
||||||
|
return base::makeStringT("");
|
||||||
|
} // makeStringT
|
||||||
|
#endif
|
||||||
XMLCh* asXMLChString(const string_type& s) const
|
XMLCh* asXMLChString(const string_type& s) const
|
||||||
{
|
{
|
||||||
std::string str = base::asStdString(s);
|
std::string str = base::asStdString(s);
|
||||||
return XERCES_CPP_NAMESPACE::XMLString::transcode(str.c_str());
|
return XERCES_CPP_NAMESPACE::XMLString::transcode(str.c_str());
|
||||||
} // asXMLChString
|
} // asXMLChString
|
||||||
}; // class xerces_string_adaptor
|
}; // class xerces_string_adaptor
|
||||||
|
|
||||||
///////////////////////////////
|
///////////////////////////////
|
||||||
|
|
Loading…
Add table
Reference in a new issue