mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-14 00:14:18 +00:00
Changes for VC6 compatibility; added a couple of trimming methods to String; added a parameter to Socket::createConnection
This commit is contained in:
parent
d3ff5d9c4b
commit
93e4236b57
13 changed files with 142 additions and 29 deletions
|
|
@ -1748,6 +1748,39 @@ const String String::trimEnd() const throw()
|
|||
return String (text->text, (int) (++endT - text->text));
|
||||
}
|
||||
|
||||
const String String::trimCharactersAtStart (const tchar* charactersToTrim) const throw()
|
||||
{
|
||||
jassert (charactersToTrim != 0);
|
||||
|
||||
if (isEmpty())
|
||||
return empty;
|
||||
|
||||
const tchar* t = text->text;
|
||||
|
||||
while (CharacterFunctions::indexOfCharFast (charactersToTrim, *t) >= 0)
|
||||
++t;
|
||||
|
||||
if (t == text->text)
|
||||
return *this;
|
||||
else
|
||||
return String (t);
|
||||
}
|
||||
|
||||
const String String::trimCharactersAtEnd (const tchar* charactersToTrim) const throw()
|
||||
{
|
||||
jassert (charactersToTrim != 0);
|
||||
|
||||
if (isEmpty())
|
||||
return empty;
|
||||
|
||||
const tchar* endT = text->text + (CharacterFunctions::length (text->text) - 1);
|
||||
|
||||
while ((endT >= text->text) && CharacterFunctions::indexOfCharFast (charactersToTrim, *endT) >= 0)
|
||||
--endT;
|
||||
|
||||
return String (text->text, (int) (++endT - text->text));
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
const String String::retainCharacters (const tchar* const charactersToRetain) const throw()
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue