![]() |
PhoenixInkscape
2.0.0
Generate multiple png files with svg inkscape files
|
Extends the std::string. More...
#include <PString.h>
Public Member Functions | |
PString & | add (char ch) |
Add a char to an other. More... | |
PString & | add (const char *str) |
Add a char pointer to an other. More... | |
PString & | add (const PString &other) |
Add a PString to an other. More... | |
PString & | add (const std::string &other) |
Add a std::string to an other. More... | |
size_t | count (char ch) const |
Count the number of char ch in the current PString. More... | |
size_t | count (const PString &patern) const |
Count the number of patern in string. More... | |
PString | eraseChar (char ch) const |
Erase char ch of current string. More... | |
PString | eraseChar (const PString &vecChar) const |
Erase char ch of current string. More... | |
PString | eraseFirstChar (const PString &vecChar) const |
Erase first char in a string. More... | |
PString | eraseFirstLastChar (const PString &vecChar) const |
Erase first and last char in a string. More... | |
PString | eraseLastChar (const PString &vecChar) const |
Erase first and last char in a string. More... | |
PString | escapeStr (const PString &strCharToEscape, const PString &escapeSeq) const |
Escape given string with passed characters. More... | |
bool | find (char ch) const |
Find a char in a string. More... | |
bool | find (const PString &listChar) const |
Find multiple chars in a string. More... | |
PString | firstToLower () const |
Convert first letter of the PString in lower case. More... | |
PString | firstToUpper () const |
Convert first letter of the PString in upper case. More... | |
PString | format (const PString &arg) const |
Replace first {} with arg. More... | |
template<typename T > | |
PString & | fromValue (const T &other) |
Convert a value to a PString. More... | |
PString | getCommonBegining (const PString &other) const |
Get the common begining between the current PString and other. More... | |
bool | isLowerCase () const |
Say if the given PString is in lowercase. More... | |
bool | isNumber () const |
Say if the given PString is composed of numbers. More... | |
bool | isSameBegining (const PString &beginStr) const |
Say if the current PString has the same begining of beginStr. More... | |
bool | isUpperCase () const |
Say if the given PString is in uppercase. More... | |
PString & | merge (const std::vector< PString > &vecStr, const PString &separator="") |
Merge a set of PString. More... | |
PString & | operator+= (char ch) |
Add a char to an other. More... | |
PString & | operator+= (const PString &other) |
Add a PString to an other. More... | |
PString & | operator+= (const std::string &other) |
Add a std::string to an other. More... | |
template<typename T > | |
PString & | operator+= (const T &other) |
Append type in PString. More... | |
template<typename T > | |
PString & | operator<< (const T &other) |
Append type in PString. More... | |
PString & | operator= (const PString &other) |
Definition of equal operator of PString. More... | |
PString & | operator= (const std::string &other) |
Definition of equal operator of PString and std::string. More... | |
template<typename T > | |
PString & | operator= (const T &other) |
Set type in PString. More... | |
PString () | |
Default constructor of PString. More... | |
PString (const char *str) | |
Default constructor of PString. More... | |
PString (const PString &other) | |
Copy constructor of PString. More... | |
PString (const std::string &str) | |
Default constructor of PString. More... | |
PString | replace (const PString &pattern, const PString &replaceStr) const |
Replace a PString into an other PString. More... | |
PString | replace (const PString &pattern, const PString &replaceStr, size_t maxNbReplace) const |
Replace a PString into an other PString. More... | |
PString | replaceChar (const PString &vecChar, const PString &replaceStr) const |
Replace characters in vecChar by replaceStr. More... | |
std::vector< PString > | split (char separator) const |
Cut a PString on the given separator char. More... | |
std::vector< PString > | split (const PString &vecSeparator) const |
Split the PString on any given characters of vecSeparator. More... | |
PString | toLower () const |
Convert PString in lower case. More... | |
PString | toLowerUnderscore () const |
Convert std::string in lower case and space in '_'. More... | |
PString | toUpper () const |
Convert std::string in upper case. More... | |
template<typename T > | |
T | toValue () const |
Convert the current string into a value. More... | |
virtual | ~PString () |
Destructeur of PString. More... | |
Static Public Member Functions | |
template<typename T > | |
static PString | toString (const T &value) |
Convert a value to a PString. More... | |
template<typename T > | |
static T | toValue (const PString &other) |
Convert the given string into a value. More... | |
Protected Member Functions | |
void | concatenatePString (const PString &other) |
Concatenate a PString into the current PString. More... | |
void | concatenatePString (const std::string &other) |
Concatenate a std::string into the current PString. More... | |
void | copyPString (const PString &other) |
Copy function of PString. More... | |
void | copyPString (const std::string &other) |
Copy function of PString. More... | |
Private Member Functions | |
void | initialisationPString () |
Initialisation function of the class PString. More... | |
PString::PString | ( | ) |
Default constructor of PString.
Definition at line 70 of file PString.cpp.
References initialisationPString().
Referenced by PPath::getExtension(), PPath::getParentDirectory(), PPath::getProgramDirectory(), PPath::getProgramLocation(), and PPath::simplify().
PString::PString | ( | const char * | str | ) |
Default constructor of PString.
str | : pointer to initialise the PString |
Definition at line 79 of file PString.cpp.
References initialisationPString().
PString::PString | ( | const std::string & | str | ) |
Default constructor of PString.
str | : string to initialise the PString |
Definition at line 88 of file PString.cpp.
References initialisationPString().
PString::PString | ( | const PString & | other | ) |
Copy constructor of PString.
other | : class to copy |
Definition at line 97 of file PString.cpp.
References copyPString().
|
virtual |
PString & PString::add | ( | char | ch | ) |
Add a char to an other.
ch | : char to be added to the current one |
Definition at line 172 of file PString.cpp.
References concatenatePString().
PString & PString::add | ( | const char * | str | ) |
Add a char pointer to an other.
str | : char pointer to be added to the current one |
Definition at line 183 of file PString.cpp.
References concatenatePString(), and phoenix_charToString().
Add a PString to an other.
other | : PString to be added to the current one |
Definition at line 154 of file PString.cpp.
References concatenatePString().
Referenced by PPath::makeAbsolute(), and operator+=().
PString & PString::add | ( | const std::string & | other | ) |
Add a std::string to an other.
other | : std::string to be added to the current one |
Definition at line 163 of file PString.cpp.
References concatenatePString().
|
protected |
Concatenate a PString into the current PString.
other | : PString to be added |
Definition at line 722 of file PString.cpp.
Referenced by add(), operator+=(), and operator<<().
|
protected |
Concatenate a std::string into the current PString.
other | : std::string to be added |
Definition at line 732 of file PString.cpp.
|
protected |
Copy function of PString.
other | : class to copy |
Definition at line 706 of file PString.cpp.
Referenced by fromValue(), PPath::operator=(), operator=(), and PString().
|
protected |
Copy function of PString.
other | : class to copy |
Definition at line 714 of file PString.cpp.
size_t PString::count | ( | char | ch | ) | const |
Count the number of char ch in the current PString.
ch | : char to be counted |
Definition at line 323 of file PString.cpp.
Referenced by PPath::getLongestExtension().
size_t PString::count | ( | const PString & | patern | ) | const |
Count the number of patern in string.
patern | : patern to be serached |
Definition at line 338 of file PString.cpp.
PString PString::eraseChar | ( | char | ch | ) | const |
Erase char ch of current string.
ch | : char to be removed |
Definition at line 478 of file PString.cpp.
Referenced by eraseChar(), PPath::getCurrentNodeName(), and PFileParser::getStrComposedOf().
Erase char ch of current string.
vecChar | : chars to be removed |
Definition at line 490 of file PString.cpp.
References eraseChar().
Erase first char in a string.
vecChar | : chars to be searched and removed |
Definition at line 502 of file PString.cpp.
References find().
Referenced by checkEraseFirstChars(), and eraseFirstLastChar().
Erase first and last char in a string.
vecChar | : chars to be searched and removed |
Definition at line 545 of file PString.cpp.
References eraseFirstChar(), and eraseLastChar().
Referenced by checkEraseFirstLastChars(), and DicoValue::getString().
Erase first and last char in a string.
vecChar | : chars to be searched and removed |
Definition at line 521 of file PString.cpp.
References find().
Referenced by checkEraseLastChars(), and eraseFirstLastChar().
Escape given string with passed characters.
strCharToEscape | : list of the characters to be escaped |
escapeSeq | : escape sequence (could be one char) |
Definition at line 689 of file PString.cpp.
References find().
Referenced by phoenix_listArgToString().
bool PString::find | ( | char | ch | ) | const |
Find a char in a string.
ch | : char to be searched |
Definition at line 371 of file PString.cpp.
Referenced by eraseFirstChar(), eraseLastChar(), escapeStr(), find(), PPath::getExtension(), PFileParser::getNextToken(), PPath::getParentDirectory(), PFileParser::getStrComposedOf(), PFileParser::getUntilKeyWithoutPaternRecurse(), PFileParser::isChSeparator(), PFileParser::isChSpace(), PFileParser::isMatch(), PFileParser::isMatchToken(), PFileParser::isWhiteSpace(), replaceChar(), DicoValue::saveRecurse(), PFileParser::skipChars(), PFileParser::skipWhiteSpace(), and split().
bool PString::find | ( | const PString & | listChar | ) | const |
Find multiple chars in a string.
listChar | : chars to be searched |
Definition at line 384 of file PString.cpp.
References find().
PString PString::firstToLower | ( | ) | const |
Convert first letter of the PString in lower case.
Definition at line 659 of file PString.cpp.
References phoenix_isCharUpperCase().
PString PString::firstToUpper | ( | ) | const |
Convert first letter of the PString in upper case.
Definition at line 673 of file PString.cpp.
References phoenix_isCharLowerCase().
Replace first {} with arg.
arg | : PString to be replaced |
Definition at line 298 of file PString.cpp.
References replace().
Referenced by checkFormat().
PString & PString::fromValue | ( | const T & | other | ) |
Convert a value to a PString.
other | : value to be converted |
Definition at line 36 of file PString_impl.h.
References copyPString(), and valueToString().
Referenced by checkValueToStringConvertion(), and OptionValue::setDefaultValue().
Get the common begining between the current PString and other.
other | : string |
Definition at line 399 of file PString.cpp.
|
private |
Initialisation function of the class PString.
Definition at line 740 of file PString.cpp.
Referenced by PString().
bool PString::isLowerCase | ( | ) | const |
Say if the given PString is in lowercase.
Definition at line 568 of file PString.cpp.
References phoenix_isCharLowerCase().
bool PString::isNumber | ( | ) | const |
Say if the given PString is composed of numbers.
Definition at line 583 of file PString.cpp.
References phoenix_isCharNumber().
bool PString::isSameBegining | ( | const PString & | beginStr | ) | const |
Say if the current PString has the same begining of beginStr.
beginStr | : begining string to check |
Definition at line 306 of file PString.cpp.
Referenced by ArgParser::ArgParser(), completePathDir(), OptionParser::getLongOptionValue(), OptionMode::getPossibleMode(), Option::getPossibleOption(), OptionMode::getPossibleOption(), OptionParser::getPossibleOtherOption(), Option::parsePartOption(), path_completion_all(), and path_completion_dirOnly().
bool PString::isUpperCase | ( | ) | const |
Say if the given PString is in uppercase.
Definition at line 553 of file PString.cpp.
References phoenix_isCharUpperCase().
PString & PString::operator+= | ( | char | ch | ) |
Add a char to an other.
ch | : char to be added to the current one |
Definition at line 146 of file PString.cpp.
References add().
PString & PString::operator+= | ( | const std::string & | other | ) |
Add a std::string to an other.
other | : std::string to be added to the current one |
Definition at line 138 of file PString.cpp.
References add().
PString & PString::operator+= | ( | const T & | other | ) |
Append type in PString.
other | : type to be appended |
Definition at line 67 of file PString_impl.h.
References concatenatePString(), and valueToString().
PString & PString::operator<< | ( | const T & | other | ) |
Append type in PString.
other | : type to be appended |
Definition at line 78 of file PString_impl.h.
References concatenatePString(), and valueToString().
Definition of equal operator of PString.
other | : class to copy |
Definition at line 112 of file PString.cpp.
References copyPString().
PString & PString::operator= | ( | const std::string & | other | ) |
Definition of equal operator of PString and std::string.
other | : class to copy |
Definition at line 121 of file PString.cpp.
References copyPString().
PString & PString::operator= | ( | const T & | other | ) |
Set type in PString.
other | : type to be set in the PString |
Definition at line 56 of file PString_impl.h.
References copyPString(), and valueToString().
Replace a PString into an other PString.
pattern | : pattern to be replaced |
replaceStr | : string to replace |
Definition at line 204 of file PString.cpp.
Referenced by ArgParser::ArgParser(), checkPStringReplace(), format(), and saveDico().
PString PString::replace | ( | const PString & | pattern, |
const PString & | replaceStr, | ||
size_t | maxNbReplace | ||
) | const |
Replace a PString into an other PString.
pattern | : pattern to be replaced |
replaceStr | : string to replace |
maxNbReplace | : maximum number of replace to perform in the string |
Definition at line 243 of file PString.cpp.
Replace characters in vecChar by replaceStr.
vecChar | : set of characters to be replaced |
replaceStr | : replacement string |
Definition at line 282 of file PString.cpp.
References find().
std::vector< PString > PString::split | ( | char | separator | ) | const |
Cut a PString on the given separator char.
separator | : separtor char |
Definition at line 420 of file PString.cpp.
Referenced by checkResultSeparator(), PPath::createDirectory(), createVectorSlide(), PPath::getUnderPath(), and PPath::simplify().
PString PString::toLower | ( | ) | const |
Convert PString in lower case.
Definition at line 598 of file PString.cpp.
References phoenix_isCharUpperCase().
Referenced by phoenix_convertBoolType().
PString PString::toLowerUnderscore | ( | ) | const |
Convert std::string in lower case and space in '_'.
Definition at line 618 of file PString.cpp.
References phoenix_isCharUpperCase().
|
static |
Convert a value to a PString.
value | : value to be converted |
Definition at line 18 of file PString_impl.h.
References valueToString().
Referenced by testPString(), and testPStringConversion().
PString PString::toUpper | ( | ) | const |
Convert std::string in upper case.
Definition at line 639 of file PString.cpp.
References phoenix_isCharLowerCase().
T PString::toValue |
Convert the current string into a value.
Definition at line 46 of file PString_impl.h.
|
static |
Convert the given string into a value.
other | : PString to be converted |
Definition at line 27 of file PString_impl.h.
Referenced by checkValueToStringConvertion().