BornAgain
1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
|
Provides basic algorirthm for parsing multi-string data representing content of multi-column ASCII file. More...
Public Member Functions | |
DefaultParser (const ParserOptions &options) | |
std::string | getLine (size_t index) const override |
Returns a pair representing raw line and flag describing parsing results. More... | |
std::vector< std::vector< std::string > > | parsedData () const override |
Returns 2D vector representing parsed text. Skipped lines are not present. More... | |
std::vector< std::string > | parseResults (size_t index) const override |
Returns parsed text for given line index. More... | |
void | process (const std::vector< std::string > &raw_data) override |
Parse data representing content of ASCII file. More... | |
size_t | totalLineCount () const override |
Returns total number of lines in raw data. More... | |
Private Attributes | |
accept_int_t | m_isSkipLineNumber |
accept_string_t | m_isValidLineContent |
line_splitter_t | m_line_splitter |
std::map< size_t, std::vector< std::string > > | m_parsedData |
std::vector< std::string > | m_rawData |
correspondence of parsed data to original line index More... | |
Provides basic algorirthm for parsing multi-string data representing content of multi-column ASCII file.
Definition at line 32 of file defaultparser.h.
gui2::DefaultParser::DefaultParser | ( | const ParserOptions & | options | ) |
Definition at line 21 of file defaultparser.cpp.
References gui2::Utils::CreateLineNumberPatternValidator(), gui2::Utils::CreateLinePrefixValidator(), gui2::Utils::CreateSeparatorBasedSplitter(), gui2::ParserOptions::m_header_prefix, m_isSkipLineNumber, m_isValidLineContent, m_line_splitter, gui2::ParserOptions::m_separator, and gui2::ParserOptions::m_skip_index_pattern.
|
overridevirtual |
Returns a pair representing raw line and flag describing parsing results.
Implements gui2::ParserInterface.
Definition at line 55 of file defaultparser.cpp.
References m_rawData.
|
overridevirtual |
Returns 2D vector representing parsed text. Skipped lines are not present.
Implements gui2::ParserInterface.
Definition at line 69 of file defaultparser.cpp.
References m_parsedData, and totalLineCount().
|
overridevirtual |
Returns parsed text for given line index.
If line was skipped during parsing, returns empty vector.
Implements gui2::ParserInterface.
Definition at line 63 of file defaultparser.cpp.
References m_parsedData.
|
overridevirtual |
Parse data representing content of ASCII file.
Implements gui2::ParserInterface.
Definition at line 30 of file defaultparser.cpp.
References m_isSkipLineNumber, m_isValidLineContent, m_line_splitter, m_parsedData, and m_rawData.
|
overridevirtual |
Returns total number of lines in raw data.
Implements gui2::ParserInterface.
Definition at line 48 of file defaultparser.cpp.
References m_rawData.
Referenced by parsedData().
|
private |
Definition at line 47 of file defaultparser.h.
Referenced by DefaultParser(), and process().
|
private |
Definition at line 48 of file defaultparser.h.
Referenced by DefaultParser(), and process().
|
private |
Definition at line 49 of file defaultparser.h.
Referenced by DefaultParser(), and process().
|
private |
Definition at line 52 of file defaultparser.h.
Referenced by parsedData(), parseResults(), and process().
|
private |
correspondence of parsed data to original line index
Definition at line 50 of file defaultparser.h.
Referenced by getLine(), process(), and totalLineCount().