Skip to content

Commit 99c3517

Browse files
committed
Updated Pipe
1 parent a4d6e5d commit 99c3517

File tree

14 files changed

+47
-28
lines changed

14 files changed

+47
-28
lines changed

Apps/CLI/Src/main.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,15 @@
1111
#include <MIRBackendModule.h>
1212
#include <Pipe.h>
1313
#include <Pipe/Files/Paths.h>
14+
#include <Pipe/Files/PlatformPaths.h>
1415
#include <Rift.h>
1516

1617
#include <chrono>
1718
#include <CLI/CLI.hpp>
1819
#include <thread>
1920

2021

22+
2123
using namespace rift;
2224

2325

@@ -64,7 +66,7 @@ namespace rift
6466
int main(int argc, char** argv)
6567
{
6668
p::Initialize("Saved/Logs");
67-
p::Info(p::GetUserSettingsPath());
69+
p::Info(p::PlatformPaths::GetUserSettingsPath());
6870
EnableModule<ASTModule>();
6971
EnableModule<MIRBackendModule>();
7072
EnableModule<GraphViewModule>();

Libs/AST/Include/AST/Utils/ModuleFileIterator.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99

1010
namespace rift::ast
1111
{
12-
class ModuleFileIterator : public p::LambdaFileIterator<p::RecursiveIterator>
12+
class ModuleFileIterator : public p::LambdaFileIterator<p::RecursivePathIterator>
1313
{
14-
using Super = p::LambdaFileIterator<p::RecursiveIterator>;
14+
using Super = p::LambdaFileIterator<p::RecursivePathIterator>;
1515

1616
public:
1717
using Super::Super;

Libs/AST/Include/AST/Utils/TypeIterator.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99

1010
namespace rift::ast
1111
{
12-
class TypeIterator : public p::LambdaFileIterator<p::RecursiveIterator>
12+
class TypeIterator : public p::LambdaFileIterator<p::RecursivePathIterator>
1313
{
14-
using Super = p::LambdaFileIterator<p::RecursiveIterator>;
14+
using Super = p::LambdaFileIterator<p::RecursivePathIterator>;
1515

1616
public:
1717
using Super::Super;

Libs/Bindings/Native/Compiler/Include/HeaderIterator.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99

1010
namespace rift
1111
{
12-
class HeaderIterator : public p::LambdaFileIterator<p::files::RecursiveIterator>
12+
class HeaderIterator : public p::LambdaFileIterator<p::RecursivePathIterator>
1313
{
14-
using Super = p::LambdaFileIterator<p::files::RecursiveIterator>;
14+
using Super = p::LambdaFileIterator<p::RecursivePathIterator>;
1515

1616
public:
1717
using Super::Super;

Libs/Editor/Include/Editor.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright 2015-2023 Piperift - All rights reserved
22
#pragma once
33

4-
#include "Pipe/Files/FileWatcher.h"
4+
#include "PipeFiles.h"
55

66
#include <AST/Tree.h>
77
#include <Pipe/Files/Paths.h>

Libs/Editor/Include/Statics/SEditor.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,13 @@
99
#include "Tools/MemoryDebugger.h"
1010
#include "Tools/ReflectionDebugger.h"
1111

12-
#include <Pipe/Files/FileWatcher.h>
1312
#include <Pipe/Memory/OwnPtr.h>
1413
#include <Pipe/Reflect/Struct.h>
14+
#include <PipeFiles.h>
1515
#include <UI/UI.h>
1616

1717

18+
1819
namespace rift::Editor
1920
{
2021
struct SEditor : public Struct

Libs/Editor/Src/Panels/FileExplorerPanel.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@
1818
#include <IconsFontAwesome5.h>
1919
#include <imgui_internal.h>
2020
#include <Pipe/Core/FixedString.h>
21-
#include <Pipe/Core/PlatformProcess.h>
2221
#include <Pipe/Core/StringView.h>
23-
#include <Pipe/Files/FileDialog.h>
2422
#include <Pipe/Files/Files.h>
2523
#include <Pipe/Files/Paths.h>
24+
#include <Pipe/Files/PlatformPaths.h>
2625
#include <Pipe/Files/STDFileSystem.h>
26+
#include <PipeFiles.h>
2727
#include <Rift.h>
2828
#include <UI/Style.h>
2929
#include <UI/UI.h>
@@ -175,7 +175,7 @@ namespace rift::Editor
175175

176176
if (UI::MenuItem("Show in Explorer"))
177177
{
178-
PlatformProcess::ShowFolder(path);
178+
PlatformPaths::ShowFolder(path);
179179
}
180180
}
181181

@@ -478,7 +478,7 @@ namespace rift::Editor
478478
void FileExplorerPanel::CreateType(
479479
ast::Tree& ast, StringView title, p::Tag typeId, p::StringView folderPath)
480480
{
481-
const p::String path = files::SaveFileDialog(title, folderPath,
481+
const p::String path = p::SaveFileDialog(title, folderPath,
482482
{
483483
{"Rift Type", Strings::Format("*.{}", Paths::typeExtension)}
484484
},

Libs/Editor/Src/Systems/EditorSystem.cpp

+4-3
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,11 @@
2626
#include <Compiler/Compiler.h>
2727
#include <IconsFontAwesome5.h>
2828
#include <MIRBackendModule.h>
29-
#include <Pipe/Files/FileDialog.h>
3029
#include <Pipe/Files/Paths.h>
30+
#include <Pipe/Files/PlatformPaths.h>
3131
#include <PipeArrays.h>
3232
#include <PipeECS.h>
33+
#include <PipeFiles.h>
3334
#include <Rift.h>
3435
#include <UI/Inspection.h>
3536
#include <UI/Notify.h>
@@ -257,8 +258,8 @@ namespace rift::Editor::EditorSystem
257258
{
258259
if (UI::MenuItem("Open Project"))
259260
{
260-
const p::String folder =
261-
files::SelectFolderDialog("Select project folder", p::GetCurrentPath());
261+
const p::String folder = p::SelectFolderDialog(
262+
"Select project folder", p::PlatformPaths::GetCurrentPath());
262263
if (Editor::Get().OpenProject(folder))
263264
{
264265
editorData.skipFrameAfterMenu = true;

Libs/Editor/Src/Utils/ProjectManager.cpp

+6-5
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
#include "Editor.h"
44
#include "Utils/ElementsPanel.h"
55

6-
#include <Pipe/Files/FileDialog.h>
6+
#include <Pipe/Files/PlatformPaths.h>
7+
#include <PipeFiles.h>
78
#include <UI/Notify.h>
89
#include <UI/UI.h>
910

@@ -83,8 +84,8 @@ namespace rift::Editor
8384
UI::SameLine();
8485
if (UI::Button("...", p::v2{24.f, 0.f}))
8586
{
86-
p::String selectedFolder =
87-
p::files::SelectFolderDialog("Select project folder", p::GetCurrentPath());
87+
p::String selectedFolder = p::SelectFolderDialog(
88+
"Select project folder", p::PlatformPaths::GetCurrentPath());
8889
folder = p::ToString(selectedFolder);
8990
}
9091
}
@@ -93,8 +94,8 @@ namespace rift::Editor
9394
ImGui::TableNextColumn();
9495
if (UI::Button("Open", p::v2{-FLT_MIN, 0.0f}))
9596
{
96-
p::String folder =
97-
p::files::SelectFolderDialog("Select project folder", p::GetCurrentPath());
97+
p::String folder = p::SelectFolderDialog(
98+
"Select project folder", p::PlatformPaths::GetCurrentPath());
9899
if (Editor::Get().OpenProject(folder))
99100
{
100101
UI::CloseCurrentPopup();

Libs/UI/Include/UI/Paths.h

+1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@
88
namespace rift::Paths
99
{
1010
p::String GetResourcesPath();
11+
p::String GetUserSettingsPath();
1112
}; // namespace rift::Paths

Libs/UI/Src/Paths.cpp

+10-2
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,20 @@
22

33
#include "UI/Paths.h"
44

5+
#include <Pipe/Files/PlatformPaths.h>
6+
57

68
namespace rift::Paths
79
{
810
p::String GetResourcesPath()
911
{
10-
static p::StringView relativeResourcesPath{"./Resources"};
11-
return p::JoinPaths(p::GetBasePath(), relativeResourcesPath);
12+
static p::StringView relativeResourcesPath{"Resources"};
13+
return p::JoinPaths(p::PlatformPaths::GetBasePath(), relativeResourcesPath);
14+
}
15+
16+
p::String GetUserSettingsPath()
17+
{
18+
static p::StringView relativeSettingsPath{"Rift"};
19+
return p::JoinPaths(p::PlatformPaths::GetUserSettingsPath(), relativeSettingsPath);
1220
}
1321
}; // namespace rift::Paths

Libs/UI/Src/Window.cpp

+6-3
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@
1717
#include <GLFW/glfw3.h>
1818
#include <Pipe/Core/Log.h>
1919
#include <Pipe/Files/Paths.h>
20+
#include <Pipe/Files/PlatformPaths.h>
2021
#include <PipeColor.h>
2122

23+
2224
#define STB_IMAGE_IMPLEMENTATION
2325
#include <stb_image.h>
2426

@@ -173,11 +175,12 @@ namespace rift::UI
173175

174176
void SetWindowIcon()
175177
{
176-
p::String icon64Path = p::JoinPaths(p::GetBasePath(), "Resources/Editor/Icons/Logo_64.png");
178+
p::String icon64Path =
179+
p::JoinPaths(p::PlatformPaths::GetBasePath(), "Resources/Editor/Icons/Logo_64.png");
177180
p::String icon128Path =
178-
p::JoinPaths(p::GetBasePath(), "Resources/Editor/Icons/Logo_128.png");
181+
p::JoinPaths(p::PlatformPaths::GetBasePath(), "Resources/Editor/Icons/Logo_128.png");
179182
p::String icon256Path =
180-
p::JoinPaths(p::GetBasePath(), "Resources/Editor/Icons/Logo_256.png");
183+
p::JoinPaths(p::PlatformPaths::GetBasePath(), "Resources/Editor/Icons/Logo_256.png");
181184
GLFWimage images[3];
182185
images[0].pixels =
183186
stbi_load(icon64Path.c_str(), &images[0].width, &images[0].height, nullptr, 0);

Tests/Project.spec.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,21 @@
66
#include <bandit/bandit.h>
77
#include <Pipe/Files/Files.h>
88
#include <Pipe/Files/Paths.h>
9+
#include <Pipe/Files/PlatformPaths.h>
910
#include <Pipe/Memory/OwnPtr.h>
1011

1112
#include <chrono>
1213
#include <thread>
1314

1415

16+
1517
using namespace snowhouse;
1618
using namespace bandit;
1719
using namespace rift;
1820
using namespace p;
1921
using namespace std::chrono_literals;
2022

21-
String testProjectPath = p::JoinPaths(GetCurrentPath(), "TestProject");
23+
String testProjectPath = p::JoinPaths(PlatformPaths::GetCurrentPath(), "TestProject");
2224

2325

2426
go_bandit([]() {

0 commit comments

Comments
 (0)