aboutsummaryrefslogtreecommitdiff
path: root/include/cru/toml/TomlParser.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'include/cru/toml/TomlParser.hpp')
-rw-r--r--include/cru/toml/TomlParser.hpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/include/cru/toml/TomlParser.hpp b/include/cru/toml/TomlParser.hpp
new file mode 100644
index 00000000..b5bcaa0b
--- /dev/null
+++ b/include/cru/toml/TomlParser.hpp
@@ -0,0 +1,29 @@
+#pragma once
+
+#include "cru/toml/TomlDocument.hpp"
+
+#include <optional>
+
+namespace cru::toml {
+class TomlParser {
+ public:
+ explicit TomlParser(String input);
+
+ CRU_DELETE_COPY(TomlParser)
+ CRU_DELETE_MOVE(TomlParser)
+
+ ~TomlParser();
+
+ public:
+ TomlDocument Parse();
+
+ private:
+ // The document is empty to begin with.
+ void DoParse(TomlDocument& document);
+
+ private:
+ String input_;
+
+ std::optional<TomlDocument> cache_;
+};
+} // namespace cru::toml