SectionPairDocument.hpp 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*
  2. * Author: Patrick-Christopher Mattulat
  3. * Company: Lynar Studios
  4. * E-Mail: webmaster@lynarstudios.com
  5. * Created: 2023-02-15
  6. * Changed: 2023-02-16
  7. *
  8. * */
  9. #ifndef LS_STD_SECTION_PAIR_DOCUMENT_HPP
  10. #define LS_STD_SECTION_PAIR_DOCUMENT_HPP
  11. #include <ls-std/core/Class.hpp>
  12. #include <ls-std/io/section-pair/SectionPairTypes.hpp>
  13. #include <ls-std/io/section-pair/type/SectionPairDocumentTypes.hpp>
  14. #include <ls-std/os/dynamic-goal.hpp>
  15. namespace ls::std::io
  16. {
  17. class LS_STD_DYNAMIC_GOAL SectionPairDocument : public ls::std::core::Class
  18. {
  19. public:
  20. SectionPairDocument();
  21. ~SectionPairDocument() override;
  22. void add(const section_pair_document_section_list_element &_section);
  23. [[nodiscard]] section_pair_document_section_list_element get(size_t _index);
  24. [[nodiscard]] size_t getAmountOfSections();
  25. [[nodiscard]] ::std::string getHeader();
  26. [[nodiscard]] section_pair_document_section_list getSectionList();
  27. private:
  28. const ::std::string header = "# section-pair document";
  29. ls::std::io::section_pair_document_section_list sections{};
  30. void _checkSectionExistence(const ls::std::io::section_pair_identifier &_sectionId);
  31. [[nodiscard]] bool _hasSection(const ls::std::io::section_pair_identifier &_identifier);
  32. };
  33. }
  34. #endif