MeVisLab Toolbox Reference
mlReleaseToolsString.h File Reference

Tool class for some string operations. More...

#include "MLReleaseToolsSystem.h"
#include <mlTypeDefs.h>
#include <FMEThirdPartyWarningsDisable.h>
#include <string>
#include <vector>
#include <FMEThirdPartyWarningsRestore.h>

Go to the source code of this file.

Namespaces

namespace  ml
 Main documentation file for ML users and developers.
 
namespace  ml::ReleaseToolsString
 Collection of some string tools.
 

Typedefs

typedef std::vector< std::string > ml::ReleaseToolsString::StringVector
 Define often used string vector type.
 
typedef std::vector< StringVectorml::ReleaseToolsString::StringVectorVector
 Define often used vector of string vector type.
 

Functions

MLRELEASE_TOOLS_EXPORT std::string ml::ReleaseToolsString::replaceAllChars (const std::string &str, char ch1, char ch2)
 Replaces all ch1 characters in str with ch2.
 
MLRELEASE_TOOLS_EXPORT std::string ml::ReleaseToolsString::escapeString (const std::string &str)
 Replaces all spaces with '?'s.
 
MLRELEASE_TOOLS_EXPORT std::string ml::ReleaseToolsString::unescapeString (const std::string &str)
 Replaces all '?'s with spaces.
 
MLRELEASE_TOOLS_EXPORT void ml::ReleaseToolsString::replaceAllStr1ByStr2InStr (std::string &inStr, const std::string &str1, const std::string &str2)
 Replaces all occurrences of str1 in inStr by str2.
 
MLRELEASE_TOOLS_EXPORT std::string ml::ReleaseToolsString::replaceAllStr1ByStr2 (const std::string &inStr, const std::string &str1, const std::string &str2)
 Same as replaceAllStr1ByStr2InStr with the difference that the changed string is returned and inStr remains unchanged.
 
MLRELEASE_TOOLS_EXPORT std::string ml::ReleaseToolsString::replaceNewLinesByBrs (const std::string &inStr)
 Replaces all '
's with "<br>"s.
 
MLRELEASE_TOOLS_EXPORT std::string ml::ReleaseToolsString::replaceBrsByNewLines (const std::string &inStr)
 Replaces all "<br>"s with '
's.
 
MLRELEASE_TOOLS_EXPORT bool ml::ReleaseToolsString::endsWith (const std::string &str, const std::string &endStr)
 Returns true if str ends with endStr, otherwise false.
 
MLRELEASE_TOOLS_EXPORT std::string ml::ReleaseToolsString::terminateWithSingleEndString (const std::string &inStr, const std::string &endStr)
 Returns inStr+endStr if endStr is still not at the end of inStr, otherwise it returns inStr.
 
MLRELEASE_TOOLS_EXPORT std::string ml::ReleaseToolsString::terminateWithSingleEndString (const std::string &inStr, const std::string &endStr, const std::string &endStr2)
 Returns inStr + endStr if inStr does not end neither with endStr nor with endStr2, otherwise it returns inStr.
 
MLRELEASE_TOOLS_EXPORT std::string ml::ReleaseToolsString::makeSingleNewlineTerminated (const std::string &inStr)
 Returns inStr + "\n" if inStr does not end neither with "\n" nor with "<br>", otherwise it returns inStr.
 
MLRELEASE_TOOLS_EXPORT std::string ml::ReleaseToolsString::convertLineEndingsToNewLinesOnly (const std::string &inStr)
 Returns a converted inStr where 1) all appearances of "\r\n" and then 2) all appearances of "\r" are replaced with "\n" such that the string is line-ending platform independent and only uses
's.
 
MLRELEASE_TOOLS_EXPORT StringVector ml::ReleaseToolsString::split (const std::string &value, const std::string &sep)
 Subdivides value at all positions of sep and returns all values in the vector.
 
MLRELEASE_TOOLS_EXPORT StringVector ml::ReleaseToolsString::splitAtLineBreaks (const std::string &value)
 Subdivides value at all positions which seem to be a line ending, technically it returns split(convertLineEndingsToNewLinesOnly(value), "\n").
 
MLRELEASE_TOOLS_EXPORT void ml::ReleaseToolsString::removeElements (StringVector &strVec, const std::string &str=std::string())
 Removes all entries from strVec which equal to str; default is an empty string to remove all empty entries.
 
MLRELEASE_TOOLS_EXPORT std::vector< size_tml::ReleaseToolsString::createIndexList (size_t numIndexes, std::string idxExp, std::string &resultInfo)
 Creates a list of indexes by parsing the string expression idxExp.
 
MLRELEASE_TOOLS_EXPORT void ml::ReleaseToolsString::removeDuplicates (std::string &strToShrink, char ch=' ')
 Multiple occurrences of ch in strToShrink are reduced to single ones in O(n).
 
MLRELEASE_TOOLS_EXPORT std::string ml::ReleaseToolsString::replaceValuePlaceholders (const std::string &taggedStr, const PagedImage *inImg=nullptr, const std::vector< std::string > &inputValues=std::vector< std::string >(), const std::string &defaultTagContent="", const std::string &fileType="", size_t idx=0, size_t padSize=5)
 Replaces a number of tags of one of the following formats , $(0IDX), , $(0IMGEXTX), , $(0IMGEXTY), , $(0IMGEXTZ), , $(0IMGEXTC), , $(0IMGEXTT), , $(0IMGEXTU), , $(0IMGEXT), , , (input00), ... ,.
 
Conversion of numbers to std::string.
MLRELEASE_TOOLS_EXPORT std::string ml::ReleaseToolsString::toIntStr (int val, signed char fieldWidth=-1, bool padWithZeros=false)
 Tool function to convert an integer to a string.
 
MLRELEASE_TOOLS_EXPORT std::string ml::ReleaseToolsString::toMLIntStr (MLint val, signed char fieldWidth=-1, bool padWithZeros=false)
 Tool function to convert an MLint to a string.
 
MLRELEASE_TOOLS_EXPORT std::string ml::ReleaseToolsString::toMLUIntStr (MLuint val, signed char fieldWidth=-1, bool padWithZeros=false)
 Tool function to convert an MLuint to a string.
 
MLRELEASE_TOOLS_EXPORT std::string ml::ReleaseToolsString::toSize_tStr (size_t val, signed char fieldWidth=-1, bool padWithZeros=false)
 Tool function to convert a size_t to a string.
 
MLRELEASE_TOOLS_EXPORT std::string ml::ReleaseToolsString::toDblStr (MLdouble val, signed char fieldWidth=-1, signed char numDecimalPlaces=-1, bool padWithZeros=false, bool considerValAsFloat=false)
 Tool function to print an MLdouble value to a std::string.
 

Variables

MLRELEASE_TOOLS_EXPORT const std::string ml::ReleaseToolsString::DefaultLineSeparator
 The default line separator used for line endings when converting the internal string vector to a string with the default getString() or operator>>.
 

Detailed Description

Tool class for some string operations.

Author
Wolf Spindler
Date
01/2012

Definition in file mlReleaseToolsString.h.