1
0

xmlparamsi.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #ifndef __XMLPARAMSI_H
  2. #define __XMLPARAMSI_H
  3. #include <bfc/dispatch.h>
  4. #include <bfc/string/bfcstring.h>
  5. #include <bfc/ptrlist.h>
  6. #include <bfc/string/StringW.h>
  7. /*<?<autoheader/>*/
  8. #include <api/xml/xmlparams.h>
  9. #include <api/xml/xmlparamsx.h>
  10. /*?>*/
  11. class XmlReaderParamsI : public XmlReaderParamsX
  12. {
  13. public:
  14. XmlReaderParamsI() {}
  15. virtual ~XmlReaderParamsI();
  16. DISPATCH(100) const wchar_t *getItemName(int i);
  17. DISPATCH(200) const wchar_t *getItemValue(int i);
  18. DISPATCH(201) const wchar_t *getItemValue(const wchar_t *name);
  19. DISPATCH(202) const wchar_t *enumItemValues(const wchar_t *name, int nb);
  20. DISPATCH(300) int getItemValueInt(const wchar_t *name, int def = 0);
  21. DISPATCH(400) int getNbItems();
  22. DISPATCH(500) void addItem(const wchar_t *parm, const wchar_t *value);
  23. DISPATCH(600) void removeItem(const wchar_t *parm);
  24. DISPATCH(700) void replaceItem(const wchar_t *parm, const wchar_t *value);
  25. DISPATCH(800) int findItem(const wchar_t *parm);
  26. NODISPATCH void addItemSwapValue(const wchar_t *parm, StringW &value); // calling this will destroy your String... here for optimization ...
  27. private:
  28. struct parms_struct
  29. {
  30. parms_struct() : parm(0), ownValue(false)
  31. {}
  32. ~parms_struct()
  33. {
  34. if (ownValue)
  35. FREE((wchar_t *)parm);
  36. }
  37. const wchar_t *parm;
  38. StringW value;
  39. bool ownValue;
  40. };
  41. PtrList<parms_struct> parms_list;
  42. };
  43. #endif