XmlReader.hpp 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*
  2. * Author: Patrick-Christopher Mattulat
  3. * Company: Lynar Studios
  4. * E-Mail: webmaster@lynarstudios.com
  5. * Created: 2020-10-08
  6. * Changed: 2024-09-09
  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. /*
  20. * @doc: class(name: 'XmlReader', package: 'io')
  21. * */
  22. namespace ls::std::io
  23. {
  24. class LS_STD_DYNAMIC_GOAL XmlReader : public ls::std::core::Class, public ls::std::core::interface_type::IReader
  25. {
  26. public:
  27. explicit XmlReader(const ::std::shared_ptr<ls::std::io::XmlDocument> &_document, const ::std::string &_absolutePath);
  28. ~XmlReader() noexcept override;
  29. // implementation
  30. ls::std::core::type::byte_field read() override; // nodiscard is optional here
  31. // additional functionality
  32. [[nodiscard]] ::std::shared_ptr<ls::std::io::XmlDocument> getDocument() const;
  33. void setDocument(const ::std::shared_ptr<ls::std::io::XmlDocument> &_document);
  34. void setFile(const ls::std::io::File &_xmlFile);
  35. private:
  36. ::std::shared_ptr<ls::std::io::XmlDocument> document{};
  37. ls::std::io::File xmlFile = ls::std::io::File{""};
  38. void _assignDocument(const ::std::shared_ptr<ls::std::io::XmlDocument> &_document);
  39. void _assignFile(const ls::std::io::File &_xmlFile);
  40. };
  41. }
  42. #endif