Adds prototype for mapping out pages for navigation sections

This commit is contained in:
Rosia E Evans 2023-10-09 13:53:09 +01:00
parent dc03e239d5
commit 2fbec8869d
14 changed files with 69 additions and 9 deletions

View file

@ -32,7 +32,7 @@ Page::Page(std::string sourceFileUrl, std::string outFolderUrl)
calculatePageFlags();
calculatePageTitle();
this->outFileUrl = outFolderUrl + getRelativeUrl();
this->outFileUrl = outFolderUrl + getRelativeOutUrl();
}
std::string Page::getSourceFileContents()
@ -40,12 +40,13 @@ std::string Page::getSourceFileContents()
return sourceFileContents;
}
std::string Page::getOutFileUrl()
std::string Page::getOutUrl()
{
return outFileUrl;
}
std::string Page::getRelativeUrl()
// includes first /
std::string Page::getRelativeOutUrl()
{
int start = sourceFileUrl.find_last_of("/");
std::string relativeUrl = std::string(sourceFileUrl).substr(start, sourceFileUrl.length()-start);
@ -53,6 +54,20 @@ std::string Page::getRelativeUrl()
return relativeUrl;
}
std::string Page::getInUrl()
{
return sourceFileUrl;
}
// includes first /
std::string Page::getRelativeInUrl()
{
int start = strlen(SOURCE_FILE_FOLDER)+1;
std::string relativeUrl = std::string(sourceFileUrl).substr(start, sourceFileUrl.length()-start);
relativeUrl.replace(relativeUrl.length()-3, 3, ".html");
return relativeUrl;
}
FileFlags Page::getPageFlags()
{
return flags;