emergent 8.2.2 taString Class Reference
emergent 8.2.2   Home · Wiki Docs For: taString · Emergent Help Browser 

taString Class Reference

string of characters with many useful methods for string manipulation

See for more info: Wiki Docs For: taString

 #include <taString>

defined at: /mnt/ssd/grey/local/include/Emergent/taString.h :138-611

Inherited By: taString*, taString&, const taString

Index: SubTypes, Members, Methods, Static Members, Static Methods, Expert Members, Expert Methods

Sub Types


Regular (preferred) Member and Method Documentation

Members

Methods

Method Category: Access

Method Category: Convert

Method Category: Find

Method Category: Modify

Method Category: _NoCategory


Method Documentation

Method Category: Access

bool taString::HasUpper ( )

true if any character is uppercase

Show Source Code

taString taString::after ( taString& x, int startpos = 0 )

get substring after (not including) target string. startpos = starting position (- = search from end forward)

Show Source Code

taString taString::at ( int pos, int len )

get substring at position for length

Show Source Code

taString taString::before ( taString& x, int startpos = 0 )

get substring before (not including) target string. startpos = starting position (- = search from end forward)

Show Source Code

taString taString::between ( taString& st_str, taString& ed_str, int startpos = 0 )

get substring between (not including) target strings. startpos = starting position (- = search from end forward)

Show Source Code

char taString::elem ( int i )

get the character at index i

Show Source Code

bool taString::empty ( )

true if the string is empty

Show Source Code

char taString::firstchar ( )

get the first character, '

Show Source Code

taString taString::from ( taString& x, int startpos = 0 )

get substring from (including) target string. startpos = starting position (- = search from end forward)

Show Source Code

char taString::lastchar ( )

get the last character; '

Show Source Code

taString taString::left ( int len )

get leftmost len chars

Show Source Code

int taString::length ( )

how many characters in the string

Show Source Code

bool taString::nonempty ( )

true if the string is nonempty

Show Source Code

taString taString::right ( int len )

get rightmost len chars

Show Source Code

String_Array* taString::split ( taString& delim = )

return a string array with the sub-strings split by given delimeter (excludes delimiter in sub strings)

Show Source Code

taString taString::through ( taString& x, int startpos = 0 )

get substring through (including) target string. startpos = starting position (- = search from end forward)

Show Source Code

String_Array* taString::to_array ( )

return a string array, with one character of this string in each element of array -- useful for using foreach iterator

Show Source Code

Method Category: Convert

int taString::HexToInt ( )

hexidecimal string to integer value

Show Source Code

bool taString::isBool ( )

true if the string contains a value that can be interpreted as a bool -- accepts ONLY true, false, to distinguish from ints -- call trim first to remove spaces, as this does not accept spaces

Show Source Code

bool taString::isFloat ( )

true if the string contains a value that can be interpreted as a floating-point number [+-]d*[.d*|[+-]ed*] -- also accepts ints so check isInt first to discriminate -- does not distinguish between float and double -- just any kind of floating point number -- call trim first to remove spaces, as this does not accept spaces

Show Source Code

bool taString::isHex ( )

true if the string contains a value that can be interpreted as a hexidecimal integer number [+-]0xd* -- call trim first to remove spaces, as this does not accept spaces

Show Source Code

bool taString::isInt ( )

true if the string contains a value that can be interpreted as an integer [+-]dd* -- does NOT accept hexidecimal numbers (see isHex) -- does not accept decimal points, so check this first before isFloat -- call trim first to remove spaces, as this does not accept spaces

Show Source Code

bool taString::isQuoted ( )

true if the string begins and ends with quotes

Show Source Code

bool taString::toBool ( )

accepts true as starting with t/T, or else 1

Show Source Code

char taString::toChar ( )

if size 1, then that's it, else try heuristics

Show Source Code

double taString::toDouble ( bool* ok = 0 )

to floating point (double precision) value

Show Source Code

float taString::toFloat ( bool* ok = 0 )

to floating point (single precision) value

Show Source Code

int taString::toInt ( bool* ok = 0, int base = 10 )

to integer value -- base determines base representation (hex=16, oct=8)

Show Source Code

Method Category: Find

bool taString::contains ( taString& y, int startpos = 0 )

return 'true' if target appears anywhere in String. startpos = starting position (- = search from end forward)

Show Source Code

bool taString::contains_ci ( taString& y, int startpos = 0 )

ci = case independent: return 'true' if target appears anywhere in String. startpos = starting position (- = search from end forward)

Show Source Code

bool taString::endsWith ( taString& y )

return 'true' if target is at end of String

Show Source Code

int taString::freq ( taString& y )

return number of occurences of target in String

Show Source Code

int taString::index ( taString& y, int startpos = 0 )

return position of target in string or -1 for failure. startpos = starting position (- = search from end forward)

Show Source Code

int taString::index_ci ( taString& y, int startpos = 0 )

ci = case independent: return position of target in string or -1 for failure. startpos = starting position (- = search from end forward)

Show Source Code

bool taString::matches ( taString& y, int pos = 0 )

return 'true' if target appears at position pos in String

Show Source Code

bool taString::matches_regexp ( taString& regexp )

