From 0c7153db084060034092c1dc24222cae384722ec Mon Sep 17 00:00:00 2001 From: crupest Date: Sat, 8 Jan 2022 19:24:44 +0800 Subject: ... --- include/cru/toml/TomlDocument.hpp | 1 + include/cru/toml/TomlParser.hpp | 7 +++++++ 2 files changed, 8 insertions(+) (limited to 'include/cru/toml') diff --git a/include/cru/toml/TomlDocument.hpp b/include/cru/toml/TomlDocument.hpp index 9b549daa..637690f7 100644 --- a/include/cru/toml/TomlDocument.hpp +++ b/include/cru/toml/TomlDocument.hpp @@ -37,6 +37,7 @@ class TomlDocument { public: TomlSection* GetSection(const String& name); + TomlSection* GetSectionOrCreate(const String& name); const TomlSection* GetSection(const String& name) const; void SetSection(const String& name, TomlSection section); void DeleteSection(const String& name); diff --git a/include/cru/toml/TomlParser.hpp b/include/cru/toml/TomlParser.hpp index b5bcaa0b..52332506 100644 --- a/include/cru/toml/TomlParser.hpp +++ b/include/cru/toml/TomlParser.hpp @@ -1,10 +1,17 @@ #pragma once +#include "cru/common/Exception.hpp" #include "cru/toml/TomlDocument.hpp" #include namespace cru::toml { +// A very simple and tolerant TOML parser. +class TomlParsingException : public Exception { + public: + using Exception::Exception; +}; + class TomlParser { public: explicit TomlParser(String input); -- cgit v1.2.3