# Visualization Library

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

[Home] [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:

List of all members.

## Public Member Functions

virtual const char * | className ()
| Returns the name of the class.
| 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 45 of file TextStream.hpp.

## Constructor & Destructor Documentation

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

Definition at line 49 of file TextStream.hpp.

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

Definition at line 53 of file TextStream.hpp.

## Member Function Documentation

virtual const char* vl::TextStream::className | ( | ) | `[inline, virtual]`

Returns the name of the class.

Reimplemented from vl::BufferedStream< unsigned char, 128 *1024 >.

Definition at line 48 of file TextStream.hpp.

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

Definition at line 59 of file TextStream.hpp.

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

Definition at line 65 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 91 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 121 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 144 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 170 of file TextStream.hpp.

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

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

Definition at line 189 of file TextStream.hpp.

Referenced by readDouble(), and readInt().

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

Definition at line 208 of file TextStream.hpp.

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

## Member Data Documentation

String vl::TextStream::mTmpStr`[protected]`

Definition at line 233 of file TextStream.hpp.

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

Definition at line 234 of file TextStream.hpp.

Referenced by readDouble(), and readInt().

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

- D:/VL/BuildSystem/VL_DISTRO/Visualization_Library_SDK/src/vlCore/TextStream.hpp
- D:/VL/BuildSystem/VL_DISTRO/Visualization_Library_SDK/src/vlCore/TextStream.cpp

Visualization Library v2011.05.1142 Reference Documentation
Copyright 2005-2011 Michele Bosi. All rights reserved.
Updated on Thu May 26 2011 22:51:36.
Permission is granted to use this page to write and publish articles regarding Visualization Library.