#pragma once #include "Vector.h" #include "String.h" #include class TemplateNode; class TemplateTextBody; using Path = std::filesystem::path; class TemplateFile { public: TemplateFile(const Path& path); ~TemplateFile(); String dumpContent(); String getName() const; TemplateNode* getContent() const; bool hasLoaded() const; void loadContent(); private: std::size_t checkForStatement(const String& lineSection); std::size_t checkForExpression(const String& lineSection); void onTextSpanFinished(); void onFoundStatement(const String& statement_string); void onFoundExpression(const String& expression_string); void onFoundBlock(const Vector args); void onFoundEndBlock(const Vector args); void onFoundExtends(const Vector args); void processLine(const String& line); Path mPath; String mParentName; Vector mRawContent; bool mHasLoaded{false}; Ptr mRootNode; TemplateNode* mWorkingNode{ nullptr }; String mWorkingLineContent; Ptr mWorkingTextSpan; };