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
Go to the documentation of this file.
1
30#ifndef OPENSWMM_RENDER_RULELISTIO_H
31#define OPENSWMM_RENDER_RULELISTIO_H
32
33#include <QString>
34#include <QStringList>
35
36namespace OpenSWMM::Render {
37
38class RuleList;
39
51{
52 bool ok = false;
53 QString error;
54 QStringList warnings;
55 int rulesLoaded = 0;
56 int rulesSkipped = 0;
57};
58
59namespace RuleListIO {
60
62inline constexpr const char *kFormat = "swmm-rule-json";
63
66inline constexpr int kVersion = 1;
67
78[[nodiscard]] RuleListIoResult save(const RuleList *list, const QString &path);
79
90[[nodiscard]] RuleListIoResult load(const QString &path, RuleList *list);
91
92} // namespace RuleListIO
93
94} // namespace OpenSWMM::Render
95
96#endif // OPENSWMM_RENDER_RULELISTIO_H
Ordered owning container for Rules on one layer.
Definition rulelist.h:48
RuleListIoResult load(const QString &path, RuleList *list)
Read path and populate list. The list is cleared first when the file loads successfully; on failure l...
Definition rulelistio.cpp:95
constexpr int kVersion
Definition rulelistio.h:66
constexpr const char * kFormat
Definition rulelistio.h:62
RuleListIoResult 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 alrea...
Definition rulelistio.cpp:49
Definition gisrasterlayer.h:40
int path
Definition pslgminsize.cpp:234
Outcome of a save / load operation.
Definition rulelistio.h:51
bool ok
Definition rulelistio.h:52
QString error
Definition rulelistio.h:53
int rulesLoaded
Definition rulelistio.h:55
QStringList warnings
Definition rulelistio.h:54
int rulesSkipped
Definition rulelistio.h:56