remove xcerces2

This commit is contained in:
berniev
2022-09-02 10:03:27 +10:00
committed by wwmayer
parent 282fa8bc3b
commit 5678fc1abe
7 changed files with 0 additions and 254 deletions

View File

@@ -50,41 +50,6 @@ StdInputStream::~StdInputStream() = default;
// ---------------------------------------------------------------------------
// StdInputStream: Implementation of the input stream interface
// ---------------------------------------------------------------------------
#if (XERCES_VERSION_MAJOR == 2)
unsigned int StdInputStream::curPos() const
{
return stream.tellg();
}
unsigned int StdInputStream::readBytes( XMLByte* const toFill, const unsigned int maxToRead )
{
//
// Read up to the maximum bytes requested. We return the number
// actually read.
//
stream.read((char *)toFill,maxToRead);
XMLSize_t len = stream.gcount();
QTextCodec *codec = QTextCodec::codecForName("UTF-8");
const QString text = codec->toUnicode((char *)toFill, len, &state);
if (state.invalidChars > 0) {
// In case invalid characters were found decode back to 'utf-8' and replace
// them with '?'
// First, Qt replaces invalid characters with '\0' (see ConvertInvalidToNull)
// but Xerces doesn't like this because it handles this as termination. Thus,
// we have to go through the array and replace '\0' with '?'.
XMLSize_t pos = 0;
QByteArray ba = codec->fromUnicode(text);
for (int i=0; i<ba.length(); i++, pos++) {
if (pos < len && ba[i] == '\0')
toFill[i] = '?';
}
}
return len;
}
#else
XMLFilePos StdInputStream::curPos() const
{
return static_cast<XMLFilePos>(stream.tellg());
@@ -118,7 +83,6 @@ XMLSize_t StdInputStream::readBytes(XMLByte* const toFill, const XMLSize_t maxT
return static_cast<XMLSize_t>(len);
}
#endif
// ---------------------------------------------------------------------------