summaryrefslogtreecommitdiff
path: root/src/core/loader/loader.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/loader/loader.h')
-rw-r--r--src/core/loader/loader.h55
1 files changed, 22 insertions, 33 deletions
diff --git a/src/core/loader/loader.h b/src/core/loader/loader.h
index 95f16fcb1..4ba10de52 100644
--- a/src/core/loader/loader.h
+++ b/src/core/loader/loader.h
@@ -32,6 +32,7 @@ enum class ResultStatus {
32 ErrorNotLoaded, 32 ErrorNotLoaded,
33 ErrorNotUsed, 33 ErrorNotUsed,
34 ErrorAlreadyLoaded, 34 ErrorAlreadyLoaded,
35 ErrorMemoryAllocationFailed,
35}; 36};
36 37
37/// Interface for loading an application 38/// Interface for loading an application
@@ -48,60 +49,48 @@ public:
48 49
49 /** 50 /**
50 * Get the code (typically .code section) of the application 51 * Get the code (typically .code section) of the application
51 * @param error ResultStatus result of function 52 * @param buffer Reference to buffer to store data
52 * @return Reference to code buffer 53 * @return ResultStatus result of function
53 */ 54 */
54 virtual const std::vector<u8>& ReadCode(ResultStatus& error) const { 55 virtual ResultStatus ReadCode(std::vector<u8>& buffer) const {
55 error = ResultStatus::ErrorNotImplemented; 56 return ResultStatus::ErrorNotImplemented;
56 return code;
57 } 57 }
58 58
59 /** 59 /**
60 * Get the icon (typically icon section) of the application 60 * Get the icon (typically icon section) of the application
61 * @param error ResultStatus result of function 61 * @param buffer Reference to buffer to store data
62 * @return Reference to icon buffer 62 * @return ResultStatus result of function
63 */ 63 */
64 virtual const std::vector<u8>& ReadIcon(ResultStatus& error) const { 64 virtual ResultStatus ReadIcon(std::vector<u8>& buffer) const {
65 error = ResultStatus::ErrorNotImplemented; 65 return ResultStatus::ErrorNotImplemented;
66 return icon;
67 } 66 }
68 67
69 /** 68 /**
70 * Get the banner (typically banner section) of the application 69 * Get the banner (typically banner section) of the application
71 * @param error ResultStatus result of function 70 * @param buffer Reference to buffer to store data
72 * @return Reference to banner buffer 71 * @return ResultStatus result of function
73 */ 72 */
74 virtual const std::vector<u8>& ReadBanner(ResultStatus& error) const { 73 virtual ResultStatus ReadBanner(std::vector<u8>& buffer) const {
75 error = ResultStatus::ErrorNotImplemented; 74 return ResultStatus::ErrorNotImplemented;
76 return banner;
77 } 75 }
78 76
79 /** 77 /**
80 * Get the logo (typically logo section) of the application 78 * Get the logo (typically logo section) of the application
81 * @param error ResultStatus result of function 79 * @param buffer Reference to buffer to store data
82 * @return Reference to logo buffer 80 * @return ResultStatus result of function
83 */ 81 */
84 virtual const std::vector<u8>& ReadLogo(ResultStatus& error) const { 82 virtual ResultStatus ReadLogo(std::vector<u8>& buffer) const {
85 error = ResultStatus::ErrorNotImplemented; 83 return ResultStatus::ErrorNotImplemented;
86 return logo;
87 } 84 }
88 85
89 /** 86 /**
90 * Get the RomFs archive of the application 87 * Get the RomFS of the application
91 * @param error ResultStatus result of function 88 * @param buffer Reference to buffer to store data
92 * @return Reference to RomFs archive buffer 89 * @return ResultStatus result of function
93 */ 90 */
94 virtual const std::vector<u8>& ReadRomFS(ResultStatus& error) const { 91 virtual ResultStatus ReadRomFS(std::vector<u8>& buffer) const {
95 error = ResultStatus::ErrorNotImplemented; 92 return ResultStatus::ErrorNotImplemented;
96 return romfs;
97 } 93 }
98
99protected:
100 std::vector<u8> code; ///< ExeFS .code section
101 std::vector<u8> icon; ///< ExeFS .icon section
102 std::vector<u8> banner; ///< ExeFS .banner section
103 std::vector<u8> logo; ///< ExeFS .logo section
104 std::vector<u8> romfs; ///< RomFs archive
105}; 94};
106 95
107/** 96/**