Skip to content

Commit

Permalink
Updated Pipe
Browse files Browse the repository at this point in the history
  • Loading branch information
muit committed Feb 25, 2024
1 parent a4d6e5d commit 99c3517
Show file tree
Hide file tree
Showing 14 changed files with 47 additions and 28 deletions.
4 changes: 3 additions & 1 deletion Apps/CLI/Src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,15 @@
#include <MIRBackendModule.h>
#include <Pipe.h>
#include <Pipe/Files/Paths.h>
#include <Pipe/Files/PlatformPaths.h>
#include <Rift.h>

#include <chrono>
#include <CLI/CLI.hpp>
#include <thread>



using namespace rift;


Expand Down Expand Up @@ -64,7 +66,7 @@ namespace rift
int main(int argc, char** argv)
{
p::Initialize("Saved/Logs");
p::Info(p::GetUserSettingsPath());
p::Info(p::PlatformPaths::GetUserSettingsPath());
EnableModule<ASTModule>();
EnableModule<MIRBackendModule>();
EnableModule<GraphViewModule>();
Expand Down
2 changes: 1 addition & 1 deletion Extern/Pipe
Submodule Pipe updated 37 files
+0 −34 Include/Pipe/Core/Generic/GenericPlatformProcess.h
+0 −0 Include/Pipe/Core/GenericPlatform.h
+0 −5 Include/Pipe/Core/GenericPlatformMisc.h
+0 −28 Include/Pipe/Core/Linux/LinuxPlatformProcess.h
+1 −1 Include/Pipe/Core/LinuxPlatform.h
+2 −9 Include/Pipe/Core/LinuxPlatformMisc.h
+0 −28 Include/Pipe/Core/Mac/MacPlatformProcess.h
+1 −1 Include/Pipe/Core/MacPlatform.h
+2 −7 Include/Pipe/Core/MacPlatformMisc.h
+3 −3 Include/Pipe/Core/Platform.h
+4 −4 Include/Pipe/Core/PlatformMisc.h
+0 −13 Include/Pipe/Core/PlatformProcess.h
+0 −27 Include/Pipe/Core/Windows/WindowsPlatformProcess.h
+1 −1 Include/Pipe/Core/WindowsPlatform.h
+1 −3 Include/Pipe/Core/WindowsPlatformMisc.h
+0 −66 Include/Pipe/Files/FileWatcher.h
+0 −8 Include/Pipe/Files/Files.h
+8 −8 Include/Pipe/Files/LambdaFileIterator.h
+0 −8 Include/Pipe/Files/Paths.h
+119 −0 Include/Pipe/Files/PlatformPaths.h
+7 −12 Include/Pipe/Files/STDFileSystem.h
+64 −11 Include/PipeFiles.h
+0 −39 Src/Core/Generic/GenericPlatformProcess.cpp
+1 −1 Src/Core/GenericPlatformMisc.cpp
+1 −20 Src/Core/WindowsPlatformMisc.cpp
+0 −68 Src/Files/FileWatcher.cpp
+0 −18 Src/Files/Files.cpp
+38 −0 Src/Files/GenericPlatformPaths.cpp
+20 −19 Src/Files/LinuxPlatformPaths.cpp
+16 −15 Src/Files/MacPlatformPaths.cpp
+422 −438 Src/Files/Paths.cpp
+19 −0 Src/Files/STDFileSystem.cpp
+55 −54 Src/Files/WindowsPlatformPaths.cpp
+68 −5 Src/PipeFiles.cpp
+2 −1 Tests/Core/Function.spec.cpp
+1 −1 Tests/Core/PlatformProcess.spec.cpp
+3 −2 Tests/Files/Paths.spec.cpp
4 changes: 2 additions & 2 deletions Libs/AST/Include/AST/Utils/ModuleFileIterator.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@

namespace rift::ast
{
class ModuleFileIterator : public p::LambdaFileIterator<p::RecursiveIterator>
class ModuleFileIterator : public p::LambdaFileIterator<p::RecursivePathIterator>
{
using Super = p::LambdaFileIterator<p::RecursiveIterator>;
using Super = p::LambdaFileIterator<p::RecursivePathIterator>;

public:
using Super::Super;
Expand Down
4 changes: 2 additions & 2 deletions Libs/AST/Include/AST/Utils/TypeIterator.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@

namespace rift::ast
{
class TypeIterator : public p::LambdaFileIterator<p::RecursiveIterator>
class TypeIterator : public p::LambdaFileIterator<p::RecursivePathIterator>
{
using Super = p::LambdaFileIterator<p::RecursiveIterator>;
using Super = p::LambdaFileIterator<p::RecursivePathIterator>;

public:
using Super::Super;
Expand Down
4 changes: 2 additions & 2 deletions Libs/Bindings/Native/Compiler/Include/HeaderIterator.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@

namespace rift
{
class HeaderIterator : public p::LambdaFileIterator<p::files::RecursiveIterator>
class HeaderIterator : public p::LambdaFileIterator<p::RecursivePathIterator>
{
using Super = p::LambdaFileIterator<p::files::RecursiveIterator>;
using Super = p::LambdaFileIterator<p::RecursivePathIterator>;

public:
using Super::Super;
Expand Down
2 changes: 1 addition & 1 deletion Libs/Editor/Include/Editor.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright 2015-2023 Piperift - All rights reserved
#pragma once

#include "Pipe/Files/FileWatcher.h"
#include "PipeFiles.h"

#include <AST/Tree.h>
#include <Pipe/Files/Paths.h>
Expand Down
3 changes: 2 additions & 1 deletion Libs/Editor/Include/Statics/SEditor.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@
#include "Tools/MemoryDebugger.h"
#include "Tools/ReflectionDebugger.h"

#include <Pipe/Files/FileWatcher.h>
#include <Pipe/Memory/OwnPtr.h>
#include <Pipe/Reflect/Struct.h>
#include <PipeFiles.h>
#include <UI/UI.h>



namespace rift::Editor
{
struct SEditor : public Struct
Expand Down
8 changes: 4 additions & 4 deletions Libs/Editor/Src/Panels/FileExplorerPanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@
#include <IconsFontAwesome5.h>
#include <imgui_internal.h>
#include <Pipe/Core/FixedString.h>
#include <Pipe/Core/PlatformProcess.h>
#include <Pipe/Core/StringView.h>
#include <Pipe/Files/FileDialog.h>
#include <Pipe/Files/Files.h>
#include <Pipe/Files/Paths.h>
#include <Pipe/Files/PlatformPaths.h>
#include <Pipe/Files/STDFileSystem.h>
#include <PipeFiles.h>
#include <Rift.h>
#include <UI/Style.h>
#include <UI/UI.h>
Expand Down Expand Up @@ -175,7 +175,7 @@ namespace rift::Editor

if (UI::MenuItem("Show in Explorer"))
{
PlatformProcess::ShowFolder(path);
PlatformPaths::ShowFolder(path);
}
}

Expand Down Expand Up @@ -478,7 +478,7 @@ namespace rift::Editor
void FileExplorerPanel::CreateType(
ast::Tree& ast, StringView title, p::Tag typeId, p::StringView folderPath)
{
const p::String path = files::SaveFileDialog(title, folderPath,
const p::String path = p::SaveFileDialog(title, folderPath,
{
{"Rift Type", Strings::Format("*.{}", Paths::typeExtension)}
},
Expand Down
7 changes: 4 additions & 3 deletions Libs/Editor/Src/Systems/EditorSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,11 @@
#include <Compiler/Compiler.h>
#include <IconsFontAwesome5.h>
#include <MIRBackendModule.h>
#include <Pipe/Files/FileDialog.h>
#include <Pipe/Files/Paths.h>
#include <Pipe/Files/PlatformPaths.h>
#include <PipeArrays.h>
#include <PipeECS.h>
#include <PipeFiles.h>
#include <Rift.h>
#include <UI/Inspection.h>
#include <UI/Notify.h>
Expand Down Expand Up @@ -257,8 +258,8 @@ namespace rift::Editor::EditorSystem
{
if (UI::MenuItem("Open Project"))
{
const p::String folder =
files::SelectFolderDialog("Select project folder", p::GetCurrentPath());
const p::String folder = p::SelectFolderDialog(
"Select project folder", p::PlatformPaths::GetCurrentPath());
if (Editor::Get().OpenProject(folder))
{
editorData.skipFrameAfterMenu = true;
Expand Down
11 changes: 6 additions & 5 deletions Libs/Editor/Src/Utils/ProjectManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
#include "Editor.h"
#include "Utils/ElementsPanel.h"

#include <Pipe/Files/FileDialog.h>
#include <Pipe/Files/PlatformPaths.h>
#include <PipeFiles.h>
#include <UI/Notify.h>
#include <UI/UI.h>

Expand Down Expand Up @@ -83,8 +84,8 @@ namespace rift::Editor
UI::SameLine();
if (UI::Button("...", p::v2{24.f, 0.f}))
{
p::String selectedFolder =
p::files::SelectFolderDialog("Select project folder", p::GetCurrentPath());
p::String selectedFolder = p::SelectFolderDialog(
"Select project folder", p::PlatformPaths::GetCurrentPath());
folder = p::ToString(selectedFolder);
}
}
Expand All @@ -93,8 +94,8 @@ namespace rift::Editor
ImGui::TableNextColumn();
if (UI::Button("Open", p::v2{-FLT_MIN, 0.0f}))
{
p::String folder =
p::files::SelectFolderDialog("Select project folder", p::GetCurrentPath());
p::String folder = p::SelectFolderDialog(
"Select project folder", p::PlatformPaths::GetCurrentPath());
if (Editor::Get().OpenProject(folder))
{
UI::CloseCurrentPopup();
Expand Down
1 change: 1 addition & 0 deletions Libs/UI/Include/UI/Paths.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@
namespace rift::Paths
{
p::String GetResourcesPath();
p::String GetUserSettingsPath();
}; // namespace rift::Paths
12 changes: 10 additions & 2 deletions Libs/UI/Src/Paths.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,20 @@

#include "UI/Paths.h"

#include <Pipe/Files/PlatformPaths.h>


namespace rift::Paths
{
p::String GetResourcesPath()
{
static p::StringView relativeResourcesPath{"./Resources"};
return p::JoinPaths(p::GetBasePath(), relativeResourcesPath);
static p::StringView relativeResourcesPath{"Resources"};
return p::JoinPaths(p::PlatformPaths::GetBasePath(), relativeResourcesPath);
}

p::String GetUserSettingsPath()
{
static p::StringView relativeSettingsPath{"Rift"};
return p::JoinPaths(p::PlatformPaths::GetUserSettingsPath(), relativeSettingsPath);
}
}; // namespace rift::Paths
9 changes: 6 additions & 3 deletions Libs/UI/Src/Window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@
#include <GLFW/glfw3.h>
#include <Pipe/Core/Log.h>
#include <Pipe/Files/Paths.h>
#include <Pipe/Files/PlatformPaths.h>
#include <PipeColor.h>


#define STB_IMAGE_IMPLEMENTATION
#include <stb_image.h>

Expand Down Expand Up @@ -173,11 +175,12 @@ namespace rift::UI

void SetWindowIcon()
{
p::String icon64Path = p::JoinPaths(p::GetBasePath(), "Resources/Editor/Icons/Logo_64.png");
p::String icon64Path =
p::JoinPaths(p::PlatformPaths::GetBasePath(), "Resources/Editor/Icons/Logo_64.png");
p::String icon128Path =
p::JoinPaths(p::GetBasePath(), "Resources/Editor/Icons/Logo_128.png");
p::JoinPaths(p::PlatformPaths::GetBasePath(), "Resources/Editor/Icons/Logo_128.png");
p::String icon256Path =
p::JoinPaths(p::GetBasePath(), "Resources/Editor/Icons/Logo_256.png");
p::JoinPaths(p::PlatformPaths::GetBasePath(), "Resources/Editor/Icons/Logo_256.png");
GLFWimage images[3];
images[0].pixels =
stbi_load(icon64Path.c_str(), &images[0].width, &images[0].height, nullptr, 0);
Expand Down
4 changes: 3 additions & 1 deletion Tests/Project.spec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,21 @@
#include <bandit/bandit.h>
#include <Pipe/Files/Files.h>
#include <Pipe/Files/Paths.h>
#include <Pipe/Files/PlatformPaths.h>
#include <Pipe/Memory/OwnPtr.h>

#include <chrono>
#include <thread>



using namespace snowhouse;
using namespace bandit;
using namespace rift;
using namespace p;
using namespace std::chrono_literals;

String testProjectPath = p::JoinPaths(GetCurrentPath(), "TestProject");
String testProjectPath = p::JoinPaths(PlatformPaths::GetCurrentPath(), "TestProject");


go_bandit([]() {
Expand Down

0 comments on commit 99c3517

Please sign in to comment.