summaryrefslogtreecommitdiff
path: root/tools/common/toml.h
diff options
context:
space:
mode:
Diffstat (limited to 'tools/common/toml.h')
-rw-r--r--tools/common/toml.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/tools/common/toml.h b/tools/common/toml.h
index a2c03bf1..4c97e7f2 100644
--- a/tools/common/toml.h
+++ b/tools/common/toml.h
@@ -1,3 +1,10 @@
+/*
+ * mrustc common tools
+ * - by John Hodge (Mutabah)
+ *
+ * tools/common/toml.h
+ * - A very basic (and probably incomplete) streaming TOML parser
+ */
#pragma once
#include <fstream>
@@ -31,6 +38,7 @@ public:
TomlFileIter begin();
TomlFileIter end();
+ // Obtain the next value in the file
TomlKeyValue get_next_value();
};
@@ -38,11 +46,14 @@ struct TomlValue
{
enum class Type
{
+ // A true/false, 1/0, yes/no value
Boolean,
+ // A double-quoted string
String,
+ // Integer
Integer,
+ // A list of other values
List,
-
};
friend ::std::ostream& operator<<(::std::ostream& os, const Type& e) {
switch(e)
@@ -146,7 +157,10 @@ struct TomlValue
struct TomlKeyValue
{
+ // Path to the value (last node is the value name)
+ // TODO: How are things like `[[bin]]` handled?
::std::vector<::std::string> path;
+ // Relevant value
TomlValue value;
};