FEDEM Solver  R8.0
Source code of the dynamics solver
FFaParse.H
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: 2023 SAP SE
2 //
3 // SPDX-License-Identifier: Apache-2.0
4 //
5 // This file is part of FEDEM - https://openfedem.org
7 
13 #ifndef FFA_PARSE_H
14 #define FFA_PARSE_H
15 
16 #include <sstream>
17 #include <string>
18 #include <vector>
19 
20 
21 namespace FaParse
22 {
29  bool parseFMFASCII(char* keyWord, std::istream& s,
30  std::stringstream& statement,
31  const char start, const char stop);
32 
34  int findIndex(const char** vocabulary, const char* s);
35 
37  std::string extractDescription(std::istream& is,
38  const char startChar = '"',
39  const char stopChar = '"');
40 
42  bool skipToWordOrNum(std::istream& s, const char commentChar);
44  bool skipToWord(std::istream& s, const char commentChar);
46  void nextLine(std::istream& s, const char commentChar);
48  bool skipWhiteSpaceAndComments(std::istream& s, bool acceptString = false);
50  bool getKeyword(std::istream& s, std::string& keyWord);
51 }
52 
53 #endif
Utilities for input file parsing.
Definition: FFaParse.H:22
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.
Definition: FFaParse.C:19
bool skipToWordOrNum(std::istream &s, const char commentChar)
Skips until next word or number.
Definition: FFaParse.C:114
bool skipToWord(std::istream &s, const char commentChar)
Skips until next word (no number).
Definition: FFaParse.C:144
int findIndex(const char **vocabulary, const char *s)
Searches for the string s in the list of strings vocabulary.
Definition: FFaParse.C:92
bool getKeyword(std::istream &s, std::string &keyWord)
Skips whitespaces and returns the next (non-numerical) keyword.
Definition: FFaParse.C:191
bool skipWhiteSpaceAndComments(std::istream &s, bool acceptString=false)
Skips whitespaces and comments.
Definition: FFaParse.C:164
std::string extractDescription(std::istream &is, const char startChar='"', const char stopChar = '"')
Extracts a text string between the given start and stop characters.
Definition: FFaParse.C:103
void nextLine(std::istream &s, const char commentChar)
Skips the rest of current line.
Definition: FFaParse.C:129