Visualization Library 2.0.0
A lightweight C++ OpenGL middleware for 2D/3D graphics
|
[Download] [Tutorials] [All Classes] [Grouped Classes] |
The TextStream class can be used to conveniently read or parse utf8-encoded text files. More...
#include <TextStream.hpp>
Public Member Functions | |
TextStream (VirtualFile *file=NULL) | |
~TextStream () | |
void | ungetLine (const std::string &utf8) |
bool | readLine (std::string &utf8) |
bool | readLine (String &line) |
Reads a CR or LF or CR/LF or LF/CR terminated line. More... | |
bool | readLineCR (String &line) |
Reads a CR terminated line. More... | |
bool | readLineLF (String &line) |
Reads a LF terminated line. More... | |
bool | readInt (int &i, bool hex=false) |
bool | readDouble (double &d) |
bool | readString (String &token) |
bool | readStdString (std::string &token) |
bool | readQuotedString (String &token) |
Public Member Functions inherited from vl::BufferedStream< unsigned char, 128 *1024 > | |
BufferedStream () | |
void | seek (long long pos) |
bool | readToken (unsigned char *token) |
bool | readTextChar (unsigned char &ch) |
void | ungetToken (const unsigned char &token) |
bool | bufferEmpty () |
int | fillBuffer () |
bool | isEndOfFile () const |
void | setInputFile (VirtualFile *file) |
VirtualFile * | inputFile () |
const VirtualFile * | inputFile () const |
Public Member Functions inherited from vl::Object | |
Object () | |
Constructor. More... | |
Object (const Object &other) | |
Copy constructor: copies the name, ref count mutex and user data. More... | |
Object & | operator= (const Object &other) |
Copy operator: copies the object's name, ref count mutex and user data. More... | |
const std::string & | objectName () const |
The name of the object, by default set to the object's class name. More... | |
void | setObjectName (const char *name) |
The name of the object, by default set to the object's class name in debug builds. More... | |
void | setObjectName (const std::string &name) |
The name of the object, by default set to the object's class name in debug builds. More... | |
void | setRefCountMutex (IMutex *mutex) |
The mutex used to protect the reference counting of an Object across multiple threads. More... | |
IMutex * | refCountMutex () |
The mutex used to protect the reference counting of an Object across multiple threads. More... | |
const IMutex * | refCountMutex () const |
The mutex used to protect the reference counting of an Object across multiple threads. More... | |
int | referenceCount () const |
Returns the number of references of an object. More... | |
void | incReference () const |
Increments the reference count of an object. More... | |
void | decReference () |
Decrements the reference count of an object and deletes it if both automaticDelete() is true the count reaches 0. More... | |
void | setAutomaticDelete (bool autodel_on) |
If set to true the Object is deleted when its reference count reaches 0. More... | |
bool | automaticDelete () const |
If set to true the Object is deleted when its reference count reaches 0. More... | |
template<class T > | |
T * | as () |
Casts an Object to the specified class. More... | |
template<class T > | |
const T * | as () const |
Casts an Object to the specified class. More... | |
Protected Attributes | |
String | mTmpStr |
std::string | mTmpStdStr |
Protected Attributes inherited from vl::BufferedStream< unsigned char, 128 *1024 > | |
ref< VirtualFile > | mInputFile |
std::vector< unsigned char > | mUngetBuffer |
std::vector< unsigned char > | mBuffer |
int | mPtr |
int | mSize |
bool | mIsEndOfFile |
Protected Attributes inherited from vl::Object | |
std::string | mObjectName |
IMutex * | mRefCountMutex |
int | mReferenceCount |
bool | mAutomaticDelete |
Additional Inherited Members | |
Protected Member Functions inherited from vl::Object | |
virtual | ~Object () |
The TextStream class can be used to conveniently read or parse utf8-encoded text files.
Definition at line 46 of file TextStream.hpp.
|
inline |
Definition at line 51 of file TextStream.hpp.
|
inline |
Definition at line 55 of file TextStream.hpp.
bool TextStream::readDouble | ( | double & | d | ) |
Definition at line 50 of file TextStream.cpp.
References mTmpStdStr, and readStdString().
Referenced by vl::PlyLoader::PlyScalar::read().
bool TextStream::readInt | ( | int & | i, |
bool | hex = false |
||
) |
Definition at line 38 of file TextStream.cpp.
References mTmpStdStr, and readStdString().
Referenced by vl::PlyLoader::PlyScalar::read().
|
inline |
Definition at line 67 of file TextStream.hpp.
References vl::OM_ReadOnly.
Referenced by vl::isDAT(), vl::STLLoader::loadAscii(), vl::loadDAT(), vl::loadMHD(), vl::loadMOL2(), vl::ObjLoader::loadOBJ(), and vl::ObjLoader::loadObjMaterials().
|
inline |
Reads a CR or LF or CR/LF or LF/CR terminated line.
Definition at line 93 of file TextStream.hpp.
References vl::String::clear(), vl::String::fromUTF8(), and vl::OM_ReadOnly.
|
inline |
Reads a CR terminated line.
Definition at line 123 of file TextStream.hpp.
References vl::String::clear(), vl::String::empty(), vl::String::fromUTF8(), and vl::OM_ReadOnly.
|
inline |
Reads a LF terminated line.
Definition at line 146 of file TextStream.hpp.
References vl::String::clear(), vl::String::empty(), vl::String::fromUTF8(), and vl::OM_ReadOnly.
Referenced by vl::PlyLoader::readHeader().
|
inline |
Definition at line 210 of file TextStream.hpp.
References vl::String::clear(), and vl::String::empty().
|
inline |
Definition at line 191 of file TextStream.hpp.
Referenced by readDouble(), and readInt().
|
inline |
Definition at line 172 of file TextStream.hpp.
References vl::String::clear(), and vl::String::empty().
|
inline |
Definition at line 61 of file TextStream.hpp.
|
protected |
Definition at line 236 of file TextStream.hpp.
Referenced by readDouble(), and readInt().
|
protected |
Definition at line 235 of file TextStream.hpp.
Visualization Library 2.0.0 Reference Documentation
Updated on Wed Dec 23 2020 12:44:12.
© Copyright Michele Bosi. All rights reserved.