SWMMVis  6.0.0-alpha.4
Qt6/C++ GIS-based graphical user interface for the SWMMVis engine (6.0.0-alpha.4)
Loading...
Searching...
No Matches
rulelistio.h File Reference

Save / load Rule Lists as .swmm-rule.json files (Slice Z.17). More...

#include <QString>
#include <QStringList>
Include dependency graph for rulelistio.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  OpenSWMM::Render::RuleListIoResult
 Outcome of a save / load operation. More...
 

Namespaces

namespace  OpenSWMM
 
namespace  OpenSWMM::Render
 
namespace  OpenSWMM::Render::RuleListIO
 

Functions

RuleListIoResult OpenSWMM::Render::RuleListIO::save (const RuleList *list, const QString &path)
 Serialise list as a top-level JSON envelope and write it to path. The file is overwritten if it already exists.
 
RuleListIoResult OpenSWMM::Render::RuleListIO::load (const QString &path, RuleList *list)
 Read path and populate list. The list is cleared first when the file loads successfully; on failure list is left unchanged.
 

Variables

constexpr const char * OpenSWMM::Render::RuleListIO::kFormat = "swmm-rule-json"
 
constexpr int OpenSWMM::Render::RuleListIO::kVersion = 1
 

Detailed Description

Save / load Rule Lists as .swmm-rule.json files (Slice Z.17).

Author
Caleb Buahin caleb.nosp@m..bua.nosp@m.hin@g.nosp@m.mail.nosp@m..com
Date
2026
License\n GPL-3.0-or-later
    The Rule Model's native persistence format. See
    RENDERING_RULE_MODEL_PLAN.md §3.3 + §12.1 for the schema.

    File envelope:
      {
        "format":  "swmm-rule-json",
        "version": 1,
        "rules":   [ <Rule JSON> ... ],
        "symbolLevels": { "enabled": false }
      }

    Forward compatibility: unknown top-level keys produce a
    warning in the Result rather than failing the load. Rule
    entries whose renderer id is unknown to the current build
    (e.g. a renderer plugin that hasn't been registered) are
    skipped with a warning, leaving the rest of the list intact.

    Slice Z.17-files ships this native pair. The `.qml` (QGIS)
    interop subset is the named Z.17b follow-up — both sides
    share the Result + IO conventions defined here.