Reads and parses a SWMM .inp file into a SimulationContext.
More...
#include <InputReader.hpp>
Reads and parses a SWMM .inp file into a SimulationContext.
◆ InputReader()
Construct an InputReader with a pre-populated registry.
- Parameters
-
| registry | Reference to the section registry (must outlive this reader). |
◆ lines_read()
| int openswmm::input::InputReader::lines_read |
( |
| ) |
const |
|
inlinenoexcept |
Number of lines successfully parsed in the last read() call.
◆ read()
| bool openswmm::input::InputReader::read |
( |
const std::string & |
path, |
|
|
SimulationContext & |
ctx |
|
) |
| |
Read and parse the specified .inp file.
After parsing, ctx holds all objects, options, and tables. Any parse errors are reported via ctx.error_code / ctx.error_message. The function returns false if a fatal parse error occurred.
- Parameters
-
| path | Path to the input file. |
| ctx | Simulation context to populate. |
- Returns
- true on success, false if a fatal error occurred.
- See also
- ctx.error_code, ctx.error_message for diagnostics.
◆ read_stream()
| bool openswmm::input::InputReader::read_stream |
( |
std::istream & |
stream, |
|
|
SimulationContext & |
ctx |
|
) |
| |
Parse from an already-open stream (for testing / stdin).
- Parameters
-
| stream | Input stream. |
| ctx | Simulation context to populate. |
- Returns
- true on success.
◆ skipped_sections()
| const std::vector< std::string > & openswmm::input::InputReader::skipped_sections |
( |
| ) |
const |
|
inlinenoexcept |
List of section tags that were skipped (no registered handler).
The documentation for this class was generated from the following files:
- /home/runner/work/openswmm.engine/openswmm.engine/src/engine/input/InputReader.hpp
- /home/runner/work/openswmm.engine/openswmm.engine/src/engine/input/InputReader.cpp