wip: settings in effect

This commit is contained in:
Hane 2024-12-06 17:55:46 +01:00
commit 1ae324b68a
8 changed files with 277 additions and 158 deletions

View file

@ -2,7 +2,7 @@
#include "global.h"
namespace ini {
//Trims spaces, LF and CRLF
static inline char* trimAndAllocate(const char* in, uint64_t len = 0) {
if (!in) return nullptr;
@ -51,7 +51,7 @@ namespace ini {
class UserSettings {
public:
UserSettings(char* path = nullptr);
static UserSettings* createSettings(const char* path = nullptr, bool create = false);
~UserSettings();
char* const getValue(char* key, uint64_t len = 0);
@ -63,11 +63,12 @@ class UserSettings {
private:
//void* returnValue();
UserSettings(char* text = nullptr);
//std::map<const char*, int> values{ {"show_channels", false}, {"test", 7} };
std::unordered_map<char*, char*, Djb12Hasher, StrcmpEqual> values;
char* textContents = nullptr;
uint64_t textContentsSize = 0;
//char* textContents = nullptr;
//uint64_t textContentsSize = 0;
char* pos = "true";
char* neg = "false";
};