#include "CeylanTypes.h"
#include "CeylanException.h"
#include <sstream>
#include <string>
#include <list>
#include <map>
Go to the source code of this file.
Classes | |
class | Ceylan::StringUtilsException |
Exception raised by string utils services. More... | |
Namespaces | |
namespace | Ceylan |
This part of the Ceylan namespace gathers some convenient string manipulation facilities to be widely used. | |
Defines | |
#define | CEYLAN_DEBUG_STRING_TO_OBJECT 1 |
Typedefs | |
typedef Ceylan::Uint8 | Ceylan::Latin1Char |
Describes a character encoded in Latin-1 (ISO 8859-1 character set). | |
typedef std::string::size_type | Ceylan::StringSize |
Datatype able to store all std::string sizes, could be as well Ceylan::Uint32 should size_type depend on the platform. | |
Functions | |
CEYLAN_DLL std::string | Ceylan::formatStringList (const std::list< std::string > &stringList, bool surroundByTicks=false) |
Formats the specified list of strings, according to the specified format. | |
CEYLAN_DLL std::string | Ceylan::formatStringMap (const std::map< std::string, std::string > &stringMap, bool surroundByTicks=false) |
Formats the specified map whose keys and values are strings, according to the specified format. | |
CEYLAN_DLL void | Ceylan::display (const std::string &message) |
Displays the specified message to the user, on his console, if any. | |
CEYLAN_DLL void | Ceylan::displayError (const std::string &errorMessage) |
Displays the specified error message to the user, on his console, if any. | |
CEYLAN_DLL StringSize | Ceylan::countChars (const std::string &aString, char targetChar) |
Counts how many characters targetChar can be found in aString. | |
CEYLAN_DLL std::string | Ceylan::reverse (const std::string &source) |
Returns the reversed source string, as read from right to left. | |
CEYLAN_DLL char * | Ceylan::getNonConstCharFrom (const std::string &source) |
CEYLAN_DLL StringSize | Ceylan::substituteInString (std::string &targetString, const std::string &toBeReplaced, const std::string &replacement) |
Substitutes, in string targetString, the string toBeReplaced with the string replacement. | |
CEYLAN_DLL std::string | Ceylan::substituteIn (const std::string &sourceString, const std::string &toBeReplaced, const std::string &replacement) |
Returns a new string, corresponding to the source string in which the substring toBeReplaced is replaced by the substring replacement. | |
CEYLAN_DLL bool | Ceylan::isLetter (char targetChar) |
Returns whether specified character is a letter, i.e. | |
CEYLAN_DLL bool | Ceylan::isFigure (char targetChar) |
Returns whether specified character is a figure, i.e. | |
CEYLAN_DLL bool | Ceylan::isAlphanumeric (char targetChar) |
Returns whether specified character is a letter or a figure, i.e. | |
CEYLAN_DLL bool | Ceylan::isPunctuation (char targetChar) |
Returns whether specified character is a punctuation character, i.e. | |
CEYLAN_DLL bool | Ceylan::isWhitespace (char targetChar) |
Returns whether specified character is a whitespace character, i.e. | |
CEYLAN_DLL std::string | Ceylan::toUppercase (const std::string &text) |
Returns specified text with all the letters translated to uppercase, other characters being left untouched. | |
CEYLAN_DLL std::string | Ceylan::encodeToHTML (const std::string &message) |
Encodes the specified string by converting it into a valid HTML text, replacing special characters such as '<', '>' or '&' by their corresponding HTML codes. | |
CEYLAN_DLL std::string | Ceylan::encodeToPhonetic (const std::string &message) |
Encodes the specified string in 'phonetic alphabet', also known as 'police letter alphabet' or 'analogy international code', which converts letters such as 'a', 'b', 'c' to respectively 'alpha', 'bravo', 'charlie' etc. | |
CEYLAN_DLL std::string | Ceylan::encodeToROT13 (const std::string &message) |
Encodes the specified string in 'rot13', a very simple substitution cipher. | |
CEYLAN_DLL std::string | Ceylan::demangleSymbol (const std::string &symbol) |
Demangles a C++ symbol so that it becomes human-readable. | |
CEYLAN_DLL std::list< std::string > | Ceylan::split (const std::string &stringToSplit, char splittingChar) |
CEYLAN_DLL std::string | Ceylan::join (const std::list< std::string > &toJoin, const std::string &joiningString) |
CEYLAN_DLL std::list< std::string > | Ceylan::splitIntoWords (const std::string &sentenceToSplit) |
Splits the specified sentence into a list of words. | |
CEYLAN_DLL std::list< std::string > | Ceylan::splitIntoParagraphs (const std::string &textToSplit) |
Splits the specified text into a list of paragraphs. | |
template<typename T > | |
std::string | Ceylan::toString (const std::list< T > &targetList) |
Returns a string describing the specified list. | |
template<typename T > | |
void | Ceylan::stringToObject (const std::string &source, T &object) |
String to object (deserialization). | |
Variables | |
CEYLAN_DLL const std::string | Ceylan::BatchTestOption = "--batch" |
This is the name of the option which is to be passed to tests run from the command line, so that they run in batch mode. |
#define CEYLAN_DEBUG_STRING_TO_OBJECT 1 |
Definition at line 42 of file CeylanStringUtils.h.