2022-10-03 07:46:41 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
#include "MarkdownContentParser.h"
|
|
|
|
|
|
|
|
class ContentFile
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
ContentFile(const std::string& filename)
|
|
|
|
: mFilename(filename)
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~ContentFile() = default;
|
|
|
|
|
|
|
|
std::string getFilename() const
|
|
|
|
{
|
|
|
|
return mFilename;
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual void load() = 0;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
std::string mFilename;
|
|
|
|
};
|
|
|
|
|
|
|
|
class ContentPage : public ContentFile
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
ContentPage(const std::string& filename)
|
|
|
|
: ContentFile(filename)
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
void load() override
|
|
|
|
{
|
|
|
|
MarkdownContentParser parser;
|
|
|
|
parser.run(mFilename);
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
class ContentArticle : public ContentFile
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
ContentArticle(const std::string& filename)
|
|
|
|
: ContentFile(filename)
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
void load() override
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
};
|