Relacs Options Library
0.9.8
|
#include <str.h>
Public Member Functions | |
Str (void) | |
Str (const Str &s) | |
Str (const string &s) | |
Str (const char *s) | |
Str (char c) | |
Str (const string &s, int width, char pad=Pad) | |
Str (const char *s, int width, char pad=Pad) | |
Str (char c, int len) | |
Str (double val, int width=Width, int precision=Precision, char format=DoubleFormat, char pad=Pad) | |
Str (signed long val, int width=Width, char pad=Pad) | |
Str (unsigned long val, int width=Width, char pad=Pad) | |
Str (signed int val, int width=Width, char pad=Pad) | |
Str (unsigned int val, int width=Width, char pad=Pad) | |
Str (signed short val, int width=Width, char pad=Pad) | |
Str (unsigned short val, int width=Width, char pad=Pad) | |
Str (long long val, int width=Width, char pad=Pad) | |
Str (bool b, int width=Width, char format=BoolFormat, char pad=Pad) | |
Str (const string &s, const char *format) | |
Str (const char *s, const char *format) | |
Str (char c, const char *format) | |
Str (double val, const char *format) | |
Str (signed long val, const char *format) | |
Str (unsigned long val, const char *format) | |
Str (signed int val, const char *format) | |
Str (unsigned int val, const char *format) | |
Str (signed short val, const char *format) | |
Str (unsigned short val, const char *format) | |
Str (long long val, const char *format) | |
Str (const string &s, const string &format) | |
Str (const char *s, const string &format) | |
Str (char c, const string &format) | |
Str (double val, const string &format) | |
Str (signed long val, const string &format) | |
Str (unsigned long val, const string &format) | |
Str (signed int val, const string &format) | |
Str (unsigned int val, const string &format) | |
Str (signed short val, const string &format) | |
Str (unsigned short val, const string &format) | |
Str (long long val, const string &format) | |
Str & | operator= (const string &s) |
Str & | operator= (const char *s) |
Str & | operator= (char c) |
const Str & | assign (const string &s, int width=Width, char pad=Pad) |
const Str & | assign (const char *s, int width=Width, char pad=Pad) |
const Str & | assign (char c, int len=CharRepeat) |
const Str & | assign (double val, int width=Width, int precision=Precision, char format=DoubleFormat, char pad=Pad) |
const Str & | assign (signed long val, int width=Width, char pad=Pad) |
const Str & | assign (unsigned long val, int width=Width, char pad=Pad) |
const Str & | assign (signed int val, int width=Width, char pad=Pad) |
const Str & | assign (unsigned int val, int width=Width, char pad=Pad) |
const Str & | assign (signed short val, int width=Width, char pad=Pad) |
const Str & | assign (unsigned short val, int width=Width, char pad=Pad) |
const Str & | assign (long long val, int width=Width, char pad=Pad) |
const Str & | assign (bool b, int width=Width, char format=BoolFormat, char pad=Pad) |
const Str & | assign (const string &s, const char *format) |
const Str & | assign (const char *s, const char *format) |
const Str & | assign (char c, const char *format) |
const Str & | assign (double val, const char *format) |
const Str & | assign (signed long val, const char *format) |
const Str & | assign (unsigned long val, const char *format) |
const Str & | assign (signed int val, const char *format) |
const Str & | assign (unsigned int val, const char *format) |
const Str & | assign (signed short val, const char *format) |
const Str & | assign (unsigned short val, const char *format) |
const Str & | assign (long long val, const char *format) |
const Str & | assign (const string &s, const string &format) |
const Str & | assign (const char *s, const string &format) |
const Str & | assign (char c, const string &format) |
const Str & | assign (double val, const string &format) |
const Str & | assign (signed long val, const string &format) |
const Str & | assign (unsigned long val, const string &format) |
const Str & | assign (signed int val, const string &format) |
const Str & | assign (unsigned int val, const string &format) |
const Str & | assign (signed short val, const string &format) |
const Str & | assign (unsigned short val, const string &format) |
const Str & | assign (long long val, const string &format) |
const Str & | append (const string &s, int width=Width, char pad=Pad) |
const Str & | append (const char *s, int width=Width, char pad=Pad) |
const Str & | append (char c, int len=CharRepeat) |
const Str & | append (double val, int width=Width, int precision=Precision, char format=DoubleFormat, char pad=Pad) |
const Str & | append (signed long val, int width=Width, char pad=Pad) |
const Str & | append (unsigned long val, int width=Width, char pad=Pad) |
const Str & | append (signed int val, int width=Width, char pad=Pad) |
const Str & | append (unsigned int val, int width=Width, char pad=Pad) |
const Str & | append (signed short val, int width=Width, char pad=Pad) |
const Str & | append (unsigned short val, int width=Width, char pad=Pad) |
const Str & | append (long long val, int width=Width, char pad=Pad) |
const Str & | append (bool b, int width=Width, char format=BoolFormat, char pad=Pad) |
const Str & | append (const string &s, const char *format) |
const Str & | append (const char *s, const char *format) |
const Str & | append (char c, const char *format) |
const Str & | append (double val, const char *format) |
const Str & | append (signed long val, const char *format) |
const Str & | append (unsigned long val, const char *format) |
const Str & | append (signed int val, const char *format) |
const Str & | append (unsigned int val, const char *format) |
const Str & | append (signed short val, const char *format) |
const Str & | append (unsigned short val, const char *format) |
const Str & | append (long long val, const char *format) |
const Str & | append (const string &s, const string &format) |
const Str & | append (const char *s, const string &format) |
const Str & | append (char c, const string &format) |
const Str & | append (double val, const string &format) |
const Str & | append (signed long val, const string &format) |
const Str & | append (unsigned long val, const string &format) |
const Str & | append (signed int val, const string &format) |
const Str & | append (unsigned int val, const string &format) |
const Str & | append (signed short val, const string &format) |
const Str & | append (unsigned short val, const string &format) |
const Str & | append (long long val, const string &format) |
int | size (void) const |
int | readFormat (int pos, int &width, int &precision, char &type, char &pad) |
int | formatWidth (int pos=0) const |
int | totalWidth (void) const |
int | format (const string &s, char type='s', int pos=0) |
int | format (const char *s, char type='s', int pos=0) |
int | format (char c, char type='c', int pos=0) |
int | format (double number, char type, char ftype=' ', int pos=0) |
int | format (double number, const string &type="fge", const string &ftype="", int pos=0) |
int | format (long number, char type='d', char ftype=' ', int pos=0) |
int | format (signed int number, char type='d', char ftype=' ', int pos=0) |
int | format (unsigned int number, char type='u', char ftype=' ', int pos=0) |
int | format (signed short number, char type='d', char ftype=' ', int pos=0) |
int | format (unsigned short number, char type='u', char ftype=' ', int pos=0) |
Str & | format (int year, int month, int day, int hour=0, int minute=0, int second=0, int millisecond=0) |
Str & | format (const struct tm *time) |
double | number (double dflt=0.0, int index=0, int *next=0, const string &space=Space) const |
double | number (double &error, double dflt=0.0, int index=0, int *next=0, const string &space=Space) const |
double | number (double &error, string &unit, double dflt=0.0, int index=0, int *next=0, const string &space=Space) const |
double | error (double dflt=0.0, int index=0, int *next=0, const string &space=Space) const |
Str | unit (const string &dflt="", int index=0, int *next=0, const string &space=Space) const |
Str | ident (int index=0, const string &a=":=", const string &space=Space) const |
Str | value (int index=0, const string &a=":=", const string &space=Space) const |
int | date (int &year, int &month, int &day) const |
int | time (int &hour, int &minutes, int &seconds, int &milliseconds) const |
int | time (int &hour, int &minutes, int &seconds) const |
int | ident (const string &search, const string &space=Space) const |
int | value (const string &search, const string &space=Space) const |
Str | text (const string &search, const string &dflt, const string &space=Space) const |
double | number (const string &search, double dflt=0.0, const string &space=Space) const |
double | error (const string &search, double dflt=0.0, const string &space=Space) const |
Str | unit (const string &search, const string &dflt="", const string &space=Space) const |
void | range (vector< int > &ri, const string &sep=",", const string &r="..") const |
void | range (vector< double > &rd, const string &sep=",", const string &r="..") const |
int | find (const string &s, int index=0, bool cs=true, int word=0, const string &space=Space) const |
int | find (const char *s, int index=0, bool cs=true, int word=0, const string &space=Space) const |
int | find (char c, int index=0, bool cs=true, int word=0, const string &space=Space) const |
int | rfind (const string &s, int index=-2, bool cs=true, int word=0, const string &space=Space) const |
int | rfind (const char *s, int index=-2, bool cs=true, int word=0, const string &space=Space) const |
int | rfind (char c, int index=-2, bool cs=true, int word=0, const string &space=Space) const |
int | findFirst (const string &s, int index=0) const |
int | findFirst (const char *s, int index=0) const |
int | findFirst (char c, int index=0) const |
int | findFirstNot (const string &s, int index=0) const |
int | findFirstNot (const char *s, int index=0) const |
int | findFirstNot (char c, int index=0) const |
int | findLast (const string &s, int index=-2) const |
int | findLast (const char *s, int index=-2) const |
int | findLast (char c, int index=-2) const |
int | findLastNot (const string &s, int index=-2) const |
int | findLastNot (const char *s, int index=-2) const |
int | findLastNot (char c, int index=-2) const |
int | contains (const string &s, int index=0, bool cs=true, int word=0, const string &space=Space, const string &comment=Comment) const |
int | contains (const char *s, int index=0, bool cs=true, int word=0, const string &space=Space, const string &comment=Comment) const |
int | contains (char ch, int index=0, bool cs=true, int word=0, const string &space=Space, const string &comment=Comment) const |
int | findBracket (int index=0, const string &brackets=Bracket, const string &comment=Comment) const |
Str & | stripBracket (const string &brackets=Bracket, const string &comment=Comment) |
Str | strippedBracket (const string &brackets=Bracket, const string &comment=Comment) const |
Str & | truncate (int len) |
Str & | resize (int len) |
Str & | resize (int len, char ch) |
Str | left (int len) const |
Str | right (int len) const |
Str | mid (int pos, int upto=-1) const |
Str | substr (int pos, int len=-1) const |
Str & | erase (int pos, int n=-1) |
int | erase (const string &s) |
Str | erased (const string &s) const |
int | erase (const string &s, int index, bool cs=true, int word=0, const string &space=Space) |
bool | eraseFirst (const string &s) |
Str | erasedFirst (const string &s) const |
bool | eraseFirst (const string &s, int index, bool cs=true, int word=0, const string &space=Space) |
Str & | replace (int pos, int n, const string &rs) |
int | replace (const string &s, const string &rs) |
int | replace (const string &s, const string &rs, int index, bool cs=true, int word=0, const string &space=Space) |
Str | replaced (const string &s, const string &rs) const |
int | eraseMarkup (void) |
Str | erasedMarkup (void) const |
Str & | preventFirst (char c) |
Str | preventedFirst (char c) const |
Str & | preventFirst (const char *s) |
Str | preventedFirst (const char *s) const |
Str & | preventFirst (const string &s) |
Str | preventedFirst (const string &s) const |
Str & | preventLast (char c) |
Str | preventedLast (char c) const |
Str & | preventLast (const char *s) |
Str | preventedLast (const char *s) const |
Str & | preventLast (const string &s) |
Str | preventedLast (const string &s) const |
Str & | provideFirst (char c) |
Str | providedFirst (char c) const |
Str & | provideFirst (const char *s) |
Str | providedFirst (const char *s) const |
Str & | provideFirst (const string &s) |
Str | providedFirst (const string &s) const |
Str & | provideLast (char c) |
Str | providedLast (char c) const |
Str & | provideLast (const char *s) |
Str | providedLast (const char *s) const |
Str & | provideLast (const string &s) |
Str | providedLast (const string &s) const |
Str & | upper (void) |
Str | up (void) const |
Str & | lower (void) |
Str | low (void) const |
Str & | leftJustify (int width=Width, char pad=Pad) |
Str | leftJustified (int width=Width, char pad=Pad) const |
Str & | rightJustify (int width=Width, char pad=Pad) |
Str | rightJustified (int width=Width, char pad=Pad) const |
Str & | centerJustify (int width=Width, char pad=Pad) |
Str | centerJustified (int width=Width, char pad=Pad) const |
Str & | goldenJustify (int width=Width, char pad=Pad) |
Str | goldenJustified (int width=Width, char pad=Pad) const |
bool | empty (const string &space=Space, const string &comment=Comment) const |
Str & | strip (const string &space=Space, const string &comment=Comment) |
Str & | strip (char space, const string &comment=Comment) |
Str | stripped (const string &space=Space, const string &comment=Comment) const |
Str | stripped (char space, const string &comment=Comment) const |
Str & | simplify (const string &space=Space, const string &comment=Comment) |
Str & | simplify (char space, const string &comment=Comment) |
Str | simplified (const string &space=Space, const string &comment=Comment) const |
Str | simplified (char space, const string &comment=Comment) const |
Str & | stripComment (const string &comment=Comment) |
Str | strippedComment (const string &comment=Comment) const |
int | first (const string &space=Space) const |
int | nextWord (int &index, const string &space=Space, const string &comment=Comment) const |
Str | wordAt (int &index, const string &space=Space, const string &comment=Comment) const |
Str | word (int n, const string &space=Space, const string &comment=Comment) const |
int | words (const string &space=Space, const string &comment=Comment) const |
int | nextField (int &index, const string &space=Space, const string &comment=Comment) const |
int | findSeparator (int index=0, const string &separator=Separator, const string &brackets=Bracket, const string &comment=Comment) const |
Str | field (int n, const string &separator=Separator, const string &brackets=Bracket, const string &comment=Comment) const |
Str & | stripWorkingPath (int maxlevel=10, char dirsep=DirSep) |
Str | dir (char dirsep=DirSep) const |
Str | notdir (char dirsep=DirSep) const |
Str | name (char dirsep=DirSep, char extsep=ExtSep) const |
Str | longName (char dirsep=DirSep, char extsep=ExtSep) const |
Str | extension (char dirsep=DirSep, char extsep=ExtSep) const |
Str | suffix (char dirsep=DirSep, char extsep=ExtSep) const |
Str | basename (char dirsep=DirSep, char extsep=ExtSep) const |
Str & | stripDir (char dirsep=DirSep) |
Str & | stripNotdir (char dirsep=DirSep) |
Str & | stripExtension (char dirsep=DirSep, char extsep=ExtSep) |
Str & | stripSuffix (char dirsep=DirSep, char extsep=ExtSep) |
Str & | stripBasename (char dirsep=DirSep, char extsep=ExtSep) |
Str & | preventSlash (char dirsep=DirSep) |
Str | preventedSlash (char dirsep=DirSep) const |
Str & | provideSlash (char dirsep=DirSep) |
Str | providedSlash (char dirsep=DirSep) const |
Str & | preventPeriod (char extsep=ExtSep) |
Str | preventedPeriod (char extsep=ExtSep) const |
Str & | providePeriod (char extsep=ExtSep) |
Str | providedPeriod (char extsep=ExtSep) const |
Str & | expandHome (char dirsep=DirSep, char homechr=HomeChr) |
Str | expandedHome (char dirsep=DirSep, char homechr=HomeChr) const |
Str & | removeWorking (char dirsep=DirSep) |
Str | removedWorking (char dirsep=DirSep) const |
Str & | addWorking (const string &dir="", char dirsep=DirSep) |
Str | addedWorking (const string &dir="", char dirsep=DirSep) const |
Str & | expandParent (char dirsep=DirSep) |
Str | expandedParent (char dirsep=DirSep) const |
Str & | expandPath (const string &dir="", char dirsep=DirSep, char homechr=HomeChr) |
Str | expandedPath (const string &dir="", char dirsep=DirSep, char homechr=HomeChr) const |
Str & | addExtension (const string &extension, char extsep=ExtSep) |
Str | addedExtension (const string &extension, char extsep=ExtSep) const |
Str & | provideExtension (const string &extension, char dirsep=DirSep, char extsep=ExtSep) |
Str | providedExtension (const string &extension, char dirsep=DirSep, char extsep=ExtSep) const |
Str & | environment (const string &env) |
Str | latex (void) const |
Str | latexNum (void) const |
Str | latexUnit (void) const |
Str | html (void) const |
Str | htmlUnit (void) const |
Static Public Member Functions | |
static const string & | bracket (void) |
static void | setBracket (const string &bracket) |
static const string & | space (void) |
static void | setSpace (const string &space) |
static string | comment (void) |
static void | setComment (const string &comment) |
static const string & | separator (void) |
static void | setSeparator (const string &separator) |
static char | dirSep (void) |
static void | setDirSep (char dirsep) |
static char | extSep (void) |
static void | setExtSep (char extsep) |
static char | homeChr (void) |
static void | setHomeChr (char homechr) |
static string & | homeEnv (void) |
static void | setHomeEnv (const string &homeenv) |
static Str | homePath (char dirsep=DirSep) |
static string & | workingEnv (void) |
static void | setWorkingEnv (const string &workingenv) |
static Str | workingPath (char dirsep=DirSep) |
static Str | getEnvironment (const string &env) |
static int | width (void) |
static void | setWidth (int width) |
static int | precision (void) |
static void | setPrecision (int precision) |
static int | repeats (void) |
static void | setRepeats (int repeats) |
static char | doubleFormat (void) |
static void | setDoubleFormat (char format) |
static char | boolFormat (void) |
static void | setBoolFormat (char format) |
static char | pad (void) |
static void | setPad (char pad) |
static void | setDefault (void) |
Static Public Attributes | |
static const Str | WhiteSpace = " \t\n\r\v\f" |
static const Str | DoubleWhiteSpace = " \t\n\r\v\f" |
static const Str | BlankSpace = " \t" |
static const Str | DoubleBlankSpace = " \t" |
static const Str | WordSpace = " \t\n\r\v\f`'\",.:;?!" |
static const Str | DoubleWordSpace = " \t\n\r\v\f`'\",.:;?!" |
static const Str | FirstNumber = "0123456789+-" |
static const Str | Number = "0123456789.+-eE" |
static const Str | Digit = "0123456789" |
static const Str | LeftBracket = "([{<`" |
static const Str | RightBracket = ")]}>'" |
Advanced string manipulation.
Str( long, width, pad ), format( long ): missing type flag (u,d,x,...)
generalize the double blank concept for spaces and separators to any character.
Do we need each function with comments? Cant we just use stripComment before?
Str | ( | void | ) |
Constructs an empty string.
Referenced by Str::find(), Str::format(), Str::getEnvironment(), and Str::rfind().
Str | ( | const string & | s | ) |
Constructs a copy of s.
Str | ( | const char * | s | ) |
Constructs a copy of s.
Str | ( | char | c | ) |
Constructs a string containing the single character c.
Str | ( | const string & | s, |
int | width, | ||
char | pad = Pad |
||
) |
Constructs a string of size width containing a copy of s. If width is positive, s is right justified, otherwise s is left justified. pad is used as the character that is filled in. If s is longer than width, it is truncated. If width equals zero, the whole string s is copied tothis.
Str | ( | const char * | s, |
int | width, | ||
char | pad = Pad |
||
) |
Constructs a string of size width containing a copy of s. If width is positive, s is right justified, otherwise s is left justified. pad is used as the character that is filled in. If s is longer than width, it is truncated. If width equals zero, the whole string s is copied tothis.
Str | ( | char | c, |
int | len | ||
) |
Constructs a string containing len copies of c.
Str | ( | double | val, |
int | width = Width , |
||
int | precision = Precision , |
||
char | format = DoubleFormat , |
||
char | pad = Pad |
||
) |
Convert val into a string of size width. If width is positive, the number is right justified, otherwise the number is left justified.
Str | ( | signed long | val, |
int | width = Width , |
||
char | pad = Pad |
||
) |
Convert val into a string of size width. If width is positive, the number is right justified, otherwise the number is left justified.
Str | ( | unsigned long | val, |
int | width = Width , |
||
char | pad = Pad |
||
) |
Convert val into a string of size width. If width is positive, the number is right justified, otherwise the number is left justified.
Str | ( | signed int | val, |
int | width = Width , |
||
char | pad = Pad |
||
) |
Convert val into a string of size width. If width is positive, the number is right justified, otherwise the number is left justified.
Str | ( | unsigned int | val, |
int | width = Width , |
||
char | pad = Pad |
||
) |
Convert val into a string of size width. If width is positive, the number is right justified, otherwise the number is left justified.
Str | ( | signed short | val, |
int | width = Width , |
||
char | pad = Pad |
||
) |
Convert val into a string of size width. If width is positive, the number is right justified, otherwise the number is left justified.
Str | ( | unsigned short | val, |
int | width = Width , |
||
char | pad = Pad |
||
) |
Convert val into a string of size width. If width is positive, the number is right justified, otherwise the number is left justified.
Str | ( | long long | val, |
int | width = Width , |
||
char | pad = Pad |
||
) |
Convert val into a string of size width. If width is positive, the number is right justified, otherwise the number is left justified.
Str | ( | bool | b, |
int | width = Width , |
||
char | format = BoolFormat , |
||
char | pad = Pad |
||
) |
Convert b into a string of size width. Depending on format the resulting string is true
or false
(format equals t
or f
), yes
or no
(format equals y
or n
) 1
or 0
(otherwise). If width is positive, the resulting string is right justified, otherwise the resulting string is left justified.
Str | ( | const string & | s, |
const char * | format | ||
) |
Constructs a string containing s according to the C-printf-style format string format.
Str | ( | const char * | s, |
const char * | format | ||
) |
Constructs a string containing s according to the C-printf-style format string format.
Str | ( | char | c, |
const char * | format | ||
) |
Constructs a string containing c according to the C-printf-style format string format.
Str | ( | double | val, |
const char * | format | ||
) |
Converts val to this string according to the C-printf-style format string format.
Str | ( | signed long | val, |
const char * | format | ||
) |
Converts val to this string according to the C-printf-style format string format.
Str | ( | unsigned long | val, |
const char * | format | ||
) |
Converts val to this string according to the C-printf-style format string format.
Str | ( | signed int | val, |
const char * | format | ||
) |
Converts val to this string according to the C-printf-style format string format.
Str | ( | unsigned int | val, |
const char * | format | ||
) |
Converts val to this string according to the C-printf-style format string format.
Str | ( | signed short | val, |
const char * | format | ||
) |
Converts val to this string according to the C-printf-style format string format.
Str | ( | unsigned short | val, |
const char * | format | ||
) |
Converts val to this string according to the C-printf-style format string format.
Str | ( | long long | val, |
const char * | format | ||
) |
Converts val to this string according to the C-printf-style format string format.
Str | ( | const string & | s, |
const string & | format | ||
) |
Constructs a string containing s according to the C-printf-style format string format.
Str | ( | const char * | s, |
const string & | format | ||
) |
Constructs a string containing s according to the C-printf-style format string format.
Str | ( | char | c, |
const string & | format | ||
) |
Constructs a string containing c according to the C-printf-style format string format.
Str | ( | double | val, |
const string & | format | ||
) |
Converts val to this string according to the C-printf-style format string format.
Str | ( | signed long | val, |
const string & | format | ||
) |
Converts val to this string according to the C-printf-style format string format.
Str | ( | unsigned long | val, |
const string & | format | ||
) |
Converts val to this string according to the C-printf-style format string format.
Str | ( | signed int | val, |
const string & | format | ||
) |
Converts val to this string according to the C-printf-style format string format.
Str | ( | unsigned int | val, |
const string & | format | ||
) |
Converts val to this string according to the C-printf-style format string format.
Str | ( | signed short | val, |
const string & | format | ||
) |
Converts val to this string according to the C-printf-style format string format.
Str | ( | unsigned short | val, |
const string & | format | ||
) |
Converts val to this string according to the C-printf-style format string format.
Str | ( | long long | val, |
const string & | format | ||
) |
Converts val to this string according to the C-printf-style format string format.
Str & operator= | ( | const string & | s | ) |
Assign s to this.
Str & operator= | ( | const char * | s | ) |
Assign s to this.
Str & operator= | ( | char | c | ) |
Assign c to this.
const Str & assign | ( | const string & | s, |
int | width = Width , |
||
char | pad = Pad |
||
) |
Assigns a string of size width containing a copy of s. If width is positive, s is right justified, otherwise s is left justified. pad is used as the character that is filled in. If s is longer than width, it is truncated. If width equals zero, the whole string s is copied tothis.
const Str & assign | ( | const char * | s, |
int | width = Width , |
||
char | pad = Pad |
||
) |
Assigns a string of size width containing a copy of s. If width is positive, s is right justified, otherwise s is left justified. pad is used as the character that is filled in. If s is longer than width, it is truncated. If width equals zero, the whole string s is copied tothis.
const Str & assign | ( | char | c, |
int | len = CharRepeat |
||
) |
Assigns a string containing len copies of c.
const Str & assign | ( | double | val, |
int | width = Width , |
||
int | precision = Precision , |
||
char | format = DoubleFormat , |
||
char | pad = Pad |
||
) |
Convert val into a string of size width and assign it to this. If width is positive, the number is right justified, otherwise the number is left justified.
const Str & assign | ( | signed long | val, |
int | width = Width , |
||
char | pad = Pad |
||
) |
Convert val into a string of size width and assign it to this. If width is positive, the number is right justified, otherwise the number is left justified.
const Str & assign | ( | unsigned long | val, |
int | width = Width , |
||
char | pad = Pad |
||
) |
Convert val into a string of size width and assign it to this. If width is positive, the number is right justified, otherwise the number is left justified.
const Str & assign | ( | signed int | val, |
int | width = Width , |
||
char | pad = Pad |
||
) |
Convert val into a string of size width and assign it to this. If width is positive, the number is right justified, otherwise the number is left justified.
const Str & assign | ( | unsigned int | val, |
int | width = Width , |
||
char | pad = Pad |
||
) |
Convert val into a string of size width and assign it to this. If width is positive, the number is right justified, otherwise the number is left justified.
const Str & assign | ( | signed short | val, |
int | width = Width , |
||
char | pad = Pad |
||
) |
Convert val into a string of size width and assign it to this. If width is positive, the number is right justified, otherwise the number is left justified.
const Str & assign | ( | unsigned short | val, |
int | width = Width , |
||
char | pad = Pad |
||
) |
Convert val into a string of size width and assign it to this. If width is positive, the number is right justified, otherwise the number is left justified.
const Str & assign | ( | long long | val, |
int | width = Width , |
||
char | pad = Pad |
||
) |
Convert val into a string of size width and assign it to this. If width is positive, the number is right justified, otherwise the number is left justified.
const Str & assign | ( | bool | b, |
int | width = Width , |
||
char | format = BoolFormat , |
||
char | pad = Pad |
||
) |
Convert b into a string of size width and assign it to this. Depending on format the resulting string is true
or false
(format equals t
or f
), yes
or no
(format equals y
or n
) 1
or 0
(otherwise). If width is positive, the resulting string is right justified, otherwise the resulting string is left justified.
const Str & assign | ( | const string & | s, |
const char * | format | ||
) |
Assigns a string containing s according to the C-printf-style format string format to this.
const Str & assign | ( | const char * | s, |
const char * | format | ||
) |
Assigns a string containing s according to the C-printf-style format string format to this.
const Str & assign | ( | char | c, |
const char * | format | ||
) |
Assigns a string containing c according to the C-printf-style format string format to this.
const Str & assign | ( | double | val, |
const char * | format | ||
) |
Converts val to a string according to the C-printf-style format string format and assign it to this.
const Str & assign | ( | signed long | val, |
const char * | format | ||
) |
Converts val to a string according to the C-printf-style format string format and assign it to this.
const Str & assign | ( | unsigned long | val, |
const char * | format | ||
) |
Converts val to a string according to the C-printf-style format string format and assign it to this.
const Str & assign | ( | signed int | val, |
const char * | format | ||
) |
Converts val to a string according to the C-printf-style format string format and assign it to this.
const Str & assign | ( | unsigned int | val, |
const char * | format | ||
) |
Converts val to a string according to the C-printf-style format string format and assign it to this.
const Str & assign | ( | signed short | val, |
const char * | format | ||
) |
Converts val to a string according to the C-printf-style format string format and assign it to this.
const Str & assign | ( | unsigned short | val, |
const char * | format | ||
) |
Converts val to a string according to the C-printf-style format string format and assign it to this.
const Str & assign | ( | long long | val, |
const char * | format | ||
) |
Converts val to a string according to the C-printf-style format string format and assign it to this.
const Str & assign | ( | const string & | s, |
const string & | format | ||
) |
Assigns a string containing s according to the C-printf-style format string format to this.
const Str & assign | ( | const char * | s, |
const string & | format | ||
) |
Assigns a string containing s according to the C-printf-style format string format to this.
const Str & assign | ( | char | c, |
const string & | format | ||
) |
Assigns a string containing c according to the C-printf-style format string format to this.
const Str & assign | ( | double | val, |
const string & | format | ||
) |
Converts val to a string according to the C-printf-style format string format and assign it to this.
const Str & assign | ( | signed long | val, |
const string & | format | ||
) |
Converts val to a string according to the C-printf-style format string format and assign it to this.
const Str & assign | ( | unsigned long | val, |
const string & | format | ||
) |
Converts val to a string according to the C-printf-style format string format and assign it to this.
const Str & assign | ( | signed int | val, |
const string & | format | ||
) |
Converts val to a string according to the C-printf-style format string format and assign it to this.
const Str & assign | ( | unsigned int | val, |
const string & | format | ||
) |
Converts val to a string according to the C-printf-style format string format and assign it to this.
const Str & assign | ( | signed short | val, |
const string & | format | ||
) |
Converts val to a string according to the C-printf-style format string format and assign it to this.
const Str & assign | ( | unsigned short | val, |
const string & | format | ||
) |
Converts val to a string according to the C-printf-style format string format and assign it to this.
const Str & assign | ( | long long | val, |
const string & | format | ||
) |
Converts val to a string according to the C-printf-style format string format and assign it to this.
const Str & append | ( | const string & | s, |
int | width = Width , |
||
char | pad = Pad |
||
) |
Referenced by Str::addedWorking(), Str::html(), Str::htmlUnit(), Str::latex(), Str::latexNum(), Str::latexUnit(), Str::low(), and Str::up().
const Str & append | ( | const char * | s, |
int | width = Width , |
||
char | pad = Pad |
||
) |
const Str & append | ( | char | c, |
int | len = CharRepeat |
||
) |
const Str & append | ( | double | val, |
int | width = Width , |
||
int | precision = Precision , |
||
char | format = DoubleFormat , |
||
char | pad = Pad |
||
) |
const Str & append | ( | signed long | val, |
int | width = Width , |
||
char | pad = Pad |
||
) |
const Str & append | ( | unsigned long | val, |
int | width = Width , |
||
char | pad = Pad |
||
) |
const Str & append | ( | signed int | val, |
int | width = Width , |
||
char | pad = Pad |
||
) |
const Str & append | ( | unsigned int | val, |
int | width = Width , |
||
char | pad = Pad |
||
) |
const Str & append | ( | signed short | val, |
int | width = Width , |
||
char | pad = Pad |
||
) |
const Str & append | ( | unsigned short | val, |
int | width = Width , |
||
char | pad = Pad |
||
) |
const Str & append | ( | long long | val, |
int | width = Width , |
||
char | pad = Pad |
||
) |
const Str & append | ( | bool | b, |
int | width = Width , |
||
char | format = BoolFormat , |
||
char | pad = Pad |
||
) |
const Str & append | ( | const string & | s, |
const char * | format | ||
) |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
const Str & append | ( | const string & | s, |
const string & | format | ||
) |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
The size of the string, i.e. the number of characters it contains.
Referenced by Str::addedWorking(), Str::addWorking(), Str::centerJustify(), Str::contains(), Str::erase(), Str::error(), Str::expandedHome(), Str::expandedParent(), Str::expandHome(), Str::expandParent(), Str::field(), Str::find(), Str::findBracket(), Str::findFirstNot(), Str::findLast(), Str::findLastNot(), Str::findSeparator(), Str::format(), Str::formatWidth(), Str::goldenJustify(), Str::ident(), Str::leftJustify(), Options::load(), Str::mid(), Options::nameWidth(), Str::nextField(), Str::nextWord(), Str::number(), Parameter::Parameter(), Str::preventedFirst(), Str::preventedLast(), Str::preventFirst(), Str::preventLast(), Str::providedExtension(), Str::providedFirst(), Str::providedLast(), Str::provideExtension(), Str::provideFirst(), Str::provideLast(), Options::read(), Str::readFormat(), Str::removedWorking(), Str::removeWorking(), Str::replace(), Str::replaced(), Str::rfind(), Str::right(), Str::rightJustify(), Str::simplified(), Str::simplify(), Options::size(), Str::strip(), Str::stripBracket(), Str::stripped(), Str::stripWorkingPath(), Str::substr(), Str::text(), and Str::unit().
int readFormat | ( | int | pos, |
int & | width, | ||
int & | precision, | ||
char & | type, | ||
char & | pad | ||
) |
Analyse the format string beginning at pos and returns the specified width width, precision precision, the format type type, and the padding character pad. The index behind the last read character is returned.
References Str::left(), Str::pad(), Str::size(), and Str::width().
Referenced by Str::format().
int formatWidth | ( | int | pos = 0 | ) | const |
Returns the width specified by the ANSI-C like format string where pos points to.
References Str::size().
int totalWidth | ( | void | ) | const |
Returns the width of the string taking expanded ANSI-C like format strings into account.
References Str::width().
Referenced by Parameter::formatWidth().
int format | ( | const string & | s, |
char | type = 's' , |
||
int | pos = 0 |
||
) |
Replaces the first format specifier with type type by the formatted string s. Returns the position of the character following the replacement. If nothing was replaced, pos is returned.
References Str::readFormat(), Str::size(), and Str::Str().
Referenced by Parameter::defaultText(), Options::format(), Str::format(), Options::save(), Parameter::testActivation(), and Parameter::text().
int format | ( | const char * | s, |
char | type = 's' , |
||
int | pos = 0 |
||
) |
Replaces the first format specifier with type type by the formatted string s. Returns the position of the character following the replacement. If nothing was replaced, pos is returned.
References Str::readFormat(), Str::size(), and Str::Str().
int format | ( | char | c, |
char | type = 'c' , |
||
int | pos = 0 |
||
) |
Replaces the first format specifier with type type by the character c. Returns the position of the character following the replacement. If nothing was replaced, pos is returned.
References Str::readFormat(), Str::size(), and Str::Str().
int format | ( | double | number, |
char | type, | ||
char | ftype = ' ' , |
||
int | pos = 0 |
||
) |
Replaces the first format specifier with type type by the formatted number number using type ftype. Returns the position of the character following the replacement. If nothing was replaced, pos is returned.
References Str::readFormat(), Str::size(), and Str::Str().
int format | ( | double | number, |
const string & | type = "fge" , |
||
const string & | ftype = "" , |
||
int | pos = 0 |
||
) |
Replaces the first format specifier with type equal to one of the charactert of type by the formatted number number using type ftype. Returns the position of the character following the replacement. If nothing was replaced, pos is returned.
References Str::readFormat(), Str::size(), and Str::Str().
int format | ( | long | number, |
char | type = 'd' , |
||
char | ftype = ' ' , |
||
int | pos = 0 |
||
) |
Replaces the first format specifier with type type by the formatted number number using type ftype. Returns the position of the character following the replacement. If nothing was replaced, pos is returned.
References Str::readFormat(), Str::size(), and Str::Str().
|
inline |
Replaces the first format specifier with type type by the formatted number number using type ftype. Returns the position of the character following the replacement. If nothing was replaced, pos is returned.
|
inline |
Replaces the first format specifier with type type by the formatted number number using type ftype. Returns the position of the character following the replacement. If nothing was replaced, pos is returned.
|
inline |
Replaces the first format specifier with type type by the formatted number number using type ftype. Returns the position of the character following the replacement. If nothing was replaced, pos is returned.
|
inline |
Replaces the first format specifier with type type by the formatted number number using type ftype. Returns the position of the character following the replacement. If nothing was replaced, pos is returned.
Str & format | ( | int | year, |
int | month, | ||
int | day, | ||
int | hour = 0 , |
||
int | minute = 0 , |
||
int | second = 0 , |
||
int | millisecond = 0 |
||
) |
Format the string using the time given by year, month, day, hour, minute, second, millisecond. The following format specifiers are recognized: Z: millisecond (0..999) S: second (0..59) M: minute (0..59) H: hour (0..23) d: day of month (1..31) m: month (1..12) y: last two digits of year (0..99) Y: year (1970...) Width and padding character may also be specified, e.g. %02d produces 01, 02, 03, ... 10, 11, ... 31.
References Str::readFormat(), Str::size(), and Str::Str().
Str & format | ( | const struct tm * | time | ) |
Format the string using the time given by time. See format( int year, int month, int day, int hour, int minute, int second, int millisecond ) for details.
References Str::format().
double number | ( | double | dflt = 0.0 , |
int | index = 0 , |
||
int * | next = 0 , |
||
const string & | space = Space |
||
) | const |
Returns the value of the first number in the string. The number may be preceeded by white space and a single opening bracket. If there is no number or an error occured during conversion, dflt is returned and next is set to index. Search for a number is started at the index -th character. The index of the character following the number is retuned in next if next is not 0.
References Str::Digit, Str::find(), Str::findFirst(), Str::findFirstNot(), Str::FirstNumber, Str::LeftBracket, Str::mid(), and Str::size().
Referenced by Parameter::addActivation(), Parameter::addDefaultNumber(), Parameter::addNumber(), Parameter::changeUnit(), Str::error(), Str::number(), and Str::range().
double number | ( | double & | error, |
double | dflt = 0.0 , |
||
int | index = 0 , |
||
int * | next = 0 , |
||
const string & | space = Space |
||
) | const |
Returns the value of the first number in the string. The number may be preceeded by white space and a single opening bracket. In error the error value following the number is returned. error is only set at success. If there is no number or an error occured during conversion, dflt is returned and next is set to index. Search for a number is started at the index -th character. The index of the character following the number is retuned in next if next is not 0.
References Str::Digit, Str::find(), Str::findFirst(), Str::findFirstNot(), Str::FirstNumber, Str::LeftBracket, Str::mid(), Str::size(), and Str::value().
double number | ( | double & | error, |
string & | unit, | ||
double | dflt = 0.0 , |
||
int | index = 0 , |
||
int * | next = 0 , |
||
const string & | space = Space |
||
) | const |
Returns the value of the first number in the string. The number may be preceeded by white space and a single opening bracket. In error the error value following the number is returned. In unit the unit string following the number (and error value) is returned. error and unit are only set at success. If there is no number or an error occured during conversion, dflt is returned and next is set to index. Search for a number is started at the index -th character. The index of the character following the number is retuned in next if next is not 0.
References Str::Digit, Str::find(), Str::findFirst(), Str::findFirstNot(), Str::FirstNumber, Str::LeftBracket, Str::mid(), Str::RightBracket, Str::size(), Str::substr(), and Str::value().
double error | ( | double | dflt = 0.0 , |
int | index = 0 , |
||
int * | next = 0 , |
||
const string & | space = Space |
||
) | const |
Returns the value of error following the first number in the string. The number and its error are separated by '+/-' or '+-'. The number may be preceeded by white space and a single opening bracket. If there is no error value or an error occured during conversion, dflt is returned and next is set to index. Search for a number is started at the index -th character. The index of the character following the error is retuned in next if next is not 0.
References Str::Digit, Str::find(), Str::findFirst(), Str::mid(), Str::number(), and Str::size().
Referenced by Str::error(), and Str::unit().
Str unit | ( | const string & | dflt = "" , |
int | index = 0 , |
||
int * | next = 0 , |
||
const string & | space = Space |
||
) | const |
Returns the unit following the first number in the string. The number and its possible error value error are separated by '+/-' or '+-'. The number may NOT be preceeded by any non-numerical characters. If the string does not start directly with a number, it is treated as a unit. If there is no unit string, dflt is returned and next is set to index. Search for a number is started at the index -th character. The index of the character following the unit is retuned in next if next is not 0.
References Str::Digit, Str::error(), Str::find(), Str::findFirst(), Str::findFirstNot(), Str::FirstNumber, Str::LeftBracket, Str::mid(), Str::RightBracket, Str::size(), and Str::substr().
Referenced by Parameter::addActivation(), Parameter::changeUnit(), Str::unit(), and Options::unit().
Str ident | ( | int | index = 0 , |
const string & | a = ":=" , |
||
const string & | space = Space |
||
) | const |
Returns the stripped() string befor the first occurence of one of the characters specified in a after position index.
References Str::findFirst(), Str::findFirstNot(), Str::findLastNot(), Str::size(), and Str::substr().
Referenced by Parameter::read(), and Str::value().
Str value | ( | int | index = 0 , |
const string & | a = ":=" , |
||
const string & | space = Space |
||
) | const |
Returns the stripped() string right behind the first occurence of one of the characters specified in a after position index.
References Str::findFirst(), Str::findFirstNot(), Str::findLastNot(), and Str::substr().
Referenced by Str::error(), Str::number(), Parameter::read(), Str::text(), and Str::unit().
int date | ( | int & | year, |
int & | month, | ||
int & | day | ||
) | const |
Reads the year, month, and day of a date string. The string should be formatted as "YYYY-MM-DD", "MM/DD/YYYY" or "MMM DD, YYYY"
Referenced by Parameter::assign(), Parameter::setDate(), and Parameter::setDefaultDate().
int time | ( | int & | hour, |
int & | minutes, | ||
int & | seconds, | ||
int & | milliseconds | ||
) | const |
Reads the hour, minutes, seconds, and milliseconds of a time string. The string should be formatted as "HH:MM:SS.UU".
Referenced by Parameter::assign(), Parameter::setDefaultTime(), Parameter::setTime(), and Str::time().
int time | ( | int & | hour, |
int & | minutes, | ||
int & | seconds | ||
) | const |
Reads the hour, minutes, and seconds of a time string. The string should be formatted as "HH:MM:SS.UU".
References Str::time().
int ident | ( | const string & | search, |
const string & | space = Space |
||
) | const |
Searches for the string search. Returns index to the found search string or -1 if it wasn't found. Additional control characters in the search string are supportet (they can be combined): ^aaa: search is case sensitive, !aaa: aaa has to be the beginning of a word, !!aaa: aaa is the first text appearing in the string, aaa!: aaa has to be the end of a word, !aaa!: aaa has to be a word.
References Str::find(), Str::first(), Str::size(), and Str::word().
int value | ( | const string & | search, |
const string & | space = Space |
||
) | const |
Searches for the string search. Returns an index to the text following the first ':' or '=' after the found search string or -1 if search wasn't found. Additional control characters in the search string are supportet (they can be combined): ^aaa: search is case sensitive, !aaa: aaa has to be the beginning of a word, !!aaa: aaa is the first text appearing in the string, aaa!: aaa has to be the end of a word, !aaa!: aaa has to be a word.
References Str::findFirst(), Str::findFirstNot(), and Str::ident().
Str text | ( | const string & | search, |
const string & | dflt = "" , |
||
const string & | space = Space |
||
) | const |
Returns the text following the first ':' or '=' after the found search string search or dflt if search wasn't found or there isn't any number. ident() is used for searching.
References Str::findFirst(), Str::size(), Str::substr(), and Str::value().
Referenced by Options::text().
double number | ( | const string & | search, |
double | dflt = 0.0 , |
||
const string & | space = Space |
||
) | const |
Returns the value of the number following the first ':' or '=' after the found search string search or dflt if search wasn't found or there isn't any number. ident() is used for searching.
References Str::number(), and Str::value().
double error | ( | const string & | search, |
double | dflt = 0.0 , |
||
const string & | space = Space |
||
) | const |
Returns the error of the number following the first ':' or '=' after the found search string search or dflt if search wasn't found or there isn't any error. ident() is used for searching.
References Str::error(), and Str::value().
Str unit | ( | const string & | search, |
const string & | dflt = "" , |
||
const string & | space = Space |
||
) | const |
Returns the unit of the number following the first ':' or '=' after the found search string search or dflt if search wasn't found or there isn't any number. ident() is used for searching.
References Str::unit(), and Str::value().
void range | ( | vector< int > & | ri, |
const string & | sep = "," , |
||
const string & | r = ".." |
||
) | const |
Extracts a list of integer numbers from the content of the string. Individual numbers are separated by sep, ranges of numbers are indicated by r. Example: "1,-3,6..8,10,20..32..3" results in 1,-3,6,7,8,10,20,23,26,29,32
References Str::number(), Str::space(), and Str::substr().
void range | ( | vector< double > & | rd, |
const string & | sep = "," , |
||
const string & | r = ".." |
||
) | const |
Extracts a list of floating point numbers from the content of the string. Individual numbers are separated by sep, ranges of numbers are indicated by r. Example: "1.2,-3,6.5..8,10,20..32..3" results in 1.2,-3,6.5,7.5,10,20,23,26,29,32
References Str::BlankSpace, Str::number(), Str::space(), and Str::substr().
int find | ( | const string & | s, |
int | index = 0 , |
||
bool | cs = true , |
||
int | word = 0 , |
||
const string & | space = Space |
||
) | const |
References Str::find(), Str::lower(), Str::size(), and Str::Str().
Referenced by Str::contains(), Str::empty(), Str::erase(), Str::eraseFirst(), Str::error(), Str::field(), Str::find(), Str::findBracket(), Str::ident(), Options::load(), Str::nextField(), Str::nextWord(), Str::number(), Options::read(), Str::replace(), Str::stripBracket(), Str::stripWorkingPath(), and Str::unit().
int find | ( | const char * | s, |
int | index = 0 , |
||
bool | cs = true , |
||
int | word = 0 , |
||
const string & | space = Space |
||
) | const |
References Str::find(), Str::lower(), Str::size(), and Str::Str().
int find | ( | char | c, |
int | index = 0 , |
||
bool | cs = true , |
||
int | word = 0 , |
||
const string & | space = Space |
||
) | const |
References Str::find(), Str::lower(), Str::size(), and Str::Str().
int rfind | ( | const string & | s, |
int | index = -2 , |
||
bool | cs = true , |
||
int | word = 0 , |
||
const string & | space = Space |
||
) | const |
References Str::lower(), Str::rfind(), Str::size(), and Str::Str().
Referenced by Parameter::Parameter(), Str::rfind(), and Str::stripWorkingPath().
int rfind | ( | const char * | s, |
int | index = -2 , |
||
bool | cs = true , |
||
int | word = 0 , |
||
const string & | space = Space |
||
) | const |
References Str::lower(), Str::rfind(), Str::size(), and Str::Str().
int rfind | ( | char | c, |
int | index = -2 , |
||
bool | cs = true , |
||
int | word = 0 , |
||
const string & | space = Space |
||
) | const |
References Str::lower(), Str::rfind(), Str::size(), and Str::Str().
int findFirst | ( | const string & | s, |
int | index = 0 |
||
) | const |
int findFirst | ( | const char * | s, |
int | index = 0 |
||
) | const |
int findFirst | ( | char | c, |
int | index = 0 |
||
) | const |
int findFirstNot | ( | const string & | s, |
int | index = 0 |
||
) | const |
References Str::size().
Referenced by Str::empty(), Str::eraseFirst(), Str::findSeparator(), Str::ident(), Options::load(), Str::nextWord(), Str::number(), Options::read(), Str::unit(), and Str::value().
int findFirstNot | ( | const char * | s, |
int | index = 0 |
||
) | const |
References Str::size().
int findFirstNot | ( | char | c, |
int | index = 0 |
||
) | const |
int findLast | ( | const string & | s, |
int | index = -2 |
||
) | const |
References Str::size().
int findLast | ( | const char * | s, |
int | index = -2 |
||
) | const |
References Str::size().
int findLast | ( | char | c, |
int | index = -2 |
||
) | const |
References Str::size().
int findLastNot | ( | const string & | s, |
int | index = -2 |
||
) | const |
References Str::size().
Referenced by Str::ident(), Options::load(), Options::read(), and Str::value().
int findLastNot | ( | const char * | s, |
int | index = -2 |
||
) | const |
References Str::size().
int findLastNot | ( | char | c, |
int | index = -2 |
||
) | const |
References Str::size().
int contains | ( | const string & | s, |
int | index = 0 , |
||
bool | cs = true , |
||
int | word = 0 , |
||
const string & | space = Space , |
||
const string & | comment = Comment |
||
) | const |
References Str::find(), and Str::size().
int contains | ( | const char * | s, |
int | index = 0 , |
||
bool | cs = true , |
||
int | word = 0 , |
||
const string & | space = Space , |
||
const string & | comment = Comment |
||
) | const |
References Str::find(), and Str::size().
int contains | ( | char | ch, |
int | index = 0 , |
||
bool | cs = true , |
||
int | word = 0 , |
||
const string & | space = Space , |
||
const string & | comment = Comment |
||
) | const |
References Str::find(), and Str::size().
|
inlinestatic |
|
inlinestatic |
int findBracket | ( | int | index = 0 , |
const string & | brackets = Bracket , |
||
const string & | comment = Comment |
||
) | const |
Find corresponding closing bracket for the one at position index. The opening brackets are the ones contained in brackets. The corresponding closing brackets are retrieved from RightBracket using LeftBracket. If the opening bracket is not contained in LeftBracket, the closing bracket is assumed to be the same as the opening bracket.
References Str::find(), Str::findFirst(), Str::LeftBracket, Str::RightBracket, and Str::size().
Referenced by Str::findSeparator(), and Str::stripBracket().
Str & stripBracket | ( | const string & | brackets = Bracket , |
const string & | comment = Comment |
||
) |
Remove everything from the string except the characters between the first opening bracket from brackets and the corresponding closing bracket.
References Str::find(), Str::findBracket(), Str::findFirst(), and Str::size().
Referenced by Str::strippedBracket().
Str strippedBracket | ( | const string & | brackets = Bracket , |
const string & | comment = Comment |
||
) | const |
Returns the string between the first opening bracket from brackets and the corresponding closing bracket.
References Str::stripBracket().
|
inline |
|
inline |
Referenced by Str::expandParent(), and Str::simplified().
|
inline |
Str left | ( | int | len | ) | const |
Referenced by Str::readFormat().
Str right | ( | int | len | ) | const |
References Str::size().
Str mid | ( | int | pos, |
int | upto = -1 |
||
) | const |
References Str::size().
Referenced by StrQueue::append(), Str::error(), Options::load(), Str::number(), Parameter::Parameter(), Options::read(), Str::unit(), and Str::wordAt().
Str substr | ( | int | pos, |
int | len = -1 |
||
) | const |
References Str::size().
Referenced by Str::addedExtension(), Str::field(), Str::ident(), Str::number(), Str::range(), ConfigureClasses::read(), Str::strippedComment(), Str::text(), Str::unit(), Str::value(), and Str::word().
Str & erase | ( | int | pos, |
int | n = -1 |
||
) |
Erase substring at pos with length n. If pos < 0, nothing is erased. If len < 0 (default), all characters from index pos to the end of the string are erased.
References Str::size().
Referenced by Str::erased(), Str::erasedFirst(), Str::erasedMarkup(), Str::eraseMarkup(), Options::load(), Parameter::Parameter(), Options::read(), and Str::stripWorkingPath().
int erase | ( | const string & | s | ) |
Remove all sequences in the string which equal s. Returns the number of removed sequences.
Str erased | ( | const string & | s | ) | const |
Returns the string with all sequences which equal s removed.
References Str::erase().
int erase | ( | const string & | s, |
int | index, | ||
bool | cs = true , |
||
int | word = 0 , |
||
const string & | space = Space |
||
) |
Remove all sequences in the string which equal s. Finding the sequences is started at index index. It is case sensitive if cs equals true. If bit one in word is set s has to be preceeded by at least one character given in space. If bit two in word is set s has to be succeeded by at least one character given in space. Returns the number of removed sequences.
References Str::find().
bool eraseFirst | ( | const string & | s | ) |
Remove s from the string if it is found at the beginning. Returns true
if s was removed from the string.
Str erasedFirst | ( | const string & | s | ) | const |
Returns the string with s removed it s was found at the beginning of the string.
References Str::erase().
bool eraseFirst | ( | const string & | s, |
int | index, | ||
bool | cs = true , |
||
int | word = 0 , |
||
const string & | space = Space |
||
) |
Remove s from the string if s is found at the position of the first character not in space. Finding s is started at index index. It is case sensitive if cs equals true. If bit two in word is set s has to be succeeded by at least one character given in space. Returns true if s was found and removed.
References Str::find(), and Str::findFirstNot().
|
inline |
Replace substring at pos with length n by rs.
Referenced by Str::erasedMarkup(), Str::eraseMarkup(), Str::replaced(), and Parameter::text().
int replace | ( | const string & | s, |
const string & | rs | ||
) |
Replace all sequences in the string which equal s by rs. Returns the number of replaced sequences.
References Str::size().
int replace | ( | const string & | s, |
const string & | rs, | ||
int | index, | ||
bool | cs = true , |
||
int | word = 0 , |
||
const string & | space = Space |
||
) |
Replace all sequences in the string which equal s by rs. Finding the sequences is started at index index. It is case sensitive if cs equals true. If bit one in word is set s has to be preceeded by at least one character given in space. If bit two in word is set s has to be succeeded by at least one character given in space. Returns the number of replaced sequences.
References Str::find(), and Str::size().
Str replaced | ( | const string & | s, |
const string & | rs | ||
) | const |
Returns the string with all sequences which equal s replaced by rs.
References Str::replace(), and Str::size().
int eraseMarkup | ( | void | ) |
Removes all markup sequences in the string. That is everything inside sharp braces "<>".
References Str::erase(), and Str::replace().
Str erasedMarkup | ( | void | ) | const |
Retruns the string with all markup sequences removed. That is everything inside sharp braces "<>".
References Str::erase(), and Str::replace().
Str & preventFirst | ( | char | c | ) |
Remove the first character of the string if it equals c.
References Str::size().
Referenced by Parameter::addDefaultText(), Parameter::addText(), Options::load(), Options::read(), and Parameter::selectText().
Str preventedFirst | ( | char | c | ) | const |
Returns the string with its first character removed if it equals c.
References Str::size().
Str & preventFirst | ( | const char * | s | ) |
Remove the initial part of the string if it equals s.
Str preventedFirst | ( | const char * | s | ) | const |
Returns the string with its initial part removed if it equals s.
References Str::size().
Str & preventFirst | ( | const string & | s | ) |
Remove the initial part of the string if it equals s.
References Str::size().
Str preventedFirst | ( | const string & | s | ) | const |
Returns the string with its initial part removed if it equals s.
References Str::size().
Str & preventLast | ( | char | c | ) |
Remove the last character of the string if it equals c.
References Str::size().
Referenced by Parameter::addDefaultText(), Parameter::addText(), Options::load(), Options::read(), and Parameter::selectText().
Str preventedLast | ( | char | c | ) | const |
Returns the string with its last character removed if it equals c.
References Str::size().
Str & preventLast | ( | const char * | s | ) |
Remove the end of the string if it equals s.
References Str::size().
Str preventedLast | ( | const char * | s | ) | const |
Returns the string with its end removed if it equals s.
References Str::size().
Str & preventLast | ( | const string & | s | ) |
Remove the end of the string if it equals s.
References Str::size().
Str preventedLast | ( | const string & | s | ) | const |
Returns the string with its end removed if it equals s.
References Str::size().
Str & provideFirst | ( | char | c | ) |
Insert c at the beginning of the string if the strings first character does not equal c.
References Str::size().
Str providedFirst | ( | char | c | ) | const |
Returns the string with c inserted at the beginning if the strings first character does not equal c.
References Str::size().
Str & provideFirst | ( | const char * | s | ) |
Insert s at the beginning of the string if the strings first characters do not equal s.
References Str::size().
Str providedFirst | ( | const char * | s | ) | const |
Returns the string with s inserted at the beginning if the strings first characters do not equal s.
References Str::size().
Str & provideFirst | ( | const string & | s | ) |
Insert s at the beginning of the string if the strings first characters do not equal s.
References Str::size().
Str providedFirst | ( | const string & | s | ) | const |
Returns the string with s inserted at the beginning if the strings first characters do not equal s.
References Str::size().
Str & provideLast | ( | char | c | ) |
Add c to the string if the strings last character does not equal c.
References Str::size().
Referenced by Str::provideSlash().
Str providedLast | ( | char | c | ) | const |
Returns the string with c added if the strings last character does not equal c.
References Str::size().
Referenced by Str::providedSlash().
Str & provideLast | ( | const char * | s | ) |
Add s to the string if the strings last characters do not equal s.
References Str::size().
Str providedLast | ( | const char * | s | ) | const |
Returns the string with s added if the strings last characters do not equal s.
References Str::size().
Str & provideLast | ( | const string & | s | ) |
Add s to the string if the strings last characters do not equal s.
References Str::size().
Str providedLast | ( | const string & | s | ) | const |
Returns the string with s added if the strings last characters do not equal s.
References Str::size().
Str & upper | ( | void | ) |
Str up | ( | void | ) | const |
References Str::append().
Referenced by Parameter::save().
Str & lower | ( | void | ) |
Referenced by Str::find(), and Str::rfind().
Str low | ( | void | ) | const |
References Str::append().
Str & leftJustify | ( | int | width = Width , |
char | pad = Pad |
||
) |
justify:
References Str::size(), and Str::strip().
|
inline |
Str & rightJustify | ( | int | width = Width , |
char | pad = Pad |
||
) |
References Str::size(), and Str::strip().
|
inline |
Str & centerJustify | ( | int | width = Width , |
char | pad = Pad |
||
) |
References Str::size(), and Str::strip().
Str centerJustified | ( | int | width = Width , |
char | pad = Pad |
||
) | const |
References Str::stripped().
Str & goldenJustify | ( | int | width = Width , |
char | pad = Pad |
||
) |
References Str::size(), and Str::strip().
Str goldenJustified | ( | int | width = Width , |
char | pad = Pad |
||
) | const |
References Str::stripped().
|
inlinestatic |
Referenced by Str::range(), Str::simplified(), and Str::simplify().
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
bool empty | ( | const string & | space = Space , |
const string & | comment = Comment |
||
) | const |
References Str::find(), and Str::findFirstNot().
Referenced by Options::addBoolean(), Options::addDate(), Parameter::addDefaultNumber(), Options::addFlags(), Options::addInteger(), Parameter::addNumber(), Options::addNumber(), Options::addStyle(), Options::addText(), Options::addTime(), Options::allText(), Options::assign(), Parameter::assign(), Options::boolean(), Options::booleans(), Options::changed(), Options::changeUnit(), Parameter::clear(), Options::clearFlags(), Options::date(), Options::defaultBoolean(), Options::defaultDate(), Options::defaultInteger(), Options::defaultNumber(), Parameter::defaultText(), Options::defaultText(), Options::defaultTime(), Options::delFlags(), Options::delStyle(), Parameter::empty(), Options::error(), Options::errors(), Str::expandedHome(), Str::expandHome(), Options::flags(), Options::format(), Options::formatWidth(), Str::homePath(), Options::index(), Options::insertBoolean(), Options::insertDate(), Options::insertInteger(), Options::insertNumber(), Options::insertText(), Options::insertTime(), Options::integer(), Options::integers(), Options::load(), Options::maximum(), Options::minimum(), Options::newSection(), Options::number(), Options::numbers(), Options::outUnit(), Parameter::Parameter(), Str::providedSlash(), Str::provideSlash(), Options::pushInteger(), Options::pushNumber(), Options::pushText(), ConfigureClasses::read(), Options::read(), Options::readAppend(), Options::request(), Options::selectText(), Options::setBoolean(), Options::setCurrentDate(), Options::setCurrentTime(), Options::setDate(), Options::setDefault(), Options::setDefaultBoolean(), Options::setDefaultDate(), Options::setDefaultInteger(), Options::setDefaultNumber(), Options::setDefaultText(), Options::setDefaultTime(), Options::setFlags(), Options::setFormat(), Options::setInteger(), Options::setMinMax(), Options::setNumber(), Options::setOutUnit(), Options::setRequest(), Options::setStep(), Options::setStyle(), Options::setText(), Options::setTime(), Options::setToDefault(), Options::setUnit(), Options::setValueType(), Options::size(), Options::step(), Str::stripWorkingPath(), Options::style(), Parameter::text(), Options::text(), Options::texts(), Options::time(), Options::unit(), and Options::valueType().
Str & strip | ( | const string & | space = Space , |
const string & | comment = Comment |
||
) |
References Str::size().
Referenced by Str::centerJustify(), Str::goldenJustify(), Str::leftJustify(), Options::load(), Parameter::Parameter(), ConfigureClasses::read(), Options::read(), Str::rightJustify(), Parameter::saveXML(), and Str::simplify().
Str & strip | ( | char | space, |
const string & | comment = Comment |
||
) |
References Str::size().
Str stripped | ( | const string & | space = Space , |
const string & | comment = Comment |
||
) | const |
References Str::size().
Referenced by Str::centerJustified(), Str::goldenJustified(), and Str::simplified().
Str stripped | ( | char | space, |
const string & | comment = Comment |
||
) | const |
References Str::size().
Str & simplify | ( | const string & | space = Space , |
const string & | comment = Comment |
||
) |
References Str::size(), and Str::strip().
Str & simplify | ( | char | space, |
const string & | comment = Comment |
||
) |
References Str::size(), Str::space(), and Str::strip().
Str simplified | ( | const string & | space = Space , |
const string & | comment = Comment |
||
) | const |
References Str::resize(), Str::size(), and Str::stripped().
Str simplified | ( | char | space, |
const string & | comment = Comment |
||
) | const |
References Str::resize(), Str::size(), Str::space(), and Str::stripped().
Str & stripComment | ( | const string & | comment = Comment | ) |
Removes comments from the string. If comment is set to 'XXX' everything behind 'XXX' inclusively is erased from the string. If comment is set to '-XXX' everything before 'XXX' inclusively is erased from the string.
Referenced by Options::load(), and Options::read().
Str strippedComment | ( | const string & | comment = Comment | ) | const |
Returns the string with comments removed. If comment is set to 'XXX' everything behind 'XXX' inclusively is erased from the string. If comment is set to '-XXX' everything before 'XXX' inclusively is erased from the string.
References Str::substr().
|
inline |
Referenced by Str::ident().
int nextWord | ( | int & | index, |
const string & | space = Space , |
||
const string & | comment = Comment |
||
) | const |
Returns the index of the next word following position index. In index the position of the first character following the word is returned. Words are separated by arbitrary many characters specified in space.
References Str::find(), Str::findFirst(), Str::findFirstNot(), and Str::size().
Referenced by Str::word(), Str::wordAt(), and Str::words().
Str wordAt | ( | int & | index, |
const string & | space = Space , |
||
const string & | comment = Comment |
||
) | const |
Returns the word following position index. In index the position of the first character following the word is returned. Words are separated by arbitrary many characters specified in space.
References Str::mid(), and Str::nextWord().
Str word | ( | int | n, |
const string & | space = Space , |
||
const string & | comment = Comment |
||
) | const |
References Str::nextWord(), and Str::substr().
Referenced by Str::ident().
int words | ( | const string & | space = Space , |
const string & | comment = Comment |
||
) | const |
Returns the number of words contained in the string separated by space before a comment comment.
References Str::nextWord().
int nextField | ( | int & | index, |
const string & | space = Space , |
||
const string & | comment = Comment |
||
) | const |
Returns the index of the next field following position index. In index the position of the first character of the following field is returned. Fields are separated by single characters specified in space.
References Str::find(), Str::findFirst(), and Str::size().
Referenced by StrQueue::append().
|
inlinestatic |
|
inlinestatic |
int findSeparator | ( | int | index = 0 , |
const string & | separator = Separator , |
||
const string & | brackets = Bracket , |
||
const string & | comment = Comment |
||
) | const |
Find first separator following position index.
References Str::findBracket(), Str::findFirst(), Str::findFirstNot(), and Str::size().
Referenced by StrQueue::append(), Str::field(), Options::load(), and Options::read().
Str field | ( | int | n, |
const string & | separator = Separator , |
||
const string & | brackets = Bracket , |
||
const string & | comment = Comment |
||
) | const |
References Str::find(), Str::findSeparator(), Str::size(), and Str::substr().
|
inlinestatic |
The character which is used to separate directories in a file name. By default it is a slash '/'.
|
inlinestatic |
Set the character which is used to separate directories in a file name to dirsep.
|
inlinestatic |
The character which is used to separate the extension of a file name. By default it is a period.
|
inlinestatic |
Set the character which is used to separate the extension of a file name to extsep.
|
inlinestatic |
The character which specifies the home directoy of a file name. By default it is a tilde.
|
inlinestatic |
Set the character which specifies the home directory of a file name to homechr.
|
inlinestatic |
The environment variable which specifies the home directoy. By default it is "HOME".
|
inlinestatic |
Set the name of the environment variable which specifies the home directory to homeenv.
|
static |
The home directory with a slash(dirsep) at the end. It is the path specified by the environment variable specified by HomeEnv. If this environment variable does not exist, dirsep (a slash) is returned.
References Str::empty(), Str::getEnvironment(), and Str::provideSlash().
|
inlinestatic |
The environment variable which specifies the current working directoy. By default it is "PWD".
|
inlinestatic |
Set the name of the environment variable which specifies the current working directory to home.
|
static |
The current working directory with a slash(dirsep) at the end. It is the path specified by the environment variable specified by WorkingEnv. If this environment variable does not exist, an empty string is returned.
References Str::getEnvironment(), and Str::provideSlash().
Referenced by Str::addedWorking(), Str::addWorking(), and Str::stripWorkingPath().
Str & stripWorkingPath | ( | int | maxlevel = 10 , |
char | dirsep = DirSep |
||
) |
If the string contains an absolute path (beginning with dirsep) then convert the path to a path relative to the current working directory. Only do this for at maximum maxlevel levels below the current working directory.
References Str::empty(), Str::erase(), Str::find(), Str::rfind(), Str::size(), and Str::workingPath().
Str dir | ( | char | dirsep = DirSep | ) | const |
Returns the directory part of a file name. This is everything upto and including the last character dirsep (defaults to a slash) found in the string. If no dirsep is found, an empty string is returned. For example: If the string is example/data.txt.gz
, example/
is returned.
Referenced by Str::addedWorking(), Str::addWorking(), Parameter::defaultText(), and Parameter::text().
Str notdir | ( | char | dirsep = DirSep | ) | const |
Returns everything except the directory part of a file name. This is everything behind the last character dirsep (defaults to a slash) found in the string. If no dirsep is found, the whole string is returned. For example: If the string is example/data.txt.gz
, data.txt.gz
is returned.
Referenced by Parameter::defaultText(), and Parameter::text().
Str name | ( | char | dirsep = DirSep , |
char | extsep = ExtSep |
||
) | const |
Returns everything except the directory part and all extensions of a file name. This is everything behind the last character dirsep (defaults to a slash) found in the string and before the following first character extsep (defaults to a period). For example: If the string is example/data.txt.gz
, data
is returned.
Referenced by Parameter::defaultText(), Options::nameWidth(), and Parameter::text().
Str longName | ( | char | dirsep = DirSep , |
char | extsep = ExtSep |
||
) | const |
Returns everything except the directory part and the last extension of a file name. This is everything behind the last character dirsep (defaults to a slash) found in the string and before the last character extsep (defaults to a period). For example: If the string is example/data.txt.gz
, data.txt
is returned.
Str extension | ( | char | dirsep = DirSep , |
char | extsep = ExtSep |
||
) | const |
Returns all extensions of a file name including their period. For example: If the string is example/data.txt.gz
, .txt.gz is returned.
Referenced by Str::addedExtension(), Parameter::defaultText(), Str::providedExtension(), Str::provideExtension(), and Parameter::text().
Str suffix | ( | char | dirsep = DirSep , |
char | extsep = ExtSep |
||
) | const |
Returns the last extension of a file name including its period. For example: If the string is example/data.txt.gz
, .gz is returned.
Str basename | ( | char | dirsep = DirSep , |
char | extsep = ExtSep |
||
) | const |
Returns everything exept of all extensions of a file name. For example: If the string is example/data.txt.gz
, example/data
is returned.
Str & stripDir | ( | char | dirsep = DirSep | ) |
Remove the directory part of a file name. This is everything upto and including the last character dirsep (defaults to a slash) found in the string. If no dirsep is found, nothing is done. For example: If the string is example/data.txt.gz
, data.txt.gz
remains.
Str & stripNotdir | ( | char | dirsep = DirSep | ) |
Removes everything except the directory part of a file name. This is everything behind the last character dirsep (defaults to a slash) found in the string. If no dirsep is found, the string is cleared. For example: If the string is example/data.txt.gz
, example/
remains.
Referenced by Str::expandedHome(), and Str::expandHome().
Str & stripExtension | ( | char | dirsep = DirSep , |
char | extsep = ExtSep |
||
) |
Remove all extensions of a file name including their period. For example: If the string is example/data.txt.gz
, example/data
remains.
Str & stripSuffix | ( | char | dirsep = DirSep , |
char | extsep = ExtSep |
||
) |
Remove the last extension of a file name including its period. For example: If the string is example/data.txt.gz
, example/data.txt
remains.
Str & stripBasename | ( | char | dirsep = DirSep , |
char | extsep = ExtSep |
||
) |
Removes everything exept of all extensions of a file name. For example: If the string is example/data.txt.gz
, .txt.gz remains.
|
inline |
Remove the last character of the string if it equals dirsep (defaults to a slash).
Referenced by Str::expandedHome(), and Str::expandHome().
|
inline |
Returns the string with its last character removed if it equals dirsep (defaults to a slash).
Str & provideSlash | ( | char | dirsep = DirSep | ) |
Add dirsep to the string if its last character does not equal dirsep (defaults to a slash) and the string is not empty.
References Str::empty(), and Str::provideLast().
Referenced by Str::addedWorking(), Str::addWorking(), Str::homePath(), and Str::workingPath().
Str providedSlash | ( | char | dirsep = DirSep | ) | const |
Returns the string with dirsep added if its last character does not equal dirsep (defaults to a slash) and the string is not empty.
References Str::empty(), and Str::providedLast().
|
inline |
Remove the last character of the string if it equals extsep (defaults to a period).
|
inline |
Returns the string with its last character removed if it equals extsep (defaults to a period).
|
inline |
Add extsep to the string if its last character does not equal extsep (defaults to a period).
Referenced by Str::addExtension().
|
inline |
Returns the string with extsep added if its last character does not equal extsep (defaults to a period).
Referenced by Str::addedExtension().
Str & expandHome | ( | char | dirsep = DirSep , |
char | homechr = HomeChr |
||
) |
Expands a leading homechr (defaults to a tilde) to the home directoy which is obtained from the environment variable HOME. The default for homechr can be changed by setHomeChr(), the name of the environment variable used to get the home directory can be changed by setHome().
References Str::empty(), Str::getEnvironment(), Str::preventSlash(), Str::size(), and Str::stripNotdir().
Referenced by Str::expandPath().
Str expandedHome | ( | char | dirsep = DirSep , |
char | homechr = HomeChr |
||
) | const |
Returns the string with a leading homechr (defaults to a tilde) expanded to the home directoy which is obtained from the environment variable HOME. The default for homechr can be changed by setHomeChr(), the name of the environment variable used to get the home directory can be changed by setHome().
References Str::empty(), Str::getEnvironment(), Str::preventSlash(), Str::size(), and Str::stripNotdir().
Referenced by Str::expandedPath().
Str & removeWorking | ( | char | dirsep = DirSep | ) |
Remove all '.' directories from the string.
References Str::size().
Referenced by Str::expandedPath(), and Str::expandPath().
Str removedWorking | ( | char | dirsep = DirSep | ) | const |
Return the string with all '.' directories removed.
References Str::size().
Str & addWorking | ( | const string & | dir = "" , |
char | dirsep = DirSep |
||
) |
Prepends the directory dir to the string if it does not begin with a slash (dirsep). It is ensured that between the current content of the Str and dir there is slash (dirsep). If dir is not specified, then the current working directory is obtained from the environment variable specified by setWorkingEnv(), which defaults to PWD.
References Str::dir(), Str::provideSlash(), Str::size(), and Str::workingPath().
Referenced by Str::expandedPath(), and Str::expandPath().
Str addedWorking | ( | const string & | dir = "" , |
char | dirsep = DirSep |
||
) | const |
Return the string with the directory dir prepended if it does not begin with a slash (dirsep). It is ensured that between the current content of the Str and dir there is slash (dirsep). If dir is not specified, then the current working directory is obtained from the environment variable specified by setWorkingEnv(), which defaults to PWD.
References Str::append(), Str::dir(), Str::provideSlash(), Str::size(), and Str::workingPath().
Str & expandParent | ( | char | dirsep = DirSep | ) |
Expand all '..' directories in the string.
References Str::resize(), and Str::size().
Referenced by Str::expandedPath(), and Str::expandPath().
Str expandedParent | ( | char | dirsep = DirSep | ) | const |
Return the string with all '..' directories expanded.
References Str::size().
Str & expandPath | ( | const string & | dir = "" , |
char | dirsep = DirSep , |
||
char | homechr = HomeChr |
||
) |
Expands the string to a complete file name. All special characters (~, ./, and /..) are processed. First a leading tilde (homechr) is expanded to the current home directory (see expandHome() for details. Then all references to the current directory ("./") are removed from the string (see removeWorking() for details). If the string does not begin with a slash (dirsep) dir is prepended to the string. If dir is empty, the current working directory is used (see addWorking() for details). Finally all "/.." are expanded (see expandParent() for details.
References Str::addWorking(), Str::expandHome(), Str::expandParent(), and Str::removeWorking().
Str expandedPath | ( | const string & | dir = "" , |
char | dirsep = DirSep , |
||
char | homechr = HomeChr |
||
) | const |
Returns the string expanded to a complete file name. All special characters (~, ./, and /..) are processed. First a leading tilde (homechr) is expanded to the current home directory (see expandHome() for details. Then all references to the current directory ("./") are removed from the string (see removeWorking() for details). If the string does not begin with a slash (dirsep) dir is prepended to the string. If dir is empty, the current working directory is used (see addWorking() for details). Finally all "/.." are expanded (see expandParent() for details.
References Str::addWorking(), Str::expandedHome(), Str::expandParent(), and Str::removeWorking().
Str & addExtension | ( | const string & | extension, |
char | extsep = ExtSep |
||
) |
Add the extension extension to the string. A period (extsep) is inserted if necessary.
References Str::providePeriod().
Referenced by Str::provideExtension().
Str addedExtension | ( | const string & | extension, |
char | extsep = ExtSep |
||
) | const |
Return the string with the extension extension added. A period (extsep) is inserted if necessary.
References Str::extension(), Str::providedPeriod(), and Str::substr().
Referenced by Str::providedExtension().
Str & provideExtension | ( | const string & | extension, |
char | dirsep = DirSep , |
||
char | extsep = ExtSep |
||
) |
Add the extension extension to the string provided there is no extension. A period (extsep) is inserted if necessary.
References Str::addExtension(), Str::extension(), and Str::size().
Str providedExtension | ( | const string & | extension, |
char | dirsep = DirSep , |
||
char | extsep = ExtSep |
||
) | const |
Return the string with the extension extension added provided there is no extension. A period (extsep) is inserted if necessary.
References Str::addedExtension(), Str::extension(), and Str::size().
|
static |
Returns the content of the environment variable specified by env. If the environment variable env does not exist, an empty string is returned.
References Str::Str().
Referenced by Str::expandedHome(), Str::expandHome(), Str::homePath(), and Str::workingPath().
Str & environment | ( | const string & | env | ) |
Set the string to the content of the environment variable specified by env. If the environment variable env does not exist, the string is emptied.
Str latex | ( | void | ) | const |
References Str::append().
Str latexNum | ( | void | ) | const |
References Str::append().
Str latexUnit | ( | void | ) | const |
References Str::append().
Str html | ( | void | ) | const |
References Str::append().
Str htmlUnit | ( | void | ) | const |
References Str::append().
|
inlinestatic |
Referenced by Str::readFormat(), and Str::totalWidth().
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
Referenced by Str::readFormat().
|
inlinestatic |
|
static |
Referenced by Options::setDefaults().
|
static |
Referenced by Options::load(), Parameter::Parameter(), and Options::read().
|
static |
Referenced by Parameter::addDefaultNumber(), and Parameter::assign().
|
static |
Referenced by Str::range().
|
static |
|
static |
|
static |
|
static |
Referenced by Str::number(), and Str::unit().
|
static |
|
static |
Referenced by Parameter::assign(), Str::error(), Str::number(), and Str::unit().
|
static |
Referenced by Str::findBracket(), Str::number(), and Str::unit().
|
static |
Referenced by Str::findBracket(), Str::number(), and Str::unit().