aboutsummaryrefslogtreecommitdiffstats
path: root/include/jsonhandler.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/jsonhandler.h')
-rw-r--r--include/jsonhandler.h18
1 files changed, 10 insertions, 8 deletions
diff --git a/include/jsonhandler.h b/include/jsonhandler.h
index a84854a..1f334cd 100644
--- a/include/jsonhandler.h
+++ b/include/jsonhandler.h
@@ -1,5 +1,9 @@
-// Copyright (C) 2022 The Qt Company Ltd.
-//
+/* Copyright (C) 2022 The Qt Company Ltd.
+ *
+ * SPDX-License-Identifier: GPL-3.0-only WITH Qt-GPL-exception-1.0
+*/
+
+#pragma once
#include <algorithm>
#include <utility>
@@ -11,8 +15,6 @@
// Very simple JSON reader/writer, takes a JSON string as input
// Specific to Qt license daemon only, doesn't work with JSONs in general
-
-
class JsonHandler {
const std::vector<std::string> reservation {
@@ -21,7 +23,7 @@ const std::vector<std::string> reservation {
};
public:
- explicit JsonHandler (std::string jsonString);
+ explicit JsonHandler(const std::string &jsonString);
~JsonHandler() { }
std::string get(const std::string &item);
@@ -30,9 +32,9 @@ public:
std::string getStr(const std::string &item);
bool getBool(const std::string &item);
- int add(const std::string &item, const std::string &value);
- int add(const std::string &item, uint64_t value);
- int add(const std::string &item, bool value);
+ void add(const std::string &item, const std::string &value);
+ void add(const std::string &item, uint64_t value);
+ void add(const std::string &item, bool value);
std::string dump(uint8_t indent=0);