removes un-needed files

This commit is contained in:
root 2023-09-29 00:18:01 +00:00
parent 995d16a874
commit 9f66d8ad94
16 changed files with 0 additions and 413 deletions

Binary file not shown.

View file

@ -1,33 +0,0 @@
#include <iostream>
#include "PageFactory.h"
int main()
{
PageFactory* pageFactory = new PageFactory();
pageFactory->buildPage("#Hello world");
std::cout << pageFactory->getPage();
}
/**
* ####### The Plan #######
* We have a factory, this contains a dictionary with a reference to a load of static objects(?)
* This dictionary is built on startup, each object has a start and end tag and the dictionary holds both
* (its given these on build)
* The factory goes through a given text fileand for each character, checks if its in the dictionary,
* if it is we call that object and pass it all the text until its end char. It will then produce
* output html that is stored in the factory as that page.
*
* Main issues with this:
* We cant have components of a page inside each other :(
* We'll deal with this later
*
* Also, are we building this page on each request? if so how does the user request a file that doesnt exist?
* I guess these are questions for oat++ to answer
*/
/*
BIG ISSUE:
we need our identifiers to be char[]'s since we have things like ## which is more than one char.
*/

View file

@ -1,31 +0,0 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.3.32901.215
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BlogParser", "BlogParser.vcxproj", "{8691FEF7-3635-4958-8DE1-70B3A0D439E5}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{8691FEF7-3635-4958-8DE1-70B3A0D439E5}.Debug|x64.ActiveCfg = Debug|x64
{8691FEF7-3635-4958-8DE1-70B3A0D439E5}.Debug|x64.Build.0 = Debug|x64
{8691FEF7-3635-4958-8DE1-70B3A0D439E5}.Debug|x86.ActiveCfg = Debug|Win32
{8691FEF7-3635-4958-8DE1-70B3A0D439E5}.Debug|x86.Build.0 = Debug|Win32
{8691FEF7-3635-4958-8DE1-70B3A0D439E5}.Release|x64.ActiveCfg = Release|x64
{8691FEF7-3635-4958-8DE1-70B3A0D439E5}.Release|x64.Build.0 = Release|x64
{8691FEF7-3635-4958-8DE1-70B3A0D439E5}.Release|x86.ActiveCfg = Release|Win32
{8691FEF7-3635-4958-8DE1-70B3A0D439E5}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {70669855-DF9B-4D65-9364-ED1AFEACF708}
EndGlobalSection
EndGlobal

View file

@ -1,144 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>16.0</VCProjectVersion>
<Keyword>Win32Proj</Keyword>
<ProjectGuid>{8691fef7-3635-4958-8de1-70b3a0d439e5}</ProjectGuid>
<RootNamespace>BlogParser</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="BlogParser.cpp" />
<ClCompile Include="Component.cpp" />
<ClCompile Include="Header.cpp" />
<ClCompile Include="PageFactory.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="Component.h" />
<ClInclude Include="ComponentList.h" />
<ClInclude Include="Header.h" />
<ClInclude Include="PageFactory.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View file

@ -1,51 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
<Filter Include="Source Files\Components">
<UniqueIdentifier>{99991709-bfaf-4089-ba9a-66292f776f3e}</UniqueIdentifier>
</Filter>
<Filter Include="Header Files\Components">
<UniqueIdentifier>{c445922c-4e2c-45ee-91eb-0f1d01e4d42c}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="BlogParser.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="PageFactory.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="Component.cpp">
<Filter>Source Files\Components</Filter>
</ClCompile>
<ClCompile Include="Header.cpp">
<Filter>Source Files\Components</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="PageFactory.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="ComponentList.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Component.h">
<Filter>Header Files\Components</Filter>
</ClInclude>
<ClInclude Include="Header.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
</Project>

View file

@ -1,4 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup />
</Project>

View file

@ -1 +0,0 @@
#include "Component.h"

View file

@ -1,10 +0,0 @@
#pragma once
class Component
{
public:
char startIdentifier;
char endIdentifier;
virtual std::string generateHTML(std::string markDown);
};

View file

@ -1,7 +0,0 @@
#pragma once
#include <vector>
#include "Component.h"
std::vector<Component> componentList = {
};

View file

@ -1,6 +0,0 @@
#include "Header.h"
std::string Header::generateHTML(std::string markDown)
{
return "<h1>" + markDown + "</h1>";
}

View file

@ -1,8 +0,0 @@
#pragma once
#include <string>
#include "Component.h"
class Header : public Component
{
std::string generateHTML(std::string markDown);
};

View file

@ -1,8 +0,0 @@
#pragma once
#define TEST_RESOURCE_FOLDER "/home/rosia/Programming/Cpp/BlogParser/Resources/Tests"
#define RESOURCE_FOLDER "/home/rosia/Programming/Cpp/BlogParser/Resources"
#define SOURCE_FILE_FOLDER "/home/rosia/Programming/Cpp/BlogParser/Resources/Input"
#define OUTPUT_FILE_FOLDER "/home/rosia/Programming/Cpp/BlogParser/Resources/Output"

View file

@ -1,48 +0,0 @@
#include "PageFactory.h"
PageFactory::PageFactory()
{
// generate component dictionary
for (Component component : componentList)
{
componentDictionary.push_back({ component.startIdentifier, &component });
}
}
void PageFactory::buildPage(std::string markDown)
{
Component* currentComponent;
bool readingChunk = false;
std::string currentChunk;
/*
Something worth noting here is that we dont pass the start
and end identifier into the component.
*/
for (char character : markDown)
{
if (readingChunk)
{
if (character == currentComponent->endIdentifier)
{
finalPage = currentComponent->generateHTML(currentChunk);
readingChunk = false;
currentChunk = "";
}
else
{
currentChunk.push_back(character);
}
}
else
{
// search dictionary to find a component
// if found, get component, set readingChunk to true
}
}
}
std::string PageFactory::getPage()
{
return finalPage;
}

View file

@ -1,25 +0,0 @@
#pragma once
#include <string>
#include <string.h>
#include "Component.h"
#include "ComponentList.h"
#include <vector>
class PageFactory
{
struct ComponentDictItem
{
char identifier;
Component* component;
};
std::vector<ComponentDictItem> componentDictionary;
std::string finalPage;
public:
PageFactory();
void buildPage(std::string markDown);
std::string getPage();
};

View file

@ -1,20 +0,0 @@
# hello world!
this is a test of the cool markdown parser written by
some random guy online who made a cool thing but seems kind
of cringe
## The guy
whats his name? minty or some shit idk
## Lets run a tests
test*
```
print("oogyboogyman")
```
that should be formatted as code
## One more test
- a list
- wow
- truly amazing

View file

@ -1,17 +0,0 @@
<h1>hello world!</h1>
<p>this is a test of the cool markdown parser written by
some random guy online who made a cool thing but seems kind
of cringe</p>
<h2>The guy</h2>
<p>whats his name? minty or some shit idk</p>
<h2>Lets run a tests</h2>
<p>test*</p>
<pre><code> print(&quot;oogyboogyman&quot;)
</code></pre>
<p>that should be formatted as code</p>
<h2>One more test</h2>
<ul>
<li>a list</li>
<li>wow</li>
<li>truly amazing</li>
</ul>