XMLReader.hpp 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*
  2. * Author: Patrick-Christopher Mattulat
  3. * Company: Lynar Studios
  4. * E-Mail: webmaster@lynarstudios.com
  5. * Created: 2020-10-08
  6. * Changed: 2020-11-26
  7. *
  8. * */
  9. #ifndef LS_STD_XML_READER_HPP
  10. #define LS_STD_XML_READER_HPP
  11. #include <ls_std/base/Class.hpp>
  12. #include "XMLDocument.hpp"
  13. #include <ls_std/io/IReader.hpp>
  14. #include <ls_std/io/File.hpp>
  15. #include "XMLParseMode.hpp"
  16. #include "XMLParseData.hpp"
  17. #include <list>
  18. namespace ls_std {
  19. class XMLReader : public Class, public IReader {
  20. public:
  21. explicit XMLReader(const std::shared_ptr<ls_std::XMLDocument>& _document, const std::string& _absolutePath);
  22. ~XMLReader() override = default;
  23. // implementation
  24. ls_std::byte_field read() override;
  25. // additional functionality
  26. std::shared_ptr<ls_std::XMLDocument> getDocument();
  27. void setDocument(const std::shared_ptr<ls_std::XMLDocument>& _document);
  28. void setFile(const ls_std::File& _xmlFile);
  29. private:
  30. std::shared_ptr<ls_std::XMLDocument> document {};
  31. ls_std::File xmlFile;
  32. void _assignDocument(const std::shared_ptr<ls_std::XMLDocument>& _document);
  33. void _assignFile(ls_std::File _xmlFile);
  34. };
  35. }
  36. #endif