XmlReader.hpp 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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::std::io
  20. {
  21. class LS_STD_DYNAMIC_GOAL XmlReader : public ls::std::core::Class, public ls::std::core::interface_type::IReader
  22. {
  23. public:
  24. explicit XmlReader(const ::std::shared_ptr<ls::std::io::XmlDocument> &_document, const ::std::string &_absolutePath);
  25. ~XmlReader() override = default;
  26. // implementation
  27. ls::std::core::type::byte_field read() override;
  28. // additional functionality
  29. ::std::shared_ptr<ls::std::io::XmlDocument> getDocument();
  30. void setDocument(const ::std::shared_ptr<ls::std::io::XmlDocument> &_document);
  31. void setFile(const ls::std::io::File &_xmlFile);
  32. private:
  33. ::std::shared_ptr<ls::std::io::XmlDocument> document{};
  34. ls::std::io::File xmlFile;
  35. void _assignDocument(const ::std::shared_ptr<ls::std::io::XmlDocument> &_document);
  36. void _assignFile(ls::std::io::File _xmlFile);
  37. };
  38. }
  39. #endif