Skip to content

Commit b3f6ecc

Browse files
committed
use utki::unique_ref
1 parent 9d36f3d commit b3f6ecc

6 files changed

Lines changed: 11 additions & 10 deletions

File tree

examples/basic/src/main.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#include <ruis/widget/label/TextLabel.hpp>
44
#include <ruis/widget/button/Button.hpp>
55

6+
// TODO: rewrite
67

78
class Application : public ruisapp::application{
89
public:

src/ruisapp/application.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,9 @@ application::~application()
9292
}
9393

9494
#if CFG_OS_NAME != CFG_OS_NAME_ANDROID && CFG_OS_NAME != CFG_OS_NAME_IOS
95-
std::unique_ptr<fsif::file> application::get_res_file(std::string_view path) const
95+
utki::unique_ref<fsif::file> application::get_res_file(std::string_view path) const
9696
{
97-
return std::make_unique<fsif::native_file>(path);
97+
return utki::make_unique<fsif::native_file>(path);
9898
}
9999
#endif
100100

src/ruisapp/application.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ class application : public utki::intrusive_singleton<application>
7474
* @param path - file path to initialize the file interface with.
7575
* @return Instance of the file interface into the resources storage.
7676
*/
77-
std::unique_ptr<fsif::file> get_res_file(std::string_view path = {}) const;
77+
utki::unique_ref<fsif::file> get_res_file(std::string_view path = {}) const;
7878

7979
/**
8080
* @brief Aggregation of application directory locations.

src/ruisapp/glue/android/application.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,12 +149,12 @@ ruisapp::application::application(parameters params) :
149149
)
150150
{}
151151

152-
std::unique_ptr<fsif::file> ruisapp::application::get_res_file(std::string_view path) const
152+
utki::unique_ref<fsif::file> ruisapp::application::get_res_file(std::string_view path) const
153153
{
154154
utki::assert(globals_wrapper::native_activity, SL);
155155
utki::assert(globals_wrapper::native_activity->assetManager, SL);
156156

157-
return std::make_unique<asset_file>(
157+
return utki::make_unique<asset_file>(
158158
globals_wrapper::native_activity->assetManager, //
159159
path
160160
);

src/ruisapp/glue/ios/application.cxx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,14 +129,14 @@ ruisapp::application::application(parameters params) :
129129
)
130130
{}
131131

132-
std::unique_ptr<fsif::file> ruisapp::application::get_res_file(std::string_view path) const
132+
utki::unique_ref<fsif::file> ruisapp::application::get_res_file(std::string_view path) const
133133
{
134134
std::string dir([[[NSBundle mainBundle] resourcePath] fileSystemRepresentation]);
135135

136136
// TRACE(<< "res path = " << dir << std::endl)
137137

138-
auto rdf = std::make_unique<fsif::root_dir>(
139-
std::make_unique<fsif::native_file>(), //
138+
auto rdf = utki::make_unique<fsif::root_dir>(
139+
utki::make_unique<fsif::native_file>(), //
140140
dir + "/" // TODO: use utki::cat()?
141141
);
142142
rdf->set_path(path);

tests/app/src/main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,9 @@ class application : public ruisapp::application{
7272
this->quit();
7373
};
7474

75-
this->window.gui.init_standard_widgets(*this->get_res_file("../../res/ruis_res/"));
75+
this->window.gui.init_standard_widgets(this->get_res_file("../../res/ruis_res/"));
7676

77-
this->window.gui.context.get().loader().mount_res_pack(*this->get_res_file("res/"));
77+
this->window.gui.context.get().loader().mount_res_pack(this->get_res_file("res/"));
7878

7979
auto c = make_root_widget(this->window.gui.context);
8080
this->window.gui.set_root(c);

0 commit comments

Comments
 (0)