Initial commit.
This commit is contained in:
commit
59c6161fdb
134 changed files with 4751 additions and 0 deletions
32
apps/CMakeLists.txt
Normal file
32
apps/CMakeLists.txt
Normal file
|
@ -0,0 +1,32 @@
|
|||
# Sample GUI
|
||||
add_executable(sample_gui gui-main.cpp)
|
||||
target_include_directories(sample_gui PUBLIC
|
||||
"${PROJECT_SOURCE_DIR}/src/console"
|
||||
"${PROJECT_SOURCE_DIR}/src/client"
|
||||
)
|
||||
target_link_libraries(sample_gui PUBLIC client windows console core
|
||||
network database geometry audio graphics)
|
||||
|
||||
# Sample Console
|
||||
add_executable(sample_console console-main.cpp)
|
||||
target_include_directories(sample_console PUBLIC
|
||||
"${PROJECT_SOURCE_DIR}/src/console"
|
||||
)
|
||||
target_link_libraries(sample_console PUBLIC console core network
|
||||
database geometry audio)
|
||||
|
||||
# Xml practice
|
||||
add_executable(xml_practice xml-practice.cpp)
|
||||
target_include_directories(xml_practice PUBLIC
|
||||
"${PROJECT_SOURCE_DIR}/src/core"
|
||||
"${PROJECT_SOURCE_DIR}/src/core/xml"
|
||||
)
|
||||
target_link_libraries(xml_practice PUBLIC core)
|
||||
|
||||
# Markdown practice
|
||||
add_executable(markdown_practice markdown-practice.cpp)
|
||||
target_include_directories(markdown_practice PUBLIC
|
||||
"${PROJECT_SOURCE_DIR}/src/core"
|
||||
"${PROJECT_SOURCE_DIR}/src/web/markdown"
|
||||
)
|
||||
target_link_libraries(markdown_practice PUBLIC web core)
|
16
apps/console-main.cpp
Normal file
16
apps/console-main.cpp
Normal file
|
@ -0,0 +1,16 @@
|
|||
#include <filesystem>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "MainApplication.h"
|
||||
|
||||
int main()
|
||||
{
|
||||
// Start the main app
|
||||
auto main_app = MainApplication::Create();
|
||||
main_app->Initialize(std::filesystem::current_path());
|
||||
|
||||
//main_app->RunServer();
|
||||
main_app->PlayAudio();
|
||||
main_app->ShutDown();
|
||||
return 0;
|
||||
}
|
20
apps/gui-main.cpp
Normal file
20
apps/gui-main.cpp
Normal file
|
@ -0,0 +1,20 @@
|
|||
#include <filesystem>
|
||||
#include <memory>
|
||||
|
||||
#include "GuiApplication.h"
|
||||
#include "MainApplication.h"
|
||||
|
||||
int main()
|
||||
{
|
||||
// Start the main app
|
||||
auto main_app = MainApplication::Create();
|
||||
main_app->Initialize(std::filesystem::current_path());
|
||||
|
||||
// Start the gui app
|
||||
auto gui_app = std::make_shared<GuiApplication>();
|
||||
gui_app->SetMainApplication(main_app);
|
||||
gui_app->Run();
|
||||
|
||||
main_app->ShutDown();
|
||||
return 0;
|
||||
}
|
47
apps/markdown-practice.cpp
Normal file
47
apps/markdown-practice.cpp
Normal file
|
@ -0,0 +1,47 @@
|
|||
#include <filesystem>
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <ostream>
|
||||
#include "CommandLineArgs.h"
|
||||
#include "MarkdownParser.h"
|
||||
#include "HtmlDocument.h"
|
||||
#include "HtmlWriter.h"
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
CommandLineArgs command_line_args;
|
||||
command_line_args.Process(argc, argv);
|
||||
|
||||
if(command_line_args.GetNumberOfArgs() < 2)
|
||||
{
|
||||
std::cerr << "Expected a filepath argument" << std::endl;
|
||||
return -1;
|
||||
}
|
||||
|
||||
MarkdownParser parser;
|
||||
const auto filepath = command_line_args.GetArg(1);
|
||||
|
||||
if(!std::filesystem::exists(filepath))
|
||||
{
|
||||
std::cerr << "Couldn't find file: " << filepath << std::endl;
|
||||
return -1;
|
||||
}
|
||||
|
||||
std::ifstream md_file;
|
||||
md_file.open(filepath, std::ifstream::in);
|
||||
while(md_file.good())
|
||||
{
|
||||
std::string line;
|
||||
std::getline(md_file, line);
|
||||
parser.ProcessLine(line);
|
||||
}
|
||||
md_file.close();
|
||||
|
||||
auto html_document = parser.GetHtml();
|
||||
HtmlWriter writer;
|
||||
std::string html_string = writer.ToString(html_document);
|
||||
std::ofstream out("/home/james/test.html");
|
||||
out << html_string;
|
||||
out.close();
|
||||
return 0;
|
||||
}
|
38
apps/xml-practice.cpp
Normal file
38
apps/xml-practice.cpp
Normal file
|
@ -0,0 +1,38 @@
|
|||
#include <filesystem>
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include "CommandLineArgs.h"
|
||||
#include "XmlParser.h"
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
CommandLineArgs command_line_args;
|
||||
command_line_args.Process(argc, argv);
|
||||
|
||||
if(command_line_args.GetNumberOfArgs() < 2)
|
||||
{
|
||||
std::cerr << "Expected a filepath argument" << std::endl;
|
||||
return -1;
|
||||
}
|
||||
|
||||
XmlParser parser;
|
||||
const auto filepath = command_line_args.GetArg(1);
|
||||
|
||||
if(!std::filesystem::exists(filepath))
|
||||
{
|
||||
std::cerr << "Couldn't find file: " << filepath << std::endl;
|
||||
return -1;
|
||||
}
|
||||
|
||||
std::ifstream xml_file;
|
||||
xml_file.open(filepath, std::ifstream::in);
|
||||
while(xml_file.good())
|
||||
{
|
||||
std::string line;
|
||||
std::getline(xml_file, line);
|
||||
parser.ProcessLine(line);
|
||||
}
|
||||
xml_file.close();
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue