Visualization Library v1.0.3

A lightweight C++ OpenGL middleware for 2D/3D graphics

VL     Star     Watch     Fork     Issue

[Download] [Tutorials] [All Classes] [Grouped Classes]
Public Member Functions | Protected Attributes

vl::TextStream Class Reference

The TextStream class can be used to conveniently read or parse utf8-encoded text files. More...

#include <TextStream.hpp>

Inheritance diagram for vl::TextStream:
vl::BufferedStream< unsigned char, 128 *1024 > vl::Object

List of all members.

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.
bool readLineCR (String &line)
 Reads a CR terminated line.
bool readLineLF (String &line)
 Reads a LF terminated line.
bool readInt (int &i, bool hex=false)
bool readDouble (double &d)
bool readString (String &token)
bool readStdString (std::string &token)
bool readQuotedString (String &token)

Protected Attributes

String mTmpStr
std::string mTmpStdStr

Detailed Description

The TextStream class can be used to conveniently read or parse utf8-encoded text files.

Definition at line 46 of file TextStream.hpp.


Constructor & Destructor Documentation

vl::TextStream::TextStream ( VirtualFile file = NULL ) [inline]

Definition at line 51 of file TextStream.hpp.

vl::TextStream::~TextStream (  ) [inline]

Definition at line 55 of file TextStream.hpp.


Member Function Documentation

void vl::TextStream::ungetLine ( const std::string &  utf8 ) [inline]

Definition at line 61 of file TextStream.hpp.

bool vl::TextStream::readLine ( std::string &  utf8 ) [inline]

Definition at line 67 of file TextStream.hpp.

References vl::OM_ReadOnly.

Referenced by vl::STLLoader::loadAscii(), and vl::loadMOL2().

bool vl::TextStream::readLine ( String line ) [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.

bool vl::TextStream::readLineCR ( String line ) [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.

bool vl::TextStream::readLineLF ( String line ) [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().

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().

bool TextStream::readDouble ( double &  d )

Definition at line 50 of file TextStream.cpp.

References mTmpStdStr, and readStdString().

Referenced by vl::PlyLoader::PlyScalar::read().

bool vl::TextStream::readString ( String token ) [inline]

Definition at line 172 of file TextStream.hpp.

References vl::String::clear(), and vl::String::empty().

bool vl::TextStream::readStdString ( std::string &  token ) [inline]

Definition at line 191 of file TextStream.hpp.

Referenced by readDouble(), and readInt().

bool vl::TextStream::readQuotedString ( String token ) [inline]

Definition at line 210 of file TextStream.hpp.

References vl::String::clear(), and vl::String::empty().


Member Data Documentation

Definition at line 235 of file TextStream.hpp.

std::string vl::TextStream::mTmpStdStr [protected]

Definition at line 236 of file TextStream.hpp.

Referenced by readDouble(), and readInt().


The documentation for this class was generated from the following files:

Visualization Library v1.0.3 Reference Documentation
Copyright Michele Bosi. All rights reserved.
Updated on Tue Feb 7 2017 00:55:08.
Permission is granted to use this page to write and publish articles regarding Visualization Library.