XMLReader.hpp 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*
  2. * Author: Patrick-Christopher Mattulat
  3. * Company: Lynar Studios
  4. * E-Mail: webmaster@lynarstudios.com
  5. * Created: 2020-10-08
  6. * Changed: 2021-04-23
  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. {
  20. class XMLReader : public Class, public IReader
  21. {
  22. public:
  23. explicit XMLReader(const std::shared_ptr<ls_std::XMLDocument> &_document, const std::string &_absolutePath);
  24. ~XMLReader() override = default;
  25. // implementation
  26. ls_std::byte_field read() override;
  27. // additional functionality
  28. std::shared_ptr<ls_std::XMLDocument> getDocument();
  29. void setDocument(const std::shared_ptr<ls_std::XMLDocument> &_document);
  30. void setFile(const ls_std::File &_xmlFile);
  31. private:
  32. std::shared_ptr<ls_std::XMLDocument> document{};
  33. ls_std::File xmlFile;
  34. void _assignDocument(const std::shared_ptr<ls_std::XMLDocument> &_document);
  35. void _assignFile(ls_std::File _xmlFile);
  36. };
  37. }
  38. #endif