stuff-from-scratch/apps/website-generator/WebsiteGenerator.h
2023-12-21 09:18:44 +00:00

55 lines
934 B
C++

#pragma once
#include "String.h"
#include <iostream>
#include <filesystem>
#include <unordered_map>
#include "Vector.h"
using Path = std::filesystem::path;
class SiteGeneratorConfig;
class ContentPage;
class ContentArticle;
class TemplatingEngine;
class WebsiteGenerator
{
public:
WebsiteGenerator();
~WebsiteGenerator();
void doSubstitutions();
void findProject(const String& searchPath);
void parseContentFiles();
void parseTemplateFiles();
void readConfig();
void write();
private:
void findContentFiles();
Path getContentPath() const;
Path getPagesPath() const;
Path getArticlesPath() const;
Path getConfigPath() const;
Path getOutputPath() const;
std::filesystem::path mProjectPath;
Ptr<SiteGeneratorConfig> mConfig;
Ptr<TemplatingEngine> mTemplateEngine;
Vector<Ptr<ContentPage> > mPages;
Vector<Ptr<ContentArticle> > mArticles;
};