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/Wasabi/api/xml/xmlparamsi.h | |
| parent | 537bcbc86291b32fc04ae4133ce4d7cac8ebe9a7 (diff) | |
| download | winamp-20d28e80a5c861a9d5f449ea911ab75b4f37ad0d.tar.gz | |
Initial community commit
Diffstat (limited to 'Src/Wasabi/api/xml/xmlparamsi.h')
| -rw-r--r-- | Src/Wasabi/api/xml/xmlparamsi.h | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/Src/Wasabi/api/xml/xmlparamsi.h b/Src/Wasabi/api/xml/xmlparamsi.h new file mode 100644 index 00000000..606c462c --- /dev/null +++ b/Src/Wasabi/api/xml/xmlparamsi.h @@ -0,0 +1,52 @@ +#ifndef __XMLPARAMSI_H +#define __XMLPARAMSI_H + +#include <bfc/dispatch.h> +#include <bfc/string/bfcstring.h> +#include <bfc/ptrlist.h> +#include <bfc/string/StringW.h> + +/*<?<autoheader/>*/ +#include <api/xml/xmlparams.h> +#include <api/xml/xmlparamsx.h> +/*?>*/ + + +class XmlReaderParamsI : public XmlReaderParamsX +{ +public: + XmlReaderParamsI() {} + virtual ~XmlReaderParamsI(); + + DISPATCH(100) const wchar_t *getItemName(int i); + DISPATCH(200) const wchar_t *getItemValue(int i); + DISPATCH(201) const wchar_t *getItemValue(const wchar_t *name); + DISPATCH(202) const wchar_t *enumItemValues(const wchar_t *name, int nb); + DISPATCH(300) int getItemValueInt(const wchar_t *name, int def = 0); + DISPATCH(400) int getNbItems(); + + DISPATCH(500) void addItem(const wchar_t *parm, const wchar_t *value); + DISPATCH(600) void removeItem(const wchar_t *parm); + DISPATCH(700) void replaceItem(const wchar_t *parm, const wchar_t *value); + DISPATCH(800) int findItem(const wchar_t *parm); + + NODISPATCH void addItemSwapValue(const wchar_t *parm, StringW &value); // calling this will destroy your String... here for optimization ... +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; + }; + PtrList<parms_struct> parms_list; +}; + + +#endif |
