XmlReader.hpp 1.5 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: 2023-05-17
  7. *
  8. * */
  9. #ifndef LS_STD_XML_READER_HPP
  10. #define LS_STD_XML_READER_HPP
  11. #include "XmlDocument.hpp"
  12. #include "XmlParseMode.hpp"
  13. #include "XmlParseParameter.hpp"
  14. #include <list>
  15. #include <ls-std/core/Class.hpp>
  16. #include <ls-std/core/interface/IReader.hpp>
  17. #include <ls-std/io/File.hpp>
  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() noexcept override;
  26. // implementation
  27. ls::std::core::type::byte_field read() override; // nodiscard is optional here
  28. // additional functionality
  29. [[nodiscard]] ::std::shared_ptr<ls::std::io::XmlDocument> getDocument() const;
  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 = ls::std::io::File{""};
  35. void _assignDocument(const ::std::shared_ptr<ls::std::io::XmlDocument> &_document);
  36. void _assignFile(const ls::std::io::File &_xmlFile);
  37. };
  38. }
  39. #endif