diff options
author | Jef <jef@targetspot.com> | 2024-09-24 08:54:57 -0400 |
---|---|---|
committer | Jef <jef@targetspot.com> | 2024-09-24 08:54:57 -0400 |
commit | 20d28e80a5c861a9d5f449ea911ab75b4f37ad0d (patch) | |
tree | 12f17f78986871dd2cfb0a56e5e93b545c1ae0d0 /Src/Plugins/General/gen_crasher/config.h | |
parent | 537bcbc86291b32fc04ae4133ce4d7cac8ebe9a7 (diff) | |
download | winamp-20d28e80a5c861a9d5f449ea911ab75b4f37ad0d.tar.gz |
Initial community commit
Diffstat (limited to 'Src/Plugins/General/gen_crasher/config.h')
-rw-r--r-- | Src/Plugins/General/gen_crasher/config.h | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/Src/Plugins/General/gen_crasher/config.h b/Src/Plugins/General/gen_crasher/config.h new file mode 100644 index 00000000..1016b570 --- /dev/null +++ b/Src/Plugins/General/gen_crasher/config.h @@ -0,0 +1,62 @@ +#ifndef NULLSOFT_CONFIG_H_ +#define NULLSOFT_CONFIG_H_ + +#include <windows.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <memory.h> + +#define BUFF_SIZE 8192 + +class ConfigW +{ +public: + ConfigW(); + ConfigW(const wchar_t *ini, const wchar_t *section); + ~ConfigW(); + +public: + void Flush(void); + + BOOL Write(const wchar_t *name, double value); + BOOL Write(const wchar_t *section, const wchar_t *name, double value); + BOOL Write(const wchar_t *name, long long value); + BOOL Write(const wchar_t *section, const wchar_t *name, long long value); + BOOL Write(const wchar_t *name, int value); + BOOL Write(const wchar_t *section, const wchar_t *name, int value); + BOOL Write(const wchar_t *name, const wchar_t *value); + BOOL Write(const wchar_t *section, const wchar_t *name, const wchar_t *value); + BOOL Write(const wchar_t *name, const char value); + BOOL Write(const wchar_t *section, const wchar_t *name, const char *value); + + int ReadInt(const wchar_t *name, int defvalue); + long long ReadInt64(const wchar_t *name, long long defvalue); + double ReadDouble(const wchar_t *name, double defvalue); + const char* ReadStringA(const wchar_t *name, const char *defvalue); + const wchar_t* ReadStringW(const wchar_t *name, const wchar_t *defvalue); + int ReadInt(const wchar_t *section, const wchar_t *name, int defvalue); + long long ReadInt64(const wchar_t *section, const wchar_t *name, long long defvalue); + double ReadDouble(const wchar_t *section, const wchar_t *name, double defvalue); + const char* ReadStringA(const wchar_t *section, const wchar_t *name, const char *defvalue); + const wchar_t* ReadStringW(const wchar_t *section, const wchar_t *name, const wchar_t *defvalue); + + BOOL SetSection(const wchar_t *section); + BOOL SetIniFile(const wchar_t *file); + BOOL IsFileExist(void); + + const wchar_t* GetSection(void); + const wchar_t* GetFile(void); +private: + HANDLE CreateFileHandle(); + void CreateFileWithBOM(void); + void RemoveEmptyFile(void); +private: + BOOL emptyBOM; + wchar_t buff[BUFF_SIZE]; + char *buffA; + wchar_t *fileName; + wchar_t *defSection; +}; + +#endif //NULLSOFT_CONFIG_H_
\ No newline at end of file |