XMLSerializationTest.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. //
  2. // Copyright (C) 2014 Christian Schüller <schuellchr@gmail.com>
  3. //
  4. // This Source Code Form is subject to the terms of the Mozilla Public License
  5. // v. 2.0. If a copy of the MPL was not distributed with this file, You can
  6. // obtain one at http://mozilla.org/MPL/2.0/.
  7. ------------------------------------------------------------------------------
  8. Used to demonstrates howto use the XMLSerialization class.
  9. ----------------------------------------------------------------------------*/
  10. #ifndef IGL_XML_SERIALIZATION_TEST_H
  11. #define IGL_XML_SERIALIZATION_TEST_H
  12. #include <igl/xml/XMLSerialization.h>
  13. namespace igl
  14. {
  15. class XMLSerializationTest : public ::igl::XMLSerialization
  16. {
  17. public:
  18. int testInt;
  19. std::vector<float> testVector;
  20. XMLSerializationTest();
  21. void InitSerialization();
  22. bool Test();
  23. };
  24. XMLSerializerTest::XMLSerializerTest()
  25. : XMLSerialization("testObject")
  26. {
  27. }
  28. void XMLSerializerTest::InitSerialization()
  29. {
  30. xmlSerializer->Add(testInt,"testInt");
  31. xmlSerializer->Add(testVector,"testVector");
  32. testInt = 10;
  33. testVector.push_back(1.0001f);
  34. testVector.push_back(2.0001f);
  35. testVector.push_back(3.0001f);
  36. }
  37. }
  38. #endif