utility 2026.1.9
A comprehensive C++ utilities library tailored for the development of modern desktop and extended reality (XR) applications.
Loading...
Searching...
No Matches
android_system_io.hpp
1/*
2 Copyright (c) 2026 ETIB Corporation
3
4 Permission is hereby granted, free of charge, to any person obtaining a copy of
5 this software and associated documentation files (the "Software"), to deal in
6 the Software without restriction, including without limitation the rights to
7 use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
8 of the Software, and to permit persons to whom the Software is furnished to do
9 so, subject to the following conditions:
10
11 The above copyright notice and this permission notice shall be included in all
12 copies or substantial portions of the Software.
13
14 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20 SOFTWARE.
21 */
22
23#pragma once
24
25#ifdef __ANDROID__
26
27 #include <android/asset_manager.h>
28 #include <android/asset_manager_jni.h>
29
30 #include <memory>
31
32 #include "utility/system_io/system_io.hpp"
33
34namespace utility::logging
35{
36 class Logger;
37}
38
39namespace utility
40{
41
47 class AndroidSystemIO: public SystemIO
48 {
49 private:
50 AAssetManager
51 *_assetManager;
52 std::unique_ptr<utility::logging::Logger> _logger;
53
54 protected:
59 utility::logging::Logger &getLogger(void);
60
65 utility::logging::Logger &getLogger(void) const;
66
67 public:
73 explicit AndroidSystemIO(AAssetManager *systemInterface);
74
78 ~AndroidSystemIO() override = default;
79
86 bool loadDirectory(const std::string &directory) override;
87
94 std::shared_ptr<utility::File> add(const std::string &path) override;
95
102 void remove(const std::string &path, bool save = true) override;
103
112 bool save(const std::string &path,
113 const std::string &newPath = "") override;
114 };
115} // namespace utility
116
117#endif // __ANDROID__
Abstract logger interface defining stream-style logging operations.
Definition logger.hpp:96
The utility namespace contains classes and functions for the utility project.
Definition cache.hpp:34