47#include "EST_String.h"
48#include "EST_Pathname.h"
49#include "EST_string_aux.h"
50#include "EST_cutils.h"
53int StrListtoFList(EST_StrList &s, EST_FList &f)
57 for (p = s.head(); p; p = p->next())
58 if (!s(p).matches(RXdouble))
61 "Expecting a floating point value in StrListtoFlist(): got "
71int StrListtoIList(EST_StrList &s, EST_IList &il)
75 for (p = s.head(); p; p = p->next())
76 if (!s(p).matches(RXint))
79 "Expecting a integer value in StrListtoIList(): got "
95 StringtoStrList(s, l, sep);
122 for (EST_Litem *p = l.head(); p; p = p->next())
126EST_read_status load_StrList(
EST_String filename, EST_StrList &l)
131 if(ts.
open(filename) != 0){
132 cerr <<
"Can't open EST_StrList file " << filename << endl;
133 return misc_read_error;
146EST_write_status save_StrList(
EST_String filename, EST_StrList &l,
154 outf =
new ofstream(filename);
159 if (style ==
"words")
161 for (p = l.head(); p; p = p->next())
170 else if (style ==
"lines")
171 for (p = l.head(); p; p = p->next())
172 *outf << l(p) << endl;
175 cerr <<
"Unknown style for writing StrLists: " << style << endl;
176 return misc_write_error;
184int strlist_member(
const EST_StrList &l,
const EST_String &s)
187 for (p = l.head(); p != 0; p = p->next())
194int strlist_index(
const EST_StrList &l,
const EST_String &s)
198 for (p = l.head(); p != 0; p = p->next())
208void StrList_to_StrVector(EST_StrList &l, EST_StrVector &v)
217 for (p = l.head(),i=0; p != 0; p = p->next(),i++)
222void StrVector_to_StrList(EST_StrVector &v, EST_StrList &l)
226 for (i=0;i<v.
length();i++)
231int StrVector_index(
const EST_StrVector &v,
const EST_String &s)
int gsub(const char *os, const EST_String &s)
Substitute one string for another.
T & item(const EST_Litem *p)
void clear(void)
remove all items in list
void append(const T &item)
add item onto end of list
void resize(int n, int set=1)
INLINE int length() const
number of items in vector.
void set_SingleCharSymbols(const EST_String &sc)
set which characters are to be treated as single character symbols
int open_string(const EST_String &newbuffer)
open a \Ref{EST_TokenStream} for string rather than a file
void set_PunctuationSymbols(const EST_String &ps)
set which characters are to be treated as (post) punctuation
void close(void)
Close stream.
int open(const EST_String &filename)
open a \Ref{EST_TokenStream} for a file.
void set_WhiteSpaceChars(const EST_String &ws)
set which characters are to be treated as whitespace
EST_TokenStream & get(EST_Token &t)
get next token in stream