FEDEM Solver  R8.0
Source code of the dynamics solver
Public Member Functions | Protected Member Functions | Private Attributes | List of all members
FFaTokenizer Class Reference

Class creating a one-level token hierarchy. More...

#include <FFaTokenizer.H>

Inheritance diagram for FFaTokenizer:
Inheritance graph
[legend]
Collaboration diagram for FFaTokenizer:
Collaboration graph
[legend]

Public Member Functions

 FFaTokenizer (char entryBegin, char entryEnd, char separator=',')
 The constructor defines the start, stop and separator characters. More...
 
 FFaTokenizer (FILE *tokenFile, char entryBegin, char entryEnd, char separator=',', bool sq=true)
 Constructor parsing the tokens from a file. More...
 
 FFaTokenizer (std::istream &tokenStream, char entryBegin, char entryEnd, char separator=',', bool sq=true)
 Constructor parsing the tokens from an input stream. More...
 
 FFaTokenizer (const std::string &tokenString, char entryBegin, char entryEnd, char separator=',', bool sq=true)
 Constructor parsing the tokens from a string. More...
 
virtual ~FFaTokenizer ()
 Empty destructor. More...
 
std::string::const_iterator createTokens (std::string::const_iterator tBegin, std::string::const_iterator tEnd)
 Creates tokens from a string range. More...
 

Protected Member Functions

void createTokens (FILE *tokenFile)
 Creates tokens from a file. More...
 
void createTokens (std::istream &tokenStream)
 Creates tokens from an input stream. More...
 
int createTokens (FFaTokenInput &tokenData)
 Creates tokens from generic input. More...
 

Private Attributes

char eb
 Start character. More...
 
char ee
 End character. More...
 
char ts
 Token separator. More...
 
bool iAmStrippingQuotes
 If true, strip "-characters from tokens. More...
 

Detailed Description

Class creating a one-level token hierarchy.

The class is essentially a list of strings, with some added functionality for parsing the string elements (tokens) based on the specified start-, stop- and separator characters.

Constructor & Destructor Documentation

◆ FFaTokenizer() [1/4]

FFaTokenizer::FFaTokenizer ( char  entryBegin,
char  entryEnd,
char  separator = ',' 
)
inline

The constructor defines the start, stop and separator characters.

Parameters
[in]entryBeginCharacter indicating the start of the token list
[in]entryEndCharacter indicating the end of the token list
[in]separatorCharacter separating each token

◆ FFaTokenizer() [2/4]

FFaTokenizer::FFaTokenizer ( FILE *  tokenFile,
char  entryBegin,
char  entryEnd,
char  separator = ',',
bool  sq = true 
)
inline

Constructor parsing the tokens from a file.

Parameters
[in]tokenFileFile to parse the tokens from
[in]entryBeginCharacter indicating the start of the token list
[in]entryEndCharacter indicating the end of the token list
[in]separatorCharacter separating each token
[in]sqIf true, strip quotes ("-characters) from the tokens

◆ FFaTokenizer() [3/4]

FFaTokenizer::FFaTokenizer ( std::istream &  tokenStream,
char  entryBegin,
char  entryEnd,
char  separator = ',',
bool  sq = true 
)
inline

Constructor parsing the tokens from an input stream.

Parameters
[in]tokenStreamInput stream to parse the tokens from
[in]entryBeginCharacter indicating the start of the token list
[in]entryEndCharacter indicating the end of the token list
[in]separatorCharacter separating each token
[in]sqIf true, strip quotes ("-characters) from the tokens

◆ FFaTokenizer() [4/4]

FFaTokenizer::FFaTokenizer ( const std::string &  tokenString,
char  entryBegin,
char  entryEnd,
char  separator = ',',
bool  sq = true 
)
inline

Constructor parsing the tokens from a string.

Parameters
[in]tokenStringString to parse the tokens from
[in]entryBeginCharacter indicating the start of the token list
[in]entryEndCharacter indicating the end of the token list
[in]separatorCharacter separating each token
[in]sqIf true, strip quotes ("-characters) from the tokens

◆ ~FFaTokenizer()

virtual FFaTokenizer::~FFaTokenizer ( )
inlinevirtual

Empty destructor.

Member Function Documentation

◆ createTokens() [1/4]

int FFaTokenizer::createTokens ( FFaTokenInput tokenData)
protected

Creates tokens from generic input.

◆ createTokens() [2/4]

void FFaTokenizer::createTokens ( FILE *  tokenFile)
protected

Creates tokens from a file.

◆ createTokens() [3/4]

void FFaTokenizer::createTokens ( std::istream &  tokenStream)
protected

Creates tokens from an input stream.

◆ createTokens() [4/4]

std::string::const_iterator FFaTokenizer::createTokens ( std::string::const_iterator  tBegin,
std::string::const_iterator  tEnd 
)

Creates tokens from a string range.

Member Data Documentation

◆ eb

char FFaTokenizer::eb
private

Start character.

◆ ee

char FFaTokenizer::ee
private

End character.

◆ iAmStrippingQuotes

bool FFaTokenizer::iAmStrippingQuotes
private

If true, strip "-characters from tokens.

◆ ts

char FFaTokenizer::ts
private

Token separator.


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