stuff-from-scratch/apps/website-generator/MarkdownContentParser.h
2022-10-09 17:39:46 +01:00

27 lines
612 B
C++

#pragma once
#include "File.h"
#include <string>
#include <optional>
#include <unordered_map>
class MarkdownContentParser
{
public:
using FileMetadataItem = std::pair<std::string, std::string>;
using FileMetadata = std::unordered_map<std::string, std::string>;
using FileContentBody = std::vector<std::string>;
void run(const Path& path);
FileContentBody getContentBody() const;
FileMetadata getFileMetadata() const;
private:
std::optional<FileMetadataItem> checkForMetadataItem(const std::string& line) const;
FileMetadata mMetadata;
FileContentBody mContentBody;
};