diff options
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 |