1
0

ParamList.h 986 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #pragma once
  2. #include "../xml/ifc_xmlreaderparams.h"
  3. #include <vector>
  4. #include <bfc/string/stringw.h>
  5. #include <bfc/wasabi_std.h>
  6. class ParamList : public ifc_xmlreaderparams
  7. {
  8. public:
  9. ParamList() {}
  10. ~ParamList();
  11. const wchar_t *getItemName(int i);
  12. const wchar_t *getItemValueIndex(int i);
  13. const wchar_t *getItemValue(const wchar_t *name);
  14. const wchar_t *enumItemValues(const wchar_t *name, int nb);
  15. int getItemValueInt(const wchar_t *name, int def = 0);
  16. size_t getNbItems();
  17. void addItem(const wchar_t *parm, const wchar_t *value);
  18. void removeItem(const wchar_t *parm);
  19. void replaceItem(const wchar_t *parm, const wchar_t *value);
  20. int findItem(const wchar_t *parm);
  21. protected:
  22. RECVS_DISPATCH;
  23. private:
  24. struct parms_struct
  25. {
  26. parms_struct() : parm(0), ownValue(false)
  27. {}
  28. ~parms_struct()
  29. {
  30. if (ownValue)
  31. FREE((wchar_t *)parm);
  32. }
  33. const wchar_t *parm;
  34. StringW value;
  35. bool ownValue;
  36. };
  37. std::vector<parms_struct*> parms_list;
  38. };