36 lines
873 B
C
36 lines
873 B
C
|
#pragma once
|
||
|
#include <stdio.h>
|
||
|
#include <iostream>
|
||
|
#include <fstream>
|
||
|
#include <sstream>
|
||
|
#include <vector>
|
||
|
#include <stdlib.h>
|
||
|
#include "json.hpp"
|
||
|
|
||
|
using json = nlohmann::json;
|
||
|
const std::string JSONPATH ="/opt/hgscannersdk.json";
|
||
|
static const std::string G100JSONPATH ="/opt/G100.json";
|
||
|
static const std::string G200JSONPATH ="/opt/G200.json";
|
||
|
static const std::string G300JSONPATH ="/opt/G300.json";
|
||
|
static const std::string G400JSONPATH ="/opt/G400.json";
|
||
|
|
||
|
|
||
|
class jsonconfig
|
||
|
{
|
||
|
public:
|
||
|
static json loadjson(std::string path);
|
||
|
static json load_json_from_text(const char* json_txt);
|
||
|
static bool savejson(std::string path,json js);
|
||
|
static json defaultjson();
|
||
|
|
||
|
private:
|
||
|
json loadjson();
|
||
|
std::string DEVICEJSONPATH;
|
||
|
|
||
|
public:
|
||
|
jsonconfig();
|
||
|
jsonconfig(int devnum);
|
||
|
~jsonconfig();
|
||
|
std::string getdeviceparam(unsigned param_no);
|
||
|
};
|