ifc_xmlreaderparams.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. #ifndef NULLSOFT_XML_IFC_XMLREADERPARAMS_H
  2. #define NULLSOFT_XML_IFC_XMLREADERPARAMS_H
  3. #include <bfc/dispatch.h>
  4. #include <bfc/platform/types.h>
  5. // ----------------------------------------------------------------------------
  6. class NOVTABLE ifc_xmlreaderparams : public Dispatchable
  7. {
  8. protected:
  9. ifc_xmlreaderparams() {}
  10. virtual ~ifc_xmlreaderparams() {}
  11. public:
  12. const wchar_t *getItemName(size_t i);
  13. const wchar_t *getItemValue(size_t i);
  14. const wchar_t *getItemValue(const wchar_t *name);
  15. const wchar_t *enumItemValues(const wchar_t *name, size_t nb);
  16. int getItemValueInt(const wchar_t *name, int def = 0);
  17. size_t getNbItems();
  18. protected:
  19. DISPATCH_CODES
  20. {
  21. XMLREADERPARAMS_GETITEMNAME = 100,
  22. XMLREADERPARAMS_GETITEMVALUE = 200,
  23. XMLREADERPARAMS_GETITEMVALUE2 = 201,
  24. XMLREADERPARAMS_ENUMITEMVALUES = 202,
  25. XMLREADERPARAMS_GETITEMVALUEINT = 300,
  26. XMLREADERPARAMS_GETNBITEMS = 400,
  27. };
  28. };
  29. // ----------------------------------------------------------------------------
  30. inline const wchar_t *ifc_xmlreaderparams::getItemName(size_t i)
  31. {
  32. return _call(XMLREADERPARAMS_GETITEMNAME, (const wchar_t *)0, i);
  33. }
  34. inline const wchar_t *ifc_xmlreaderparams::getItemValue(size_t i)
  35. {
  36. return _call(XMLREADERPARAMS_GETITEMVALUE, (const wchar_t *)0, i);
  37. }
  38. inline const wchar_t *ifc_xmlreaderparams::getItemValue(const wchar_t *name)
  39. {
  40. return _call(XMLREADERPARAMS_GETITEMVALUE2, (const wchar_t *)0, name);
  41. }
  42. inline const wchar_t *ifc_xmlreaderparams::enumItemValues(const wchar_t *name, size_t nb)
  43. {
  44. return _call(XMLREADERPARAMS_ENUMITEMVALUES, (const wchar_t *)0, name, nb);
  45. }
  46. inline int ifc_xmlreaderparams::getItemValueInt(const wchar_t *name, int def)
  47. {
  48. return _call(XMLREADERPARAMS_GETITEMVALUEINT, (int)0, name, def);
  49. }
  50. inline size_t ifc_xmlreaderparams::getNbItems()
  51. {
  52. return _call(XMLREADERPARAMS_GETNBITEMS, (size_t)0);
  53. }
  54. #endif