OpenSWMM Engine  6.0.0-alpha.1
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.1)
Loading...
Searching...
No Matches
Tokenizer.hpp File Reference

Multi-delimiter tokenizer for SWMM input files. More...

#include <string>
#include <string_view>
#include <vector>
Include dependency graph for Tokenizer.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  openswmm::input::Tokenizer
 Stateless multi-delimiter tokenizer for SWMM input lines. More...
 

Namespaces

namespace  openswmm
 
namespace  openswmm::input
 

Detailed Description

Multi-delimiter tokenizer for SWMM input files.

Replaces the legacy space-only tokenizer in src/solver/input.c. The new tokenizer handles comma, tab, and one-or-more spaces as delimiters. This allows input files to be formatted as:

  • Traditional SWMM (space-delimited)
  • Spreadsheet export (comma or tab-delimited CSV)
  • Mixed formats within the same file

Key differences from legacy SWMM tokenizer

Feature Legacy (input.c) New Tokenizer
Delimiters Space only Space, tab, comma
Comment char ; (semicolon) ; or ;;
Quoted strings Not supported Supported (double-quotes)
Performance sscanf-based std::string_view, no allocations
See also
Legacy reference: src/solver/input.c — getToken()
tests/unit/test_tokenizer.cpp
Author
Caleb Buahin caleb.nosp@m..bua.nosp@m.hin@g.nosp@m.mail.nosp@m..com
License\n MIT License