Construction and Initialisation
EST_Token()
EST_Token ( const EST_String p) init()
void init ( )
class | EST_Token |
This class is similar to EST_String but also maintains the original punctuation and whitespace found around the token.
EST_Token's primary use is with EST_TokenStream class which allows easy tokenizing of ascii files.
A token consists of four parts, any of which may be empty: a name, the actual token, preceding whitespace, preceding punctuation, the name and succeeding punctuation.
EST_Token()
EST_Token ( const EST_String p) init()
void init ( )
set_token()
void set_token ( const char *p) set_whitespace()
void set_whitespace ( const char *p) set_punctuation()
void set_punctuation ( const char *p) set_prepunctuation()
void set_prepunctuation ( const char *p) whitespace()
const EST_String& whitespace ( ) punctuation()
const EST_String& punctuation ( ) prepunctuation()
const EST_String& prepunctuation ( )
pos_description()
const EST_String pos_description ( ) const A string describing current position, suitable for error messages
operator = ()
EST_Token& operator = ( const EST_Token &a) operator = ()
EST_Token& operator = ( const EST_String &a) operator == ()
int operator == ( const EST_String &a) operator != ()
int operator != ( const EST_String &a) operator == ()
int operator == ( const char *a) operator != ()
int operator != ( const char *a)
StringtoStrList()
void StringtoStrList ( EST_String s, EST_StrList &l, EST_String sep="") Convert a EST_String to a EST_StrList by separating tokens in s delimited by the separator sep. By default, the string is assumed to be delimited by whitespace.
BracketStringtoStrList()
void BracketStringtoStrList ( EST_String s, EST_StrList &l, EST_String sep="") Convert a EST_String enclosed in a single set of brackets to a EST_StrList by separating tokens in s delimited by the separator sep. By default, the string is assumed to be delimited by whitespace.
load_StrList()
EST_read_status load_StrList ( EST_String filename, EST_StrList &l) Load tokens from a file and return them in a EST_StrList
save_StrList()
EST_write_status save_StrList ( EST_String filename, EST_StrList &l, EST_String style="words") Save tokens from a EST_StrList. If style is set to "lines" each item is stored on a separate line, otherwise each item is separated by a single space
strip_quotes()
void strip_quotes ( EST_String &s, const EST_String quote_char="\"") remove quotes from a string
ftoString()
EST_String ftoString ( float n, int pres=3, int width=0, int l=0) Make a EST_String object from an float, with variable precision
Stringtoi()
int Stringtoi ( EST_String s) Make an int from a EST_String. EST_String equivalent of atoi()
StrListtoIList()
int StrListtoIList ( EST_StrList &s, EST_IList &il) Convert a list of strings to a list of integers
StrListtoFList()
int StrListtoFList ( EST_StrList &s, EST_FList &il) Convert a list of strings to a list of floats
StrList_to_StrVector()
void StrList_to_StrVector ( EST_StrList &l, EST_StrVector &v) Convert a list of strings to a vector of strings
StrVector_to_StrList()
void StrVector_to_StrList ( EST_StrVector &v, EST_StrList &l) Convert a vector of strings to a list of strings
StrVector_index()
int StrVector_index ( const EST_StrVector &v, const EST_String &s) Search the vector and return the position of the first occurance of string s in the vector
strlist_member()
int strlist_member ( const EST_StrList &l, const EST_String &s) Return true ifs is in list ls
strlist_index()
int strlist_index ( const EST_StrList &l, const EST_String &s) Search the vector and return the position of the first occurance of string s in the list
basename()
EST_String basename ( EST_String full, EST_String ext="") This acts like the bourne shell basename command. By default, it strips any leading path from a string. If ext is defined, it strips any suffix matching this string
- Table of Contents
- make_tmp_filename()
- stdin_to_file()
- writable_file()
- readable_file()
- delete_file()
- uncompress_file_to_temporary()
- compress_file_in_place()
- compress_file()
delete_file()
inline int delete_file ( const EST_String &filename) OS independent way of removing a file
uncompress_file_to_temporary()
EST_String uncompress_file_to_temporary ( const EST_String &filename, const EST_String &prog_name) Uncompress file by calling program prog, and write it to new tempoary file. Return name of temporary file
compress_file_in_place()
int compress_file_in_place ( const EST_String &filename, const EST_String &prog_name) Uncompress file and over-write existing file with uncompressed version
compress_file()
int compress_file ( const EST_String &filename, const EST_String &new_filename, const EST_String &prog_name) compress file by calling program prog, writing result to new_filename