Do bulk replace of stl types.
This commit is contained in:
parent
521486be62
commit
c25a56ee19
531 changed files with 2274 additions and 2181 deletions
|
@ -23,7 +23,7 @@ Path ContentFile::getFilename() const
|
|||
return mFilename;
|
||||
}
|
||||
|
||||
std::string ContentFile::getOutputLocation() const
|
||||
String ContentFile::getOutputLocation() const
|
||||
{
|
||||
const auto metadata_item = getMetadataItem("save_as");
|
||||
return metadata_item.empty() ? PathUtils::getBaseFilename(mFilename) : metadata_item;
|
||||
|
@ -55,7 +55,7 @@ void ContentFile::doLinkTagSubstitution(const Path& basePath)
|
|||
}
|
||||
}
|
||||
|
||||
std::string ContentFile::getMetadataItem(const std::string& key) const
|
||||
String ContentFile::getMetadataItem(const String& key) const
|
||||
{
|
||||
const auto check = mMetadata.find(key);
|
||||
if (check == mMetadata.end())
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#include "MarkdownContentParser.h"
|
||||
#include "File.h"
|
||||
|
||||
#include <string>
|
||||
#include "String.h"
|
||||
#include <iostream>
|
||||
#include <unordered_map>
|
||||
|
||||
|
@ -12,8 +12,8 @@ class MarkdownDocument;
|
|||
class ContentFile
|
||||
{
|
||||
public:
|
||||
using FileMetadata = std::unordered_map<std::string, std::string>;
|
||||
using FileContentBody = std::vector<std::string>;
|
||||
using FileMetadata = std::unordered_map<String, String>;
|
||||
using FileContentBody = Vector<String>;
|
||||
|
||||
ContentFile(const Path& filename);
|
||||
|
||||
|
@ -23,9 +23,9 @@ public:
|
|||
|
||||
virtual void load();
|
||||
|
||||
std::string getMetadataItem(const std::string& key) const;
|
||||
String getMetadataItem(const String& key) const;
|
||||
|
||||
virtual std::string getOutputLocation() const;
|
||||
virtual String getOutputLocation() const;
|
||||
|
||||
MarkdownDocument* getContentBody() const
|
||||
{
|
||||
|
@ -36,15 +36,15 @@ public:
|
|||
|
||||
void write(const Path& path);
|
||||
|
||||
void setProcessedOutput(const std::string& output)
|
||||
void setProcessedOutput(const String& output)
|
||||
{
|
||||
mProcessedOutput = output;
|
||||
}
|
||||
protected:
|
||||
Path mFilename;
|
||||
FileMetadata mMetadata;
|
||||
std::unique_ptr<MarkdownDocument> mContentBody;
|
||||
std::string mProcessedOutput;
|
||||
Ptr<MarkdownDocument> mContentBody;
|
||||
String mProcessedOutput;
|
||||
};
|
||||
|
||||
class ContentArticle : public ContentFile
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
#include "File.h"
|
||||
|
||||
std::pair<MarkdownContentParser::FileMetadata, std::unique_ptr<MarkdownDocument>> MarkdownContentParser::run(const Path& path)
|
||||
std::pair<MarkdownContentParser::FileMetadata, Ptr<MarkdownDocument>> MarkdownContentParser::run(const Path& path)
|
||||
{
|
||||
FileMetadata metadata;
|
||||
FileMetadata output_metadata;
|
||||
|
@ -15,7 +15,7 @@ std::pair<MarkdownContentParser::FileMetadata, std::unique_ptr<MarkdownDocument>
|
|||
const auto lines = File(path).readLines();
|
||||
bool metadata_finished = false;
|
||||
|
||||
std::string content_body;
|
||||
String content_body;
|
||||
for (const auto& line : lines)
|
||||
{
|
||||
if (!metadata_finished)
|
||||
|
@ -54,11 +54,11 @@ std::pair<MarkdownContentParser::FileMetadata, std::unique_ptr<MarkdownDocument>
|
|||
return {output_metadata, std::move(document)};
|
||||
}
|
||||
|
||||
std::optional<MarkdownContentParser::FileMetadataItem> MarkdownContentParser::checkForMetadataItem(const std::string& line) const
|
||||
std::optional<MarkdownContentParser::FileMetadataItem> MarkdownContentParser::checkForMetadataItem(const String& line) const
|
||||
{
|
||||
unsigned char_count = 0;
|
||||
std::string prefix;
|
||||
std::string suffix;
|
||||
String prefix;
|
||||
String suffix;
|
||||
bool building_prefix = true;
|
||||
for (const auto c : line)
|
||||
{
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include "String.h"
|
||||
#include <optional>
|
||||
#include <unordered_map>
|
||||
#include <filesystem>
|
||||
#include <vector>
|
||||
#include "Vector.h"
|
||||
|
||||
using Path = std::filesystem::path;
|
||||
|
||||
|
@ -13,10 +13,10 @@ class MarkdownDocument;
|
|||
class MarkdownContentParser
|
||||
{
|
||||
public:
|
||||
using FileMetadataItem = std::pair<std::string, std::string>;
|
||||
using FileMetadata = std::unordered_map<std::string, std::string>;
|
||||
using FileMetadataItem = std::pair<String, String>;
|
||||
using FileMetadata = std::unordered_map<String, String>;
|
||||
|
||||
std::pair<FileMetadata, std::unique_ptr<MarkdownDocument>> run(const Path& path);
|
||||
std::pair<FileMetadata, Ptr<MarkdownDocument>> run(const Path& path);
|
||||
private:
|
||||
std::optional<FileMetadataItem> checkForMetadataItem(const std::string& line) const;
|
||||
std::optional<FileMetadataItem> checkForMetadataItem(const String& line) const;
|
||||
};
|
||||
|
|
|
@ -5,7 +5,7 @@ Path SiteGeneratorConfig::getThemePath() const
|
|||
return mThemesPath;
|
||||
}
|
||||
|
||||
std::string SiteGeneratorConfig::getActiveTheme() const
|
||||
String SiteGeneratorConfig::getActiveTheme() const
|
||||
{
|
||||
return mActiveTheme;
|
||||
}
|
||||
|
@ -15,7 +15,7 @@ void SiteGeneratorConfig::setThemePath(const Path& path)
|
|||
mThemesPath = path;
|
||||
}
|
||||
|
||||
void SiteGeneratorConfig::setActiveTheme(const std::string& theme)
|
||||
void SiteGeneratorConfig::setActiveTheme(const String& theme)
|
||||
{
|
||||
mActiveTheme = theme;
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include "String.h"
|
||||
#include <filesystem>
|
||||
|
||||
using Path = std::filesystem::path;
|
||||
|
@ -10,13 +10,13 @@ class SiteGeneratorConfig
|
|||
public:
|
||||
Path getThemePath() const;
|
||||
|
||||
std::string getActiveTheme() const;
|
||||
String getActiveTheme() const;
|
||||
|
||||
void setThemePath(const Path& path);
|
||||
|
||||
void setActiveTheme(const std::string& theme);
|
||||
void setActiveTheme(const String& theme);
|
||||
|
||||
private:
|
||||
Path mThemesPath;
|
||||
std::string mActiveTheme;
|
||||
String mActiveTheme;
|
||||
};
|
||||
|
|
|
@ -30,7 +30,7 @@ WebsiteGenerator::~WebsiteGenerator()
|
|||
|
||||
}
|
||||
|
||||
void WebsiteGenerator::findProject(const std::string& searchPath)
|
||||
void WebsiteGenerator::findProject(const String& searchPath)
|
||||
{
|
||||
const auto config_path = std::filesystem::path(searchPath) / "config.toml";
|
||||
if (std::filesystem::exists(config_path))
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include "String.h"
|
||||
#include <iostream>
|
||||
#include <filesystem>
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
#include "Vector.h"
|
||||
|
||||
using Path = std::filesystem::path;
|
||||
|
||||
|
@ -22,7 +22,7 @@ public:
|
|||
|
||||
void doSubstitutions();
|
||||
|
||||
void findProject(const std::string& searchPath);
|
||||
void findProject(const String& searchPath);
|
||||
|
||||
void parseContentFiles();
|
||||
|
||||
|
@ -47,9 +47,9 @@ private:
|
|||
|
||||
std::filesystem::path mProjectPath;
|
||||
|
||||
std::unique_ptr<SiteGeneratorConfig> mConfig;
|
||||
std::unique_ptr<TemplatingEngine> mTemplateEngine;
|
||||
Ptr<SiteGeneratorConfig> mConfig;
|
||||
Ptr<TemplatingEngine> mTemplateEngine;
|
||||
|
||||
std::vector<std::unique_ptr<ContentPage> > mPages;
|
||||
std::vector<std::unique_ptr<ContentArticle> > mArticles;
|
||||
Vector<Ptr<ContentPage> > mPages;
|
||||
Vector<Ptr<ContentArticle> > mArticles;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue