stuff-from-scratch/apps/website-generator/ContentFile.h
2022-10-03 08:46:41 +01:00

62 lines
813 B
C++

#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
{
}
};