aboutsummaryrefslogtreecommitdiff
path: root/Src/Wasabi/api/xml/xmlparamsi.h
blob: 606c462c640589a76b13a48422005a1645aae6cf (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
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