mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
General beast update, fixes, optimizations, features:
* Clean ups, optimizations, and new File::commonDocumentsDirectory enum * Replace sortArray with std::sort for performance * More error tolerance in XML parser, speedups * Refactor some byte-order mark detection code * Add String::appendCharPointer overloads * More XML parser optimisations and better error detection * Misc performance tweaks * Fixes for support of non utf8 strings * Increased precision when storing strings in XmlElement * Minor clean-ups * Minor fix to XmlDocument * Cleanups to CriticalSection and related synchronization primitives * Fix DynamicArray unit test
This commit is contained in:
@@ -465,10 +465,7 @@ bool XmlElement::getBoolAttribute (const String& attributeName, const bool defau
|
||||
{
|
||||
if (att->hasName (attributeName))
|
||||
{
|
||||
beast_wchar firstChar = att->value[0];
|
||||
|
||||
if (CharacterFunctions::isWhitespace (firstChar))
|
||||
firstChar = att->value.trimStart() [0];
|
||||
const beast_wchar firstChar = *(att->value.getCharPointer().findEndOfWhitespace());
|
||||
|
||||
return firstChar == '1'
|
||||
|| firstChar == 't'
|
||||
@@ -526,7 +523,7 @@ void XmlElement::setAttribute (const String& attributeName, const int number)
|
||||
|
||||
void XmlElement::setAttribute (const String& attributeName, const double number)
|
||||
{
|
||||
setAttribute (attributeName, String (number));
|
||||
setAttribute (attributeName, String (number, 20));
|
||||
}
|
||||
|
||||
void XmlElement::removeAttribute (const String& attributeName) noexcept
|
||||
@@ -786,7 +783,7 @@ String XmlElement::getAllSubText() const
|
||||
for (const XmlElement* child = firstChildElement; child != nullptr; child = child->nextListItem)
|
||||
mem << child->getAllSubText();
|
||||
|
||||
return mem.toString();
|
||||
return mem.toUTF8();
|
||||
}
|
||||
|
||||
String XmlElement::getChildElementAllSubText (const String& childTagName,
|
||||
|
||||
Reference in New Issue
Block a user