XmlReader.hpp 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /*
  2. * Author: Patrick-Christopher Mattulat
  3. * Company: Lynar Studios
  4. * E-Mail: webmaster@lynarstudios.com
  5. * Created: 2020-10-08
  6. * Changed: 2022-07-03
  7. *
  8. * */
  9. #ifndef LS_STD_XML_READER_HPP
  10. #define LS_STD_XML_READER_HPP
  11. #include <ls_std/core/Class.hpp>
  12. #include "XmlDocument.hpp"
  13. #include <ls_std/core/interface/IReader.hpp>
  14. #include <ls_std/io/File.hpp>
  15. #include "XmlParseMode.hpp"
  16. #include "XmlParseParameter.hpp"
  17. #include <list>
  18. #include <ls_std/os/dynamic_goal.hpp>
  19. namespace ls
  20. {
  21. namespace std
  22. {
  23. namespace io
  24. {
  25. class LS_STD_DYNAMIC_GOAL XmlReader : public ls::std::core::Class, public ls::std::core::interface_type::IReader
  26. {
  27. public:
  28. explicit XmlReader(const ::std::shared_ptr<ls::std::io::XmlDocument> &_document, const ::std::string &_absolutePath);
  29. ~XmlReader() override = default;
  30. // implementation
  31. ls::std::core::type::byte_field read() override;
  32. // additional functionality
  33. ::std::shared_ptr<ls::std::io::XmlDocument> getDocument();
  34. void setDocument(const ::std::shared_ptr<ls::std::io::XmlDocument> &_document);
  35. void setFile(const ls::std::io::File &_xmlFile);
  36. private:
  37. ::std::shared_ptr<ls::std::io::XmlDocument> document{};
  38. ls::std::io::File xmlFile;
  39. void _assignDocument(const ::std::shared_ptr<ls::std::io::XmlDocument> &_document);
  40. void _assignFile(ls::std::io::File _xmlFile);
  41. };
  42. }
  43. }
  44. }
  45. #endif