#pragma once #include "MarkdownContentParser.h" #include "File.h" #include #include #include class MarkdownDocument; class ContentFile { public: using FileMetadata = std::unordered_map; using FileContentBody = std::vector; ContentFile(const Path& filename); virtual ~ContentFile(); Path getFilename() const; virtual void load(); std::string getMetadataItem(const std::string& key) const; virtual std::string getOutputLocation() const; MarkdownDocument* getContentBody() const { return mContentBody.get(); } void doLinkTagSubstitution(const Path& basePath); void write(const Path& path); void setProcessedOutput(const std::string& output) { mProcessedOutput = output; } protected: Path mFilename; FileMetadata mMetadata; std::unique_ptr mContentBody; std::string mProcessedOutput; }; class ContentArticle : public ContentFile { public: ContentArticle(const Path& filename) : ContentFile(filename) { } void load() override { ContentFile::load(); } };