22 lines
510 B
C++
22 lines
510 B
C++
#pragma once
|
|
|
|
#include "String.h"
|
|
#include <optional>
|
|
#include <unordered_map>
|
|
#include <filesystem>
|
|
#include "Vector.h"
|
|
|
|
using Path = std::filesystem::path;
|
|
|
|
class MarkdownDocument;
|
|
|
|
class MarkdownContentParser
|
|
{
|
|
public:
|
|
using FileMetadataItem = std::pair<String, String>;
|
|
using FileMetadata = std::unordered_map<String, String>;
|
|
|
|
std::pair<FileMetadata, Ptr<MarkdownDocument>> run(const Path& path);
|
|
private:
|
|
std::optional<FileMetadataItem> checkForMetadataItem(const String& line) const;
|
|
};
|