Util: Implement new JSON Job class

This commit is contained in:
Riyyi
2022-06-24 14:56:37 +02:00
parent 13d020a351
commit 68bc95fdf1
6 changed files with 41 additions and 23 deletions
+6 -2
View File
@@ -11,11 +11,14 @@
// home/rick/code/cpp/manafiles/ https://www.rfc-editor.org/rfc/pdfrfc/rfc8259.txt.pdf
#include <cstddef> // size_t
#include <memory> // shared_ptr
#include <string>
#include <vector>
namespace Json {
class Job;
struct Token {
enum class Type {
None,
@@ -39,7 +42,7 @@ struct Token {
// Lexical analyzer
class Lexer {
public:
Lexer(const std::string& input);
Lexer(std::shared_ptr<Job> job);
virtual ~Lexer();
void analyze();
@@ -57,7 +60,8 @@ private:
bool getNumber();
bool getLiteral();
std::string m_input;
std::shared_ptr<Job> m_job { nullptr };
size_t m_index { 0 };
size_t m_column { 1 };
size_t m_line { 1 };