Hotspot UI

This commit is contained in:
Robin Davies
2021-08-22 11:51:09 -04:00
parent f6aa331d77
commit 865e23b413
51 changed files with 918 additions and 146 deletions
+39
View File
@@ -0,0 +1,39 @@
#pragma once
#include <boost/filesystem.hpp>
namespace pipedal {
class SystemConfigFile {
boost::filesystem::path currentPath;
std::vector<std::string> lines;
void SetLine(int64_t lineIndex,const std::string&key,const std::string &value );
bool LineMatches(const std::string &line, const std::string&key) const;
public:
SystemConfigFile() {
}
SystemConfigFile(const boost::filesystem::path& path)
{
Load(path);
}
void Load(const boost::filesystem::path&path);
void Save(std::ostream &os);
void Save(const boost::filesystem::path&path);
void Save();
int64_t GetLine(const std::string &key) const;
bool HasValue(const std::string&key) const;
bool Get(const std::string&key,std::string*pResult) const;
std::string Get(const std::string&key) const;
void Set(const std::string&key,const std::string &value);
void Set(const std::string&key,const std::string &value, bool overwrite);
void Set(const std::string&key,const std::string &value, const std::string&comment);
bool Erase(const std::string&key);
int64_t Insert(int64_t position, const std::string&key, const std::string&value);
int64_t Insert(int64_t position, const std::string&line);
};
};