32 #ifndef TextStream_INCLUDE_ONCE 33 #define TextStream_INCLUDE_ONCE 64 for(
size_t i=utf8.size(); i--;)
70 if ( !inputFile()->isOpen() )
76 while( readToken(&ch) )
79 if ( ch ==
'\r' || ch ==
'\n' )
82 if ( ch !=
'\r' && ch !=
'\n' )
96 std::vector<unsigned char> utf8;
98 if ( !inputFile()->isOpen() )
102 unsigned char ch = 0;
104 while( readToken(&ch) )
107 if ( ch ==
'\r' || ch ==
'\n' )
110 if ( ch !=
'\r' && ch !=
'\n' )
126 std::vector<unsigned char> utf8;
128 if ( !inputFile()->isOpen() )
132 unsigned char ch = 0;
133 while( readToken(&ch) )
142 return !line.
empty();
149 std::vector<unsigned char> utf8;
151 if ( !inputFile()->isOpen() )
155 unsigned char ch = 0;
156 while( readToken(&ch) )
165 return !line.
empty();
168 bool readInt(
int& i,
bool hex=
false);
170 bool readDouble(
double& d);
175 unsigned char ch = 0;
176 while ( readToken(&ch) )
178 if ( ch ==
'\r' || ch ==
'\n' || ch ==
'\t' || ch ==
' ' )
188 return !token.
empty();
194 unsigned char ch = 0;
195 while ( readToken(&ch) )
197 if ( ch ==
'\r' || ch ==
'\n' || ch ==
'\t' || ch ==
' ' )
207 return !token.empty();
214 unsigned char ch = 0;
215 while ( readToken(&ch) )
218 if ( ch ==
'\r' || ch ==
'\n' || (!open && ( ch ==
'\t' || ch ==
' ')) )
228 if (ch ==
'\"' || ch ==
'\'')
231 return !token.
empty();
An abstract class representing a file.
bool readLine(std::string &utf8)
static String fromUTF8(const char *str, int byte_count=-1)
Accepts strings with and without UTF8 signature.
The String class implements an advanced UTF16 (Unicode BMP) string manipulation engine.
The BufferedStream class is a template class that that performs a buffered read of Element_Type data ...
#define VL_INSTRUMENT_CLASS(ClassName, BaseClass)
Visualization Library main namespace.
The TextStream class can be used to conveniently read or parse utf8-encoded text files.
bool readLineCR(String &line)
Reads a CR terminated line.
bool readLine(String &line)
Reads a CR or LF or CR/LF or LF/CR terminated line.
bool empty() const
Returns true if length() == 0.
TextStream(VirtualFile *file=NULL)
bool readStdString(std::string &token)
void ungetLine(const std::string &utf8)
bool readString(String &token)
String & clear()
Clears the string.
bool readLineLF(String &line)
Reads a LF terminated line.
bool readQuotedString(String &token)