Skip to content

Commit c43ba1b

Browse files
committed
fix a few compile errors, also fix a if-statement assignment bug, add std::filesystem copy options for proper recursive copy and overwriting files
1 parent 2d52920 commit c43ba1b

File tree

4 files changed

+10
-9
lines changed

4 files changed

+10
-9
lines changed

include/nbl/system/CAPKResourcesArchive.h

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ class CAPKResourcesArchive : public IFileArchive
3838
AAsset_close(asset);
3939
return fileView;
4040
}
41-
core::vector<std::string> listAssets(const char* asset_path) override
41+
core::vector<system::path> listAssets(const char* asset_path) override
4242
{
43-
core::vector<std::string> result;
43+
core::vector<system::path> result;
4444

4545
auto context_object = activity->clazz;
4646
auto getAssets_method = env->GetMethodID(env->GetObjectClass(context_object), "getAssets", "()Landroid/content/res/AssetManager;");
@@ -63,14 +63,11 @@ class CAPKResourcesArchive : public IFileArchive
6363

6464
if (filename != nullptr)
6565
{
66-
if (std::string(asset_path) = "")
67-
{
68-
result.push_back(filename);
69-
}
66+
if (std::string(asset_path) == "")
67+
result.push_back(std::string(filename));
7068
else
71-
{
7269
result.push_back((std::filesystem::path(asset_path) / filename).generic_string());
73-
}
70+
7471
env->ReleaseStringUTFChars(jstr, filename);
7572
}
7673

include/nbl/system/ISystem.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,8 +477,9 @@ class ISystem : public core::IReferenceCounted
477477
}
478478
else
479479
{
480+
const auto copyOptions = std::filesystem::copy_options::recursive | std::filesystem::copy_options::overwrite_existing;
480481
std::error_code error;
481-
std::filesystem::copy(from, to, error);
482+
std::filesystem::copy(from, to, copyOptions, error);
482483
return static_cast<bool>(error);
483484
}
484485
}

include/nbl/ui/CWindowManagerAndroid.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99

1010
#include "nbl/ui/CWindowAndroid.h"
1111

12+
#include <fcntl.h>
13+
#include <unistd.h>
1214
#include <sys/ioctl.h>
1315
#include <linux/fb.h>
1416

include/nbl/ui/KeyCodes.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ namespace nbl::ui
126126
EKC_F23,
127127
EKC_F24,
128128

129+
EKC_SEPARATOR,
129130
EKC_NUM_LOCK,
130131
EKC_SCROLL_LOCK,
131132

0 commit comments

Comments
 (0)