FEDEM Solver  R8.0
Source code of the dynamics solver
Functions
FaParse Namespace Reference

Utilities for input file parsing. More...

Functions

bool parseFMFASCII (char *keyWord, std::istream &s, std::stringstream &statement, const char start, const char stop)
 Reads a model file record from an input stream. More...
 
int findIndex (const char **vocabulary, const char *s)
 Searches for the string s in the list of strings vocabulary. More...
 
std::string extractDescription (std::istream &is, const char startChar='"', const char stopChar = '"')
 Extracts a text string between the given start and stop characters. More...
 
bool skipToWordOrNum (std::istream &s, const char commentChar)
 Skips until next word or number. More...
 
bool skipToWord (std::istream &s, const char commentChar)
 Skips until next word (no number). More...
 
void nextLine (std::istream &s, const char commentChar)
 Skips the rest of current line. More...
 
bool skipWhiteSpaceAndComments (std::istream &s, bool acceptString=false)
 Skips whitespaces and comments. More...
 
bool getKeyword (std::istream &s, std::string &keyWord)
 Skips whitespaces and returns the next (non-numerical) keyword. More...
 

Detailed Description

Utilities for input file parsing.

Function Documentation

◆ extractDescription()

std::string FaParse::extractDescription ( std::istream &  is,
const char  startChar = '"',
const char  stopChar = '"' 
)

Extracts a text string between the given start and stop characters.

◆ findIndex()

int FaParse::findIndex ( const char **  vocabulary,
const char *  s 
)

Searches for the string s in the list of strings vocabulary.

◆ getKeyword()

bool FaParse::getKeyword ( std::istream &  s,
std::string &  keyWord 
)

Skips whitespaces and returns the next (non-numerical) keyword.

◆ nextLine()

void FaParse::nextLine ( std::istream &  s,
const char  commentChar 
)

Skips the rest of current line.

◆ parseFMFASCII()

bool FaParse::parseFMFASCII ( char *  keyWord,
std::istream &  s,
std::stringstream &  statement,
const char  start,
const char  stop 
)

Reads a model file record from an input stream.

Parameters
[out]keyWordThe keyword of the record that was read
sThe input stream to read from
[out]statementString stream containing unparsed data of the record
[in]startSeparator between the keyword and data section
[in]stopEnd-of-record character

◆ skipToWord()

bool FaParse::skipToWord ( std::istream &  s,
const char  commentChar 
)

Skips until next word (no number).

◆ skipToWordOrNum()

bool FaParse::skipToWordOrNum ( std::istream &  s,
const char  commentChar 
)

Skips until next word or number.

◆ skipWhiteSpaceAndComments()

bool FaParse::skipWhiteSpaceAndComments ( std::istream &  s,
bool  acceptString = false 
)

Skips whitespaces and comments.

All kinds of text is considered to be comments, except any text within "" if acceptString is true.