hyprlang/src/config.hpp

32 lines
1 KiB
C++
Raw Normal View History

#include "public.hpp"
#include <unordered_map>
#include <string>
#include <vector>
2023-12-28 23:25:43 +01:00
struct SHandler {
std::string name = "";
Hyprlang::SHandlerOptions options;
Hyprlang::PCONFIGHANDLERFUNC func = nullptr;
};
2023-12-29 11:40:08 +01:00
struct SVariable {
std::string name = "";
std::string value = "";
std::vector<std::string> linesContainingVar; // for dynamic updates
2023-12-29 11:40:08 +01:00
};
class CConfigImpl {
public:
std::string path = "";
std::unordered_map<std::string, Hyprlang::CConfigValue> values;
std::unordered_map<std::string, Hyprlang::CConfigValue> defaultValues;
2023-12-28 23:25:43 +01:00
std::vector<SHandler> handlers;
2023-12-29 11:40:08 +01:00
std::vector<SVariable> variables;
2023-12-29 12:01:01 +01:00
std::vector<SVariable> envVariables;
std::vector<std::string> categories;
std::string parseError = "";
};