OpenWalnut  1.5.0dev
Public Member Functions | Private Attributes | List of all members
WFileParser Class Reference

class implements text file loading and several convinience methods to access More...

#include <WFileParser.h>

+ Collaboration diagram for WFileParser:

Public Member Functions

 WFileParser (const std::string fileName)
 constructor More...
 
 ~WFileParser ()
 destructor More...
 
bool readFile ()
 helper function to read a text file More...
 
std::vector< std::string > getRawLines ()
 getter More...
 
std::vector< std::string > getLinesForTag (std::string tag)
 getter More...
 
std::vector< std::vector< std::string > > getLinesForTagSeparated (std::string tag)
 getter More...
 
 WFileParser (const std::string fileName)
 constructor More...
 
 ~WFileParser ()
 destructor More...
 
bool readFile ()
 helper function to read a text file More...
 
std::vector< std::string > getRawLines ()
 getter More...
 
std::vector< std::string > getLinesForTag (std::string tag)
 getter More...
 
std::vector< std::vector< std::string > > getLinesForTagSeparated (std::string tag)
 getter More...
 

Private Attributes

std::string m_fileName
 the file name of the file to parse More...
 
std::vector< std::string > m_rawLines
 vector of every line in the file More...
 
std::string m_tagIndicator
 string marking a line as tag More...
 
std::string m_endIndicator
 string marking the end of a tagged area More...
 
std::string m_delimiter
 delimiter for entries in a line More...
 

Detailed Description

class implements text file loading and several convinience methods to access

this class implements text file loading and several convinience methods to access the recovered text

Definition at line 34 of file clusterDisplayVoxels/WFileParser.h.

Constructor & Destructor Documentation

◆ WFileParser() [1/2]

WFileParser::WFileParser ( const std::string  fileName)
explicit

constructor

Parameters
fileName

Definition at line 36 of file clusterDisplayVoxels/WFileParser.cpp.

◆ ~WFileParser() [1/2]

WFileParser::~WFileParser ( )

destructor

Definition at line 44 of file clusterDisplayVoxels/WFileParser.cpp.

◆ WFileParser() [2/2]

WFileParser::WFileParser ( const std::string  fileName)
explicit

constructor

Parameters
fileName

◆ ~WFileParser() [2/2]

WFileParser::~WFileParser ( )

destructor

Member Function Documentation

◆ getLinesForTag() [1/2]

std::vector< std::string > WFileParser::getLinesForTag ( std::string  tag)

getter

Parameters
tagtag marking a certain type of content
Returns
vector of strings for each line for the tag

Definition at line 81 of file clusterDisplayVoxels/WFileParser.cpp.

References m_endIndicator, m_rawLines, and m_tagIndicator.

◆ getLinesForTag() [2/2]

std::vector<std::string> WFileParser::getLinesForTag ( std::string  tag)

getter

Parameters
tagtag marking a certain type of content
Returns
vector of strings for each line for the tag

◆ getLinesForTagSeparated() [1/2]

std::vector< std::vector< std::string > > WFileParser::getLinesForTagSeparated ( std::string  tag)

getter

Parameters
tagtag marking a certain type of content
Returns
same as getLinesForTag but each line represented as vector of strings

Definition at line 119 of file clusterDisplayVoxels/WFileParser.cpp.

References m_delimiter, m_endIndicator, m_rawLines, and m_tagIndicator.

Referenced by WMClusterDisplayVoxels::loadClustering(), and WHtree::readTree().

+ Here is the caller graph for this function:

◆ getLinesForTagSeparated() [2/2]

std::vector< std::vector<std::string> > WFileParser::getLinesForTagSeparated ( std::string  tag)

getter

Parameters
tagtag marking a certain type of content
Returns
same as getLinesForTag but each line represented as vector of strings

◆ getRawLines() [1/2]

std::vector< std::string > WFileParser::getRawLines ( )
inline

getter

Returns
the content of the loaded as vector of strings for each line

Definition at line 87 of file clusterDisplayVoxels/WFileParser.h.

References m_rawLines.

Referenced by WMClusterDisplayVoxels::loadClustering(), and WHtree::readTree().

+ Here is the caller graph for this function:

◆ getRawLines() [2/2]

std::vector<std::string> WFileParser::getRawLines ( )

getter

Returns
the content of the loaded as vector of strings for each line

◆ readFile() [1/2]

bool WFileParser::readFile ( )

helper function to read a text file

Returns
string containing the file

Definition at line 48 of file clusterDisplayVoxels/WFileParser.cpp.

References m_fileName, and m_rawLines.

Referenced by WMClusterDisplayVoxels::loadClustering(), and WHtree::readTree().

+ Here is the caller graph for this function:

◆ readFile() [2/2]

bool WFileParser::readFile ( )

helper function to read a text file

Returns
string containing the file

Member Data Documentation

◆ m_delimiter

std::string WFileParser::m_delimiter
private

delimiter for entries in a line

Definition at line 84 of file clusterDisplayVoxels/WFileParser.h.

Referenced by getLinesForTagSeparated().

◆ m_endIndicator

std::string WFileParser::m_endIndicator
private

string marking the end of a tagged area

Definition at line 82 of file clusterDisplayVoxels/WFileParser.h.

Referenced by getLinesForTag(), and getLinesForTagSeparated().

◆ m_fileName

std::string WFileParser::m_fileName
private

the file name of the file to parse

Definition at line 76 of file clusterDisplayVoxels/WFileParser.h.

Referenced by readFile().

◆ m_rawLines

std::vector< std::string > WFileParser::m_rawLines
private

vector of every line in the file

Definition at line 78 of file clusterDisplayVoxels/WFileParser.h.

Referenced by getLinesForTag(), getLinesForTagSeparated(), getRawLines(), and readFile().

◆ m_tagIndicator

std::string WFileParser::m_tagIndicator
private

string marking a line as tag

Definition at line 80 of file clusterDisplayVoxels/WFileParser.h.

Referenced by getLinesForTag(), and getLinesForTagSeparated().


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