summaryrefslogtreecommitdiff
path: root/src/core/variant/Reader.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/variant/Reader.hpp')
-rw-r--r--src/core/variant/Reader.hpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/core/variant/Reader.hpp b/src/core/variant/Reader.hpp
index 62592c1..a0c6640 100644
--- a/src/core/variant/Reader.hpp
+++ b/src/core/variant/Reader.hpp
@@ -28,6 +28,7 @@
#ifndef _OUSIA_VARIANT_READER_HPP_
#define _OUSIA_VARIANT_READER_HPP_
+#include <cstdint>
#include <unordered_set>
#include <utility>
@@ -114,6 +115,31 @@ public:
BufferedCharReader &reader, Logger &logger,
const std::unordered_set<char> &delims);
+
+ /**
+ * Parses an integer from the given buffered char reader instance until one
+ * of the given delimiter characters is reached.
+ *
+ * @param reader is a reference to the BufferedCharReader instance from
+ * which the character data should been reader. The reader will be
+ * positioned at the terminating delimiting character or directly after the
+ * integer.
+ */
+ static std::pair<bool, int64_t> parseInteger(
+ BufferedCharReader &reader, Logger &logger);
+
+ /**
+ * Parses an double from the given buffered char reader instance until one
+ * of the given delimiter characters is reached.
+ *
+ * @param reader is a reference to the BufferedCharReader instance from
+ * which the character data should been reader. The reader will be
+ * positioned at the terminating delimiting character or directly after the
+ * integer.
+ */
+ static std::pair<bool, double> parseDouble(
+ BufferedCharReader &reader, Logger &logger);
+
/**
* Tries to parse the most specific item from the given stream until one of
* the given delimiters is reached or a meaningful literal has been read.