diff --git a/LICENSE b/LICENSE
index 9ec03dc..97ab189 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,10 +1,8 @@
Notes Toolkit (NotesTK) is a set of tools for building applications focused on taking and organising notes.
Copyright (C) 2023 James Grogan (grogan.ox@gmail.com)
-Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
-The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+ This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-See https://opensource.org/licenses/MIT
+ You should have received a copy of the GNU General Public License along with this program. If not, see .
diff --git a/README.md b/README.md
index bdf29ab..1574540 100644
--- a/README.md
+++ b/README.md
@@ -1,61 +1,14 @@
-# NotesTK
+# Stuff From Scratch
-Notes Toolkit (NotesTK) is a set of tools for building applications focused on taking and organising notes, like study or research materials.
+This is a hobby-repo I use for learning about different software technologies by trying to build stuff from scratch.
-## Project Goals
+It covers a bunch of areas:
-* Cross-platform
-* Low third-party dependencies
-* Permissive licensing
-* Simplicity over performance
+* Build tooling
+* Audio and Video
+* 3D modelling
+* Desktop window management and UIs
-## Project Status
+Nothing here should be used in a real project :)
-🚨🚨🚨 The codebase is at a very early/prototype stage and under heavy active development🚨🚨🚨
-In addition to feature development I've been using it to get up-to-speed on various media formats and desktop and rendering APIs. It is strongly recommended to only use it as a reading reference.
-
-Expect:
-
-* No Docs or tagged releases
-* Large commits and significant breaking changes
-* Unreliable/untested APIs
-* Naive/low-performance implementations
-
-The only currently recommended use case is if you are implementing some element of the library functionality and want to see how someone else has tackled it, maybe you will see something useful.
-
-# Building
-
-Many project features (e.g. Wayland integration) only build if suitable third-party dependencies are found on the system, otherwise they will be automatically disabled. You can find dependency requirements in the `README.md` file in each module's `src`directory.
-
-A minimal set of dependencies for each platform are included below.
-
-## Linux
-
-Install dependencies:
-
-```bash
-sudo apt-get install build-essential pkg-config cmake
-```
-
-Build:
-
-```bash
-mkdir build
-cd build
-cmake $PATH_TO_SOURCE
-make
-apps/$NAME_OF_APP
-```
-
-## Windows
-
-Tested with Visual Studio 17 with 'Desktop Development with C++' tooling, including ATL and Windows SDK 10 (10.0.19041.0). Additionally, install `cmake`.
-
-```bash
-mkdir build
-cd build
-cmake $PATH_TO_SOURCE
-```
-
-You can open the resulting `NotesTK.sln`in Visual Studio and build.
diff --git a/apps/notes_tk/NotesTk.cpp b/apps/notes_tk/NotesTk.cpp
index d230835..7b2ef2e 100644
--- a/apps/notes_tk/NotesTk.cpp
+++ b/apps/notes_tk/NotesTk.cpp
@@ -16,7 +16,7 @@
#include "DesktopManager.h"
#include "MainApplication.h"
-NotesTk::NotesTk(std::unique_ptr args, std::unique_ptr mainApp)
+NotesTk::NotesTk(Ptr args, Ptr mainApp)
: GuiApplication(std::move(args), std::move(mainApp))
{
diff --git a/apps/notes_tk/NotesTk.h b/apps/notes_tk/NotesTk.h
index 29e0567..1206165 100644
--- a/apps/notes_tk/NotesTk.h
+++ b/apps/notes_tk/NotesTk.h
@@ -5,7 +5,7 @@
class NotesTk : public GuiApplication
{
public:
- NotesTk(std::unique_ptr args = nullptr, std::unique_ptr mainApp = nullptr);
+ NotesTk(Ptr args = nullptr, Ptr mainApp = nullptr);
protected:
void initializeViews() override;
diff --git a/apps/notes_tk/audio_editor/AudioEditorView.cpp b/apps/notes_tk/audio_editor/AudioEditorView.cpp
index d234cf7..942cb40 100644
--- a/apps/notes_tk/audio_editor/AudioEditorView.cpp
+++ b/apps/notes_tk/audio_editor/AudioEditorView.cpp
@@ -12,7 +12,7 @@ AudioEditorView::AudioEditorView()
addWidget(std::move(label));
}
-std::unique_ptr AudioEditorView::Create()
+Ptr AudioEditorView::Create()
{
return std::make_unique();
}
diff --git a/apps/notes_tk/audio_editor/AudioEditorView.h b/apps/notes_tk/audio_editor/AudioEditorView.h
index d5de4ad..f00d723 100644
--- a/apps/notes_tk/audio_editor/AudioEditorView.h
+++ b/apps/notes_tk/audio_editor/AudioEditorView.h
@@ -8,7 +8,7 @@ public:
AudioEditorView();
- static std::unique_ptr Create();
+ static Ptr Create();
};
-using AudioEditorViewUPtr = std::unique_ptr;
+using AudioEditorViewUPtr = Ptr;
diff --git a/apps/notes_tk/canvas/CanvasController.cpp b/apps/notes_tk/canvas/CanvasController.cpp
index 83829d3..248415b 100644
--- a/apps/notes_tk/canvas/CanvasController.cpp
+++ b/apps/notes_tk/canvas/CanvasController.cpp
@@ -1,6 +1,6 @@
#include "CanvasController.h"
-std::unique_ptr CanvasController::Create()
+Ptr CanvasController::Create()
{
return std::make_unique();
}
diff --git a/apps/notes_tk/canvas/CanvasController.h b/apps/notes_tk/canvas/CanvasController.h
index 9d56ec5..88ece5c 100644
--- a/apps/notes_tk/canvas/CanvasController.h
+++ b/apps/notes_tk/canvas/CanvasController.h
@@ -1,9 +1,9 @@
#pragma once
-#include
+#include "Pointer.h"
class CanvasController
{
public:
- static std::unique_ptr Create();
+ static Ptr Create();
};
diff --git a/apps/notes_tk/canvas/CanvasDrawingArea.h b/apps/notes_tk/canvas/CanvasDrawingArea.h
index c42034e..1fa065f 100644
--- a/apps/notes_tk/canvas/CanvasDrawingArea.h
+++ b/apps/notes_tk/canvas/CanvasDrawingArea.h
@@ -24,6 +24,6 @@ private:
CanvasDrawCommand mActiveDrawingCommand{CanvasDrawCommand::LINE};
- std::vector > mSceneNodes;
+ Vector > mSceneNodes;
bool mContentDirty{false};
};
diff --git a/apps/notes_tk/canvas/CanvasView.cpp b/apps/notes_tk/canvas/CanvasView.cpp
index 3dd447c..5ead04f 100644
--- a/apps/notes_tk/canvas/CanvasView.cpp
+++ b/apps/notes_tk/canvas/CanvasView.cpp
@@ -27,7 +27,7 @@ CanvasView::~CanvasView()
}
-std::unique_ptr CanvasView::Create()
+Ptr CanvasView::Create()
{
return std::make_unique();
}
@@ -70,7 +70,7 @@ void CanvasView::onDrawCommandChanged(CanvasDrawCommand command)
mDrawingArea->setActiveDrawingCommand(command);
}
-std::unique_ptr CanvasView::initializeCacheButtons()
+Ptr CanvasView::initializeCacheButtons()
{
auto saveButton = Button::Create();
saveButton->setLabel("Save");
diff --git a/apps/notes_tk/canvas/CanvasView.h b/apps/notes_tk/canvas/CanvasView.h
index f845f2d..e4053b6 100644
--- a/apps/notes_tk/canvas/CanvasView.h
+++ b/apps/notes_tk/canvas/CanvasView.h
@@ -13,17 +13,17 @@ public:
~CanvasView();
- static std::unique_ptr Create();
+ static Ptr Create();
private:
void onDrawCommandChanged(CanvasDrawCommand command);
void initialize();
- std::unique_ptr initializeCacheButtons();
+ Ptr initializeCacheButtons();
- std::unique_ptr mController;
+ Ptr mController;
CanvasDrawingArea* mDrawingArea{nullptr};
};
-using CanvasViewPtr = std::unique_ptr;
+using CanvasViewPtr = Ptr;
diff --git a/apps/notes_tk/image_editor/ImageEditorView.cpp b/apps/notes_tk/image_editor/ImageEditorView.cpp
index 85c04ff..a7c5a91 100644
--- a/apps/notes_tk/image_editor/ImageEditorView.cpp
+++ b/apps/notes_tk/image_editor/ImageEditorView.cpp
@@ -28,7 +28,7 @@ ImageEditorView::~ImageEditorView()
}
-std::unique_ptr ImageEditorView::Create()
+Ptr ImageEditorView::Create()
{
return std::make_unique();
}
diff --git a/apps/notes_tk/image_editor/ImageEditorView.h b/apps/notes_tk/image_editor/ImageEditorView.h
index 070aae4..3e3ffc0 100644
--- a/apps/notes_tk/image_editor/ImageEditorView.h
+++ b/apps/notes_tk/image_editor/ImageEditorView.h
@@ -10,7 +10,7 @@ public:
virtual ~ImageEditorView();
- static std::unique_ptr Create();
+ static Ptr Create();
};
-using ImageEditorViewUPtr = std::unique_ptr;
+using ImageEditorViewUPtr = Ptr;
diff --git a/apps/notes_tk/image_editor/ImageViewWidget.h b/apps/notes_tk/image_editor/ImageViewWidget.h
index cb45b45..84cf9ba 100644
--- a/apps/notes_tk/image_editor/ImageViewWidget.h
+++ b/apps/notes_tk/image_editor/ImageViewWidget.h
@@ -16,5 +16,5 @@ private:
unsigned mNumX{5};
unsigned mNumY{5};
- std::unique_ptr mGridNode;
+ Ptr mGridNode;
};
diff --git a/apps/notes_tk/main-win.cpp b/apps/notes_tk/main-win.cpp
index 30019cc..c14df2e 100644
--- a/apps/notes_tk/main-win.cpp
+++ b/apps/notes_tk/main-win.cpp
@@ -13,8 +13,8 @@
#include "windows.h"
#include
-#include
-#include
+#include "Vector.h"
+#include "String.h"
int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PWSTR pCmdLine, int nCmdShow)
{
diff --git a/apps/notes_tk/main.cpp b/apps/notes_tk/main.cpp
index f864fb8..fbd0fbb 100644
--- a/apps/notes_tk/main.cpp
+++ b/apps/notes_tk/main.cpp
@@ -1,4 +1,4 @@
-#include
+#include "Pointer.h"
#include "NotesTk.h"
#include "MainApplication.h"
@@ -12,7 +12,7 @@ int main(int argc, char *argv[])
// Start the gui app
auto app = NotesTk(std::move(args));
- //app.setUiInterfaceBackend(UiInterfaceFactory::Backend::X11_RASTER);
+ app.setUiInterfaceBackend(UiInterfaceFactory::Backend::WAYLAND_RASTER);
app.run();
return 0;
diff --git a/apps/notes_tk/mesh_viewer/MeshViewerView.cpp b/apps/notes_tk/mesh_viewer/MeshViewerView.cpp
index e5644a9..07de438 100644
--- a/apps/notes_tk/mesh_viewer/MeshViewerView.cpp
+++ b/apps/notes_tk/mesh_viewer/MeshViewerView.cpp
@@ -10,7 +10,7 @@
#include
-std::unique_ptr MeshViewerView::Create()
+Ptr MeshViewerView::Create()
{
return std::make_unique();
}
diff --git a/apps/notes_tk/mesh_viewer/MeshViewerView.h b/apps/notes_tk/mesh_viewer/MeshViewerView.h
index 5fbfce7..7c48f6a 100644
--- a/apps/notes_tk/mesh_viewer/MeshViewerView.h
+++ b/apps/notes_tk/mesh_viewer/MeshViewerView.h
@@ -10,10 +10,10 @@ class MeshViewerView : public Widget
public:
MeshViewerView();
~MeshViewerView();
- static std::unique_ptr Create();
+ static Ptr Create();
void doPaint(const PaintEvent* event) override;
private:
- std::unique_ptr mMesh;
- std::unique_ptr mMeshNode;
+ Ptr mMesh;
+ Ptr mMeshNode;
};
diff --git a/apps/notes_tk/text_editor/PlainTextDocument.cpp b/apps/notes_tk/text_editor/PlainTextDocument.cpp
index 18e5782..c2628b8 100644
--- a/apps/notes_tk/text_editor/PlainTextDocument.cpp
+++ b/apps/notes_tk/text_editor/PlainTextDocument.cpp
@@ -6,17 +6,17 @@ PlainTextDocument::PlainTextDocument()
}
-std::unique_ptr PlainTextDocument::Create()
+Ptr PlainTextDocument::Create()
{
return std::make_unique();
}
-std::string PlainTextDocument::GetContent() const
+String PlainTextDocument::GetContent() const
{
return mContent;
}
-void PlainTextDocument::SetContent(const std::string& content)
+void PlainTextDocument::SetContent(const String& content)
{
mContent = content;
}
diff --git a/apps/notes_tk/text_editor/PlainTextDocument.h b/apps/notes_tk/text_editor/PlainTextDocument.h
index ae32420..f3354a5 100644
--- a/apps/notes_tk/text_editor/PlainTextDocument.h
+++ b/apps/notes_tk/text_editor/PlainTextDocument.h
@@ -1,24 +1,24 @@
#pragma once
-#include
-#include
+#include "String.h"
+#include "Pointer.h"
class PlainTextDocument
{
- std::string mContent;
+ String mContent;
public:
PlainTextDocument();
- static std::unique_ptr Create();
+ static Ptr Create();
- std::string GetContent() const;
+ String GetContent() const;
- void SetContent(const std::string& content);
+ void SetContent(const String& content);
void Clear();
};
-using PlainTextDocumentUPtr = std::unique_ptr;
+using PlainTextDocumentUPtr = Ptr;
diff --git a/apps/notes_tk/text_editor/TextEditorController.cpp b/apps/notes_tk/text_editor/TextEditorController.cpp
index 36adacb..c2fe661 100644
--- a/apps/notes_tk/text_editor/TextEditorController.cpp
+++ b/apps/notes_tk/text_editor/TextEditorController.cpp
@@ -9,17 +9,17 @@ TextEditorController::TextEditorController()
}
-std::unique_ptr TextEditorController::Create()
+Ptr TextEditorController::Create()
{
return std::make_unique();
}
-void TextEditorController::SetContent(const std::string& content)
+void TextEditorController::SetContent(const String& content)
{
mModel->GetDocument()->SetContent(content);
}
-std::string TextEditorController::GetContent() const
+String TextEditorController::GetContent() const
{
return mModel->GetDocument()->GetContent();
}
diff --git a/apps/notes_tk/text_editor/TextEditorController.h b/apps/notes_tk/text_editor/TextEditorController.h
index 37d717d..8601a7e 100644
--- a/apps/notes_tk/text_editor/TextEditorController.h
+++ b/apps/notes_tk/text_editor/TextEditorController.h
@@ -1,5 +1,5 @@
#pragma once
-#include
+#include "Pointer.h"
#include
#include "TextEditorModel.h"
@@ -9,7 +9,7 @@ public:
TextEditorController();
- static std::unique_ptr Create();
+ static Ptr Create();
void OnSave();
@@ -17,9 +17,9 @@ public:
void OnLoad();
- std::string GetContent() const;
+ String GetContent() const;
- void SetContent(const std::string& content);
+ void SetContent(const String& content);
void SetSavePath(const std::filesystem::path& path);
@@ -31,4 +31,4 @@ private:
std::filesystem::path mLoadPath;
};
-using TextEditorControllerUPtr = std::unique_ptr;
+using TextEditorControllerUPtr = Ptr;
diff --git a/apps/notes_tk/text_editor/TextEditorModel.cpp b/apps/notes_tk/text_editor/TextEditorModel.cpp
index 9e299ec..12cc345 100644
--- a/apps/notes_tk/text_editor/TextEditorModel.cpp
+++ b/apps/notes_tk/text_editor/TextEditorModel.cpp
@@ -6,7 +6,7 @@ TextEditorModel::TextEditorModel()
}
-std::unique_ptr TextEditorModel::Create()
+Ptr TextEditorModel::Create()
{
return std::make_unique();
}
diff --git a/apps/notes_tk/text_editor/TextEditorModel.h b/apps/notes_tk/text_editor/TextEditorModel.h
index 39289e5..55e4d8e 100644
--- a/apps/notes_tk/text_editor/TextEditorModel.h
+++ b/apps/notes_tk/text_editor/TextEditorModel.h
@@ -1,7 +1,7 @@
#pragma once
#include "PlainTextDocument.h"
-#include
+#include "Pointer.h"
class TextEditorModel
{
@@ -11,9 +11,9 @@ public:
TextEditorModel();
- static std::unique_ptr Create();
+ static Ptr Create();
PlainTextDocument* GetDocument() const;
};
-using TextEditorModelUPtr = std::unique_ptr;
+using TextEditorModelUPtr = Ptr;
diff --git a/apps/notes_tk/text_editor/TextEditorView.cpp b/apps/notes_tk/text_editor/TextEditorView.cpp
index ab072d3..339dd52 100644
--- a/apps/notes_tk/text_editor/TextEditorView.cpp
+++ b/apps/notes_tk/text_editor/TextEditorView.cpp
@@ -81,7 +81,7 @@ void TextEditorView::initialize()
addWidget(std::move(hSpacer));
}
-std::unique_ptr TextEditorView::Create()
+Ptr TextEditorView::Create()
{
return std::make_unique();
}
diff --git a/apps/notes_tk/text_editor/TextEditorView.h b/apps/notes_tk/text_editor/TextEditorView.h
index 40546da..957766f 100644
--- a/apps/notes_tk/text_editor/TextEditorView.h
+++ b/apps/notes_tk/text_editor/TextEditorView.h
@@ -13,7 +13,7 @@ class TextEditorView : public Widget
public:
TextEditorView();
- static std::unique_ptr Create();
+ static Ptr Create();
TextEditorController* getController();
@@ -23,4 +23,4 @@ private:
TextBox* mTextBox;
TextEditorControllerUPtr mController;
};
-using TextEditorViewUPtr = std::unique_ptr;
+using TextEditorViewUPtr = Ptr;
diff --git a/apps/notes_tk/web_client/WebClientView.cpp b/apps/notes_tk/web_client/WebClientView.cpp
index 92c9b6f..099d3cb 100644
--- a/apps/notes_tk/web_client/WebClientView.cpp
+++ b/apps/notes_tk/web_client/WebClientView.cpp
@@ -14,7 +14,7 @@ WebClientView::WebClientView()
addWidget(std::move(label));
}
-std::unique_ptr WebClientView::Create()
+Ptr WebClientView::Create()
{
return std::make_unique();
}
diff --git a/apps/notes_tk/web_client/WebClientView.h b/apps/notes_tk/web_client/WebClientView.h
index 32cd128..309156d 100644
--- a/apps/notes_tk/web_client/WebClientView.h
+++ b/apps/notes_tk/web_client/WebClientView.h
@@ -8,7 +8,7 @@ public:
WebClientView();
- static std::unique_ptr Create();
+ static Ptr Create();
};
-using WebClientViewUPtr = std::unique_ptr;
+using WebClientViewUPtr = Ptr;
diff --git a/apps/website-generator/ContentFile.cpp b/apps/website-generator/ContentFile.cpp
index 2d00b80..6f2c9e2 100644
--- a/apps/website-generator/ContentFile.cpp
+++ b/apps/website-generator/ContentFile.cpp
@@ -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())
diff --git a/apps/website-generator/ContentFile.h b/apps/website-generator/ContentFile.h
index 993a0a8..b240bd0 100644
--- a/apps/website-generator/ContentFile.h
+++ b/apps/website-generator/ContentFile.h
@@ -3,17 +3,17 @@
#include "MarkdownContentParser.h"
#include "File.h"
-#include
+#include "String.h"
#include
-#include
+#include Map.h
class MarkdownDocument;
class ContentFile
{
public:
- using FileMetadata = std::unordered_map;
- using FileContentBody = std::vector;
+ using FileMetadata = Map;
+ using FileContentBody = Vector;
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 mContentBody;
- std::string mProcessedOutput;
+ Ptr mContentBody;
+ String mProcessedOutput;
};
class ContentArticle : public ContentFile
diff --git a/apps/website-generator/MarkdownContentParser.cpp b/apps/website-generator/MarkdownContentParser.cpp
index 382134b..db148f4 100644
--- a/apps/website-generator/MarkdownContentParser.cpp
+++ b/apps/website-generator/MarkdownContentParser.cpp
@@ -7,7 +7,7 @@
#include "File.h"
-std::pair> MarkdownContentParser::run(const Path& path)
+std::pair> MarkdownContentParser::run(const Path& path)
{
FileMetadata metadata;
FileMetadata output_metadata;
@@ -15,7 +15,7 @@ std::pair
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
return {output_metadata, std::move(document)};
}
-std::optional MarkdownContentParser::checkForMetadataItem(const std::string& line) const
+Optional 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)
{
diff --git a/apps/website-generator/MarkdownContentParser.h b/apps/website-generator/MarkdownContentParser.h
index 5ab4f0c..b8eeae6 100644
--- a/apps/website-generator/MarkdownContentParser.h
+++ b/apps/website-generator/MarkdownContentParser.h
@@ -1,10 +1,10 @@
#pragma once
-#include
+#include "String.h"
#include
-#include
+#include Map.h
#include
-#include
+#include "Vector.h"
using Path = std::filesystem::path;
@@ -13,10 +13,10 @@ class MarkdownDocument;
class MarkdownContentParser
{
public:
- using FileMetadataItem = std::pair;
- using FileMetadata = std::unordered_map;
+ using FileMetadataItem = std::pair;
+ using FileMetadata = Map;
- std::pair> run(const Path& path);
+ std::pair> run(const Path& path);
private:
- std::optional checkForMetadataItem(const std::string& line) const;
+ Optional checkForMetadataItem(const String& line) const;
};
diff --git a/apps/website-generator/SiteGeneratorConfig.cpp b/apps/website-generator/SiteGeneratorConfig.cpp
index dd3375a..599441a 100644
--- a/apps/website-generator/SiteGeneratorConfig.cpp
+++ b/apps/website-generator/SiteGeneratorConfig.cpp
@@ -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;
}
diff --git a/apps/website-generator/SiteGeneratorConfig.h b/apps/website-generator/SiteGeneratorConfig.h
index 0970113..68e69ff 100644
--- a/apps/website-generator/SiteGeneratorConfig.h
+++ b/apps/website-generator/SiteGeneratorConfig.h
@@ -1,6 +1,6 @@
#pragma once
-#include
+#include "String.h"
#include
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;
};
diff --git a/apps/website-generator/WebsiteGenerator.cpp b/apps/website-generator/WebsiteGenerator.cpp
index 0953933..c1967a4 100644
--- a/apps/website-generator/WebsiteGenerator.cpp
+++ b/apps/website-generator/WebsiteGenerator.cpp
@@ -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))
diff --git a/apps/website-generator/WebsiteGenerator.h b/apps/website-generator/WebsiteGenerator.h
index 1ca0527..eb46075 100644
--- a/apps/website-generator/WebsiteGenerator.h
+++ b/apps/website-generator/WebsiteGenerator.h
@@ -1,10 +1,10 @@
#pragma once
-#include
+#include "String.h"
#include
#include
-#include
-#include
+#include Map.h
+#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 mConfig;
- std::unique_ptr mTemplateEngine;
+ Ptr mConfig;
+ Ptr mTemplateEngine;
- std::vector > mPages;
- std::vector > mArticles;
+ Vector > mPages;
+ Vector > mArticles;
};
diff --git a/bootstrap.sh b/bootstrap.sh
new file mode 100755
index 0000000..dff6eba
--- /dev/null
+++ b/bootstrap.sh
@@ -0,0 +1,46 @@
+#!/usr/bin/env bash
+
+SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
+SOURCE_DIR=$SCRIPT_DIR/src
+CORE_SRC_DIR=$SOURCE_DIR/base/core
+
+g++ $SOURCE_DIR/main.cpp \
+ $CORE_SRC_DIR/base_types/Error.cpp \
+ $CORE_SRC_DIR/base_types/Index.cpp \
+ $CORE_SRC_DIR/base_types/Char.cpp \
+ $SOURCE_DIR/base/compiler/buildsystem/BuildEnvironment.cpp \
+ $SOURCE_DIR/base/compiler/buildsystem/BuildConfig.cpp \
+ $SOURCE_DIR/base/compiler/buildsystem/BuildBinary.cpp \
+ $SOURCE_DIR/base/compiler/buildsystem/BuildTarget.cpp \
+ $SOURCE_DIR/base/compiler/buildsystem/BuildLibrary.cpp \
+ $SOURCE_DIR/base/compiler/buildsystem/BuildExecutable.cpp \
+ $SOURCE_DIR/base/compiler/buildsystem/BuildSession.cpp \
+ $CORE_SRC_DIR/data_structures/String.cpp \
+ $CORE_SRC_DIR/filesystem/FileSystemPath.cpp \
+ $CORE_SRC_DIR/filesystem/File.cpp \
+ $CORE_SRC_DIR/filesystem/FileFormats.cpp \
+ $CORE_SRC_DIR/filesystem/posix/FilePosixImpl.cpp \
+ $CORE_SRC_DIR/filesystem/Directory.cpp \
+ $CORE_SRC_DIR/logging/ConsoleLogger.cpp \
+ $CORE_SRC_DIR/logging/Logger.cpp \
+ $CORE_SRC_DIR/serialization/yaml/YamlDocuments.cpp \
+ $CORE_SRC_DIR/serialization/yaml/YamlDocument.cpp \
+ $CORE_SRC_DIR/serialization/yaml/YamlParser.cpp \
+ $CORE_SRC_DIR/streams/FileStream.cpp \
+ $CORE_SRC_DIR/streams/Stream.cpp \
+ $CORE_SRC_DIR/system/process/Process.cpp \
+ $CORE_SRC_DIR/time/Time.cpp \
+ -o builder -g -fno-exceptions -fno-rtti \
+ -I$CORE_SRC_DIR/base_types \
+ -I$SOURCE_DIR/base/compiler/buildsystem \
+ -I$CORE_SRC_DIR/data_structures \
+ -I$CORE_SRC_DIR/encoding \
+ -I$CORE_SRC_DIR/filesystem \
+ -I$CORE_SRC_DIR/filesystem/posix \
+ -I$CORE_SRC_DIR/logging \
+ -I$CORE_SRC_DIR/memory \
+ -I$CORE_SRC_DIR/serialization/yaml \
+ -I$CORE_SRC_DIR/streams \
+ -I$CORE_SRC_DIR/system/process \
+ -I$CORE_SRC_DIR/time
+
diff --git a/plugins/circuits/src/CircuitElement.h b/plugins/circuits/src/CircuitElement.h
index 03fe480..59e7b92 100644
--- a/plugins/circuits/src/CircuitElement.h
+++ b/plugins/circuits/src/CircuitElement.h
@@ -1,7 +1,7 @@
#pragma once
-#include
-#include
+#include "String.h"
+#include "Pointer.h"
class CircuitElement
diff --git a/plugins/circuits/src/ElectronicCircuit.h b/plugins/circuits/src/ElectronicCircuit.h
index b24fe34..978986d 100644
--- a/plugins/circuits/src/ElectronicCircuit.h
+++ b/plugins/circuits/src/ElectronicCircuit.h
@@ -1,13 +1,13 @@
#pragma once
-#include
-#include
+#include "Pointer.h"
+#include "Vector.h"
#include "CircuitElement.h"
#include "LogicGate.h"
#include "Terminal.h"
-using LogicGatePtr = std::unique_ptr;
+using LogicGatePtr = Ptr;
class ElectronicCircuit
{
@@ -20,33 +20,33 @@ public:
void addLogicGate(LogicGatePtr gate);
- const std::vector& getInputTerminals() const
+ const Vector& getInputTerminals() const
{
return mInputTerminals;
}
- const std::vector& getOutputTerminals() const
+ const Vector& getOutputTerminals() const
{
return mOutputTerminals;
}
- const std::vector& getLogicGates() const
+ const Vector& getLogicGates() const
{
return mLogicGates;
}
- const std::vector& getWires() const
+ const Vector& getWires() const
{
return mWires;
}
private:
- std::vector mInputTerminals;
- std::vector mOutputTerminals;
+ Vector mInputTerminals;
+ Vector mOutputTerminals;
- std::vector mWires;
+ Vector mWires;
- std::vector mLogicGates;
+ Vector mLogicGates;
- std::vector > mElements;
+ Vector > mElements;
};
diff --git a/plugins/circuits/src/Terminal.cpp b/plugins/circuits/src/Terminal.cpp
index c54a9a3..803100b 100644
--- a/plugins/circuits/src/Terminal.cpp
+++ b/plugins/circuits/src/Terminal.cpp
@@ -1,6 +1,6 @@
#include "Terminal.h"
-Terminal::Terminal(TerminalType type, const std::string& label)
+Terminal::Terminal(TerminalType type, const String& label)
: mLabel(label),
mType(type)
diff --git a/plugins/circuits/src/Terminal.h b/plugins/circuits/src/Terminal.h
index 85b67d4..9d27877 100644
--- a/plugins/circuits/src/Terminal.h
+++ b/plugins/circuits/src/Terminal.h
@@ -2,7 +2,7 @@
#include "CircuitElement.h"
-#include
+#include "String.h"
class Wire;
@@ -15,7 +15,7 @@ public:
OUTPUT
};
- Terminal(TerminalType type, const std::string& label = {});
+ Terminal(TerminalType type, const String& label = {});
Wire* getConnection() const;
@@ -27,8 +27,8 @@ public:
void setConnection(Wire* connection);
private:
- std::string mLabel;
+ String mLabel;
TerminalType mType;
Wire* mConnection{ nullptr };
};
-using TerminalPtr = std::unique_ptr;
+using TerminalPtr = Ptr;
diff --git a/plugins/circuits/src/TruthTable.h b/plugins/circuits/src/TruthTable.h
index e4d411c..954abac 100644
--- a/plugins/circuits/src/TruthTable.h
+++ b/plugins/circuits/src/TruthTable.h
@@ -1,14 +1,14 @@
#pragma once
#include