file.hpp (1038B)
1 #ifndef UUID_61A5519F_6624_43C0_8451_0BCA60B5D69A 2 #define UUID_61A5519F_6624_43C0_8451_0BCA60B5D69A 3 #pragma once 4 5 #include "../../source.hpp" 6 #include "../../txt_serializable.hpp" 7 #include "../context.hpp" 8 9 namespace Neptools::Stcm 10 { 11 class GbnlItem; 12 13 class File final : public Context, public TxtSerializable 14 { 15 LIBSHIT_DYNAMIC_OBJECT; 16 17 template <typename T> 18 using GbnlVectG = std::vector<Libshit::NotNull<Libshit::SmartPtr<T>>>; 19 20 GbnlItem* first_gbnl = nullptr; 21 22 public: 23 File() = default; 24 File(Source src); 25 26 LIBSHIT_NOLUA void SetGbnl(GbnlItem& gbnl) noexcept; 27 LIBSHIT_NOLUA void UnsetGbnl(GbnlItem& gbnl) noexcept 28 { if (first_gbnl == &gbnl) first_gbnl = nullptr; } 29 GbnlItem* GetGbnl() const noexcept { return first_gbnl; }; 30 31 void Gc() noexcept; 32 33 protected: 34 void Inspect_(std::ostream& os, unsigned indent) const override; 35 36 private: 37 void Parse_(Source& src); 38 39 void WriteTxt_(std::ostream& os) const override; 40 void ReadTxt_(std::istream& is) override; 41 }; 42 43 } 44 #endif