1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

MSVC UTF-32 build fix.

This commit is contained in:
jules 2014-05-30 09:10:09 +01:00
parent 82f6189f91
commit 3c8fbc0bfe
4 changed files with 17 additions and 2 deletions

View file

@ -1035,7 +1035,7 @@ public:
Array<char*> argv;
for (int i = 0; i < arguments.size(); ++i)
if (arguments[i].isNotEmpty())
argv.add (arguments[i].toUTF8().getAddress());
argv.add (const_cast<char*> (arguments[i].toUTF8().getAddress()));
argv.add (nullptr);

View file

@ -121,6 +121,16 @@ String StringPool::getPooledString (String::CharPointerType start, String::CharP
return addPooledString (strings, StartEndString (start, end));
}
String StringPool::getPooledString (StringRef newString)
{
if (newString.isEmpty())
return String();
const ScopedLock sl (lock);
garbageCollectIfNeeded();
return addPooledString (strings, newString.text);
}
String StringPool::getPooledString (const String& newString)
{
if (newString.isEmpty())

View file

@ -62,6 +62,11 @@ public:
*/
String getPooledString (const char* original);
/** Returns a pointer to a shared copy of the string that is passed in.
The pool will always return the same String object when asked for a string that matches it.
*/
String getPooledString (StringRef original);
/** Returns a pointer to a copy of the string that is passed in.
The pool will always return the same String object when asked for a string that matches it.
*/

View file

@ -72,7 +72,7 @@ XmlElement::XmlElement (const char* tag)
}
XmlElement::XmlElement (StringRef tag)
: tagName (StringPool::getGlobalPool().getPooledString (tag.text.getAddress()))
: tagName (StringPool::getGlobalPool().getPooledString (tag))
{
sanityCheckTagName (tagName);
}