twain2/JsonConfig.h

25 lines
726 B
C++

#pragma once
#include "PublicFunc.h"
#include <vector>
using namespace std;
class JsonConfig
{
public:
JsonConfig(void);
~JsonConfig(void);
public:
void WriteToJson(PCONFIGPARAMS pConfigItem,const std::string fileName,bool isConfigItem=true);
//PCONFIGPARAMS ReadJsonFromFile(const char* fileNames);
void WriteJsonData(const std::string fileName);
void WriteJsonArrayToFile(std::vector<CONFIGPARAMS> cfgArray,const std::string filename);
CONFIGPARAMS ReadDefaultConfig();
bool DeleteJsonFile(std::string path);
std::vector<CONFIGPARAMS> ReadJsonArrayFromFile(const std::string filename);
CONFIGPARAMS GetDefaultConfigParams();
private:
std::vector<CONFIGPARAMS> parseJsonFromString(const std::string str) ;
};