From 20d28e80a5c861a9d5f449ea911ab75b4f37ad0d Mon Sep 17 00:00:00 2001 From: Jef Date: Tue, 24 Sep 2024 14:54:57 +0200 Subject: Initial community commit --- Src/Winamp/ParamList.h | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 Src/Winamp/ParamList.h (limited to 'Src/Winamp/ParamList.h') 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 +#include +#include + +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_list; +}; \ No newline at end of file -- cgit