ParameterDMLParser.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /*
  2. * TI Voxel Lib component.
  3. *
  4. * Copyright (c) 2014 Texas Instruments Inc.
  5. */
  6. #ifndef VOXEL_PARAMETERDMLPARSER_H
  7. #define VOXEL_PARAMETERDMLPARSER_H
  8. #include "TinyXML2.h"
  9. #include "Common.h"
  10. #include "Parameter.h"
  11. namespace Voxel
  12. {
  13. /**
  14. * \addtogroup Param
  15. * @{
  16. */
  17. class VOXEL_EXPORT ParameterDMLParser
  18. {
  19. protected:
  20. TinyXML2::XMLDocument _doc;
  21. TinyXML2::XMLElement *_regMap, *_propertyList, *_sectionList;
  22. uint8_t _wordLength;
  23. String _xmlFileName;
  24. RegisterProgrammer &_registerProgrammer;
  25. bool _initialized = false;
  26. bool _prepare();
  27. TinyXML2::XMLElement *_goTo(TinyXML2::XMLElement *current, const Vector<String> &nodeNameList, bool report = true); // by default report error
  28. ParameterPtr _getParameter(TinyXML2::XMLElement *property, String &id, bool &skipIfNull); // Get parameter and ID
  29. public:
  30. ParameterDMLParser(RegisterProgrammer &registerProgrammer, const String &xmlFileName);
  31. inline bool isInitialized() { return _initialized; }
  32. bool getParameters(Vector<ParameterPtr> &parameters);
  33. virtual ~ParameterDMLParser() {}
  34. };
  35. /**
  36. * @}
  37. */
  38. }
  39. #endif // PARAMETERDMLPARSER_H