1 /*---------------------------------------------------------------------------*
2   Project:  Horizon
3   File:     boss_NsData.h
4 
5   Copyright (C)2009-2012 Nintendo Co., Ltd.  All rights reserved.
6 
7   These coded instructions, statements, and computer programs contain
8   proprietary information of Nintendo of America Inc. and/or Nintendo
9   Company Ltd., and are protected by Federal copyright law.  They may
10   not be disclosed to third parties or copied or duplicated in any form,
11   in whole or in part, without the prior written consent of Nintendo.
12 
13   $Rev: 46347 $
14  *---------------------------------------------------------------------------*/
15 
16 #ifndef NN_BOSS_BOSS_NS_DATA_H_
17 #define NN_BOSS_BOSS_NS_DATA_H_
18 
19 #include <nn/fnd/fnd_DateTime.h>
20 #include <nn/boss/boss_Const.h>
21 #include <nn/boss/boss_Result.h>
22 #include <nn/boss/boss_Types.h>
23 
24 #ifdef __cplusplus
25 
26 namespace nn {
27 namespace boss {
28 
29 /* Please see man pages for details
30 
31 */
32 class NsData
33 {
34 public:
35     static const s32 NN_BOSS_NSDATA_READ_ERROR_GET_HEADER = -1;  //
36     static const s32 NN_BOSS_NSDATA_READ_ERROR_READ_DATA  = -2;  //
37     static const s32 NN_BOSS_NSDATA_READ_ERROR_IPC        = -3;  //
38     static const s32 NN_BOSS_NSDATA_READ_ERROR_UPDATED    = -4;  //
39     NN_PADDING4;
40 
41 /* Please see man pages for details
42 
43 */
44     explicit NsData(void);
45 
46 /* Please see man pages for details
47 
48 */
49     virtual ~NsData(void);
50 
51 /* Please see man pages for details
52 
53 
54 
55 
56 
57 
58 */
59     nn::Result Initialize(u32 serial);
60 
61 /* Please see man pages for details
62 
63 
64 
65 
66 
67 
68 
69 
70 
71 */
72     nn::Result Delete(void);
73 
74 /* Please see man pages for details
75 
76 
77 
78 
79 
80 
81 
82 
83 
84 
85 
86 
87 
88 
89 
90 
91 
92 
93 
94 
95 
96 
97 
98 
99 
100 */
101     nn::Result GetHeaderInfo(HeaderInfoType type, void* pValue, size_t size);
102 
103 /* Please see man pages for details
104 
105 
106 
107 
108 
109 
110 
111 
112 
113 
114 
115 
116 
117 
118 
119 
120 
121 
122 */
123     s32 ReadData(u8* pDataBuf, size_t bufLen);
124 
125 /* Please see man pages for details
126 
127 
128 
129 
130 
131 
132 
133 
134 
135 
136 
137 
138 
139 */
140     nn::Result SetReadDataPosition(s64 position, PositionBase base);
141 
142 /* Please see man pages for details
143 
144 
145 
146 
147 
148 
149 
150 
151 
152 
153 
154 */
155     nn::Result SetAdditionalInfo(u32 info);
156 
157 /* Please see man pages for details
158 
159 
160 
161 
162 
163 
164 
165 
166 
167 
168 
169 
170 */
171     nn::Result GetAdditionalInfo(u32* pInfo);
172 
173 /* Please see man pages for details
174 
175 
176 
177 
178 
179 
180 
181 
182 
183 
184 
185 */
186     nn::Result SetReadFlag(bool flag);
187 
188 /* Please see man pages for details
189 
190 
191 
192 
193 
194 
195 
196 
197 
198 
199 */
200     nn::Result GetReadFlag(bool* pFlag);
201 
202 /* Please see man pages for details
203 
204 
205 
206 
207 
208 
209 
210 
211 
212 
213 
214 
215 */
216     nn::Result GetLastUpdated(nn::fnd::DateTime* pTime);
217 
218 protected:
219     bool            m_Privileged;
220     NN_PADDING3;
221     u32             m_SerialId;
222     s32             m_dataSize;
223     u32             m_DataVersion;
224     AppIdType       m_AppId;
225     s64             m_ReadDataPos;
226 };
227 
228 
229 } // end of namespace boss
230 } // end of namespace nn
231 
232 #endif // __cplusplus
233 
234 #endif /* NN_BOSS_BOSS_NS_DATA_H_ */
235