|
EGSnrc C++ class library
Report PIRS-898 (2021)
Iwan Kawrakow, Ernesto Mainegra-Hing, Frederic Tessier, Reid Townson and Blake Walters
|
EGS_Input implementation. More...
#include "egs_input.h"#include "egs_functions.h"#include <sstream>#include <algorithm>#include <cctype>#include <fstream>#include <vector>#include <string>Go to the source code of this file.
Classes | |
| class | EGS_InputLoopVariable |
| A base class for input loops. Basic functionality for input loops is provided by this class. Input loops can be used whenever a large number of similar input blocks are needed. More... | |
| class | EGS_IntegerInputLoopVariable |
| A base class for integer valued input loops. Basic functionality for input loops is provided by this class. More... | |
| class | EGS_FloatInputLoopVariable |
| A base class for real valued input loops. Basic functionality for input loops is provided by this class. More... | |
| class | EGS_ListInputLoopVariable |
Macros | |
| #define | S_STREAM std::istringstream |
Functions | |
| template<class T > | |
| int EGS_LOCAL | get_input (const EGS_InputPrivate *p, const string &key, vector< T > &values) |
| template<class T > | |
| int EGS_LOCAL | get_input (const EGS_InputPrivate *p, const string &key, T &value) |
| vector< string > | egsTokenize (const string &str) |
| Tokenize a string into individual tokens. More... | |
| vector< int > | egsParseIntegerRanges (vector< string >::const_iterator begin, vector< string >::const_iterator end) |
| Parse integers and integer ranges from string tokens. More... | |
EGS_Input implementation.
Definition in file egs_input.cpp.
| vector<string> egsTokenize | ( | const string & | inp | ) |
Tokenize a string into individual tokens.
Splits the input string into tokens separated by whitespace or commas. Multiple consecutive whitespace characters are treated as a single separator. Commas are converted to spaces before tokenization.
| str | The input string to tokenize |
Example:
Definition at line 1184 of file egs_input.cpp.
Referenced by EGS_BaseGeometry::getLabelRegions(), and EGS_BaseGeometry::getNumberRegions().
| vector<int> egsParseIntegerRanges | ( | vector< string >::const_iterator | begin, |
| vector< string >::const_iterator | end | ||
| ) |
Parse integers and integer ranges from string tokens.
Parses a sequence of string tokens, where each token can be either:
Ranges are expanded to include all integers between the bounds (inclusive). The order of range bounds doesn't matter (e.g., "15-10" works the same as "10-15").
| begin | Iterator to the first token to parse |
| end | Iterator one past the last token to parse |
Examples:
Definition at line 1207 of file egs_input.cpp.
1.9.1