ccacic.h
2.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#ifndef CCACIC_H
#define CCACIC_H
#include <QCoreApplication>
#include <QProcess>
#include <QObject>
#include <QFile>
#include <QSettings>
#include <QDir>
#include <QDebug>
#include <QJsonDocument>
#include <QJsonObject>
#include <QJsonValue>
#include <sstream>
#include <iostream>
#include <string>
#include "../src/crypto++/include/aes.h"
#include "../src/crypto++/include/base64.h"
#include "../src/crypto++/include/modes.h"
#include <QCryptographicHash>
class CCacic
{
public:
CCacic();
QString getValueFromFile(QString sectionName, QString keyName, QString filePath);
void setValueToFile(QString sectionName, QString keyName, QString value, QString filePath);
QString getValueFromTags(QString fullString, QString tag, QString tagType = "[]");
QString enCrypt(std::string str_in, std::string iv);
QString deCrypt(std::string str_in, std::string iv);
bool createFolder(QString path);
bool deleteFolder(QString path);
bool deleteFile(QString path);
QJsonValue jsonValueFromJsonString(QString json, QString key);
bool setJsonToFile(QJsonObject json, QString filepath);
QJsonObject getJsonFromFile(QString filepath);
QString startProcess(QString pathprogram, bool wait, bool *ok, QStringList arguments = QStringList());
void setValueToRegistry(QString organization, QString application, QVariantMap values);
QVariant getValueFromRegistry(QString organization, QString application, QString key);
void removeRegistry(QString organization, QString application);
QString convertDouble(const double &number, const int &precision = 10);
std::string genRandomString(const int &len = 32);
//Geters/seters:
QString getCacicMainFolder() const;
void setCacicMainFolder(const QString &value);
QString getMainModuleName() const;
void setMainModuleName(const QString &value);
QString getUrlGerente() const;
void setUrlGerente(const QString &value);
QString getGerColsInfFilePath() const;
void setGerColsInfFilePath(const QString &value);
QString getChksisInfFilePath() const;
void setChksisInfFilePath(const QString &value);
QString getChaveCrypt() const;
void setChaveCrypt(const QString &value);
bool Md5IsEqual(QVariant document01, QVariant document02);
bool Md5IsEqual(QVariant document01, QString document02);
private:
QString cacicMainFolder;
QString mainModuleName;
QString urlGerente;
QString gerColsInfFilePath;
QString chksisInfFilePath;
QString chaveCrypt;
};
#endif // CCACIC_H