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/Winamp/ParamList.h | |
parent | 537bcbc86291b32fc04ae4133ce4d7cac8ebe9a7 (diff) | |
download | winamp-20d28e80a5c861a9d5f449ea911ab75b4f37ad0d.tar.gz |
Initial community commit
Diffstat (limited to 'Src/Winamp/ParamList.h')
-rw-r--r-- | Src/Winamp/ParamList.h | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/Src/Winamp/ParamList.h b/Src/Winamp/ParamList.h new file mode 100644 index 00000000..4baa2257 --- /dev/null +++ b/Src/Winamp/ParamList.h @@ -0,0 +1,42 @@ +#pragma once +#include "../xml/ifc_xmlreaderparams.h" +#include <vector> +#include <bfc/string/stringw.h> +#include <bfc/wasabi_std.h> + +class ParamList : public ifc_xmlreaderparams +{ +public: + ParamList() {} + ~ParamList(); + + const wchar_t *getItemName(int i); + const wchar_t *getItemValueIndex(int i); + const wchar_t *getItemValue(const wchar_t *name); + const wchar_t *enumItemValues(const wchar_t *name, int nb); + int getItemValueInt(const wchar_t *name, int def = 0); + size_t getNbItems(); + + void addItem(const wchar_t *parm, const wchar_t *value); + void removeItem(const wchar_t *parm); + void replaceItem(const wchar_t *parm, const wchar_t *value); + int findItem(const wchar_t *parm); + +protected: + RECVS_DISPATCH; +private: + struct parms_struct + { + parms_struct() : parm(0), ownValue(false) + {} + ~parms_struct() + { + if (ownValue) + FREE((wchar_t *)parm); + } + const wchar_t *parm; + StringW value; + bool ownValue; + }; + std::vector<parms_struct*> parms_list; +};
\ No newline at end of file |