return 'true' if target regular expression string matches this string -- . matches any single character, .* matches a string of characters, [...] matches any set of characters within the brackets, c{1,5} matches 1-5 repeats of given character, ^ anchors to start of string, $ to end, \d = digit, \D = non-digit, \s = whitespace, \S = non-whitespace, \w = word (letter or number) \W = not

Show Source Code

bool taString::matches_wildcard ( taString& wild )

return 'true' if target wildcard string matches this string -- ? matches any single character, * matches a string of characters, and [...] matches any set of characters within the brackets

Show Source Code

Method Category: Modify

taString& taString::capitalize ( )

capitalize the first letter of each word of this string (NOTE: modifies this string, and also returns the resulting string value)

Show Source Code

taString& taString::cat ( taString& y )

concatenate (add) string to end of this one

Show Source Code

void taString::del ( int pos, int len )

delete len chars starting at pos

Show Source Code

taString& taString::downcase ( )

convert all letters to lower case of this string (NOTE: modifies this string, and also returns the resulting string value)

Show Source Code

taString taString::elidedTo ( int len = -1 )

return a string no more than len long, no line breaks, eliding chars if needed and adding ... marks; -1 is no eliding

Show Source Code

taString taString::elidedToFirstLine ( )

if has newlines, elide to first line

Show Source Code

int taString::gsub ( taString& pat, taString& repl )

global substitution: substitute all occurrences of pat with repl

Show Source Code

taString& taString::prepend ( taString& y )

insert string at beginning of this one

Show Source Code

taString& taString::quote_esc ( )

quote escape, replacing double quotes ' and back-slashes with their safely quoted forms (just adds a backslash) -- makes the string safe to print or save (NOTE: modifies this string, and also returns the resulting string value)

Show Source Code

taString& taString::quote_unesc ( )

quote un-escape, replacing escaped double quotes ' and back-slashes with their original forms (just removes a backslash) (NOTE: modifies this string, and also returns the resulting string value)

Show Source Code

void taString::remove ( taString& y, int startpos = 0 )

remove target string from string. startpos = starting position (- = search from end forward)

Show Source Code

taString& taString::repl ( taString& pat, taString& repl )

global substitution: substitute all occurrences of pat with repl and return the modified string

Show Source Code

taString& taString::reverse ( )

reverse order of this string (NOTE: modifies this string, and also returns the resulting string value)

Show Source Code

taString& taString::trim ( )

trims leading and trailing spaces (NOTE: modifies this string, and also returns the resulting string value)

Show Source Code

taString& taString::triml ( )

trims leading spaces (NOTE: modifies this string, and also returns the resulting string value)

Show Source Code

taString& taString::trimr ( )

trims trailing spaces (NOTE: modifies this string, and also returns the resulting string value)

Show Source Code

void taString::truncate ( uint new_len )

shortens the string to new_len (if less than curr)

Show Source Code

taString& taString::upcase ( )

convert all letters to upper case of this string (NOTE: modifies this string, and also returns the resulting string value)

Show Source Code

taString taString::wrap ( int max_width )

add newlines every max_width chars

Show Source Code

taString& taString::xml_esc ( )

xml escape, ex & to &amp; of this string (NOTE: modifies this string, and also returns the resulting string value)

Show Source Code

taString& taString::xml_unesc ( )

xml un-escape -- undoes xml_exc (NOTE: modifies this string, and also returns the resulting string value)

Show Source Code

Method Category: _NoCategory

taString taString::CamelToSnake ( )

e.g. StdInputData to std_input_data

Show Source Code

taString taString::FileToCamel ( )

Show Source Code

int taString::FindMatchingParens ( int parens_pos )

Find the parenthesis that balances the one in the specified location

Show Source Code

bool taString::LoadFromFile ( taString& fname )

load contents of given file into string

Show Source Code

bool taString::Load_str ( istream& istrm, int alloc_size = 0 )

load contents from a stream -- optionally allocate string memory of given size if known in advance -- can greatly speed up loading times

Show Source Code

bool taString::SaveToFile ( taString& fname )

save contents of string to given file name

Show Source Code

bool taString::Save_str ( ostream& ostrm )

save contents to a stream

Show Source Code

taString& taString::convertDouble ( double i, char* format = %lg )

convert double value into string using given format (standard printf formatting)

Show Source Code

taString& taString::convertFloat ( float i, char* format = %g )

convert float value into string using given format (standard printf formatting)

Show Source Code

taString& taString::convertInt ( int i, char* format = %d )

convert int value into string using given format (standard printf formatting)

Show Source Code

taString taString::removeSpaces ( )

returns a copy of this string with all whitespaces and underscores removed

Show Source Code

bool taString::startsWith ( taString& y )

Show Source Code

bool taString::startsWithCI ( taString& y )

case insensitive

Show Source Code

taString taString::toCamel ( )

e.g. std_input_data to StdInputData (also removes any whitespace)

Show Source Code

Static Member and Method Documentation

Static Members

Static Methods


Static Method Documentation


Expert Member and Method Documentation

Expert Members

Expert Methods


Expert Method Documentation


Copyright © 2017Regents of the University of Colorado, Carnegie Mellon University, Princeton University.
emergent 8.2.2