1 /*---------------------------------------------------------------------------*
2   Project:  Horizon
3   File:     fs_FileSystem.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_FS_FS_FILESYSTEM_H_
17 #define NN_FS_FS_FILESYSTEM_H_
18 
19 #include <nn/Handle.h>
20 #include <nn/Result.h>
21 #include <nn/types.h>
22 #include <nn/util/util_Result.h>
23 #include <nn/fs/fs_Parameters.h>
24 #include <nn/fs/fs_FileSystemBase.h>
25 
26 /* Please see man pages for details
27 
28 */
29 
30 namespace nn {
31 namespace fs {
32 
33 //----------------------------------------
34 //
35 //
36 
37 /* Please see man pages for details
38 
39 
40 
41 */
42 void DeleteFile( const wchar_t* pathName );
43 
44 /* Please see man pages for details
45 
46 
47 
48 
49 
50 
51 */
52 void DeleteFile( const char* pathName );
53 
54 /* Please see man pages for details
55 
56 
57 
58 
59 
60 
61 
62 */
63 Result TryDeleteFile( const wchar_t* pathName );
64 
65 /* Please see man pages for details
66 
67 
68 
69 
70 
71 
72 
73 
74 
75 
76 */
77 Result TryDeleteFile( const char* pathName );
78 
79 /* Please see man pages for details
80 
81 
82 
83 
84 */
85 void RenameFile( const wchar_t* currentPath, const wchar_t* newPath);
86 
87 /* Please see man pages for details
88 
89 
90 
91 
92 
93 
94 
95 */
96 void RenameFile( const char* currentPath, const char* newPath);
97 
98 /* Please see man pages for details
99 
100 
101 
102 
103 
104 
105 
106 
107 */
108 Result TryRenameFile( const wchar_t* currentPath, const wchar_t* newPath);
109 
110 /* Please see man pages for details
111 
112 
113 
114 
115 
116 
117 
118 
119 
120 
121 
122 */
123 Result TryRenameFile( const char* currentPath, const char* newPath);
124 
125 /* Please see man pages for details
126 
127 
128 
129 */
130 void DeleteDirectory( const wchar_t* pathName );
131 
132 /* Please see man pages for details
133 
134 
135 
136 
137 
138 
139 */
140 void DeleteDirectory( const char* pathName );
141 
142 /* Please see man pages for details
143 
144 
145 
146 
147 
148 
149 
150 */
151 Result TryDeleteDirectory( const wchar_t* pathName );
152 
153 /* Please see man pages for details
154 
155 
156 
157 
158 
159 
160 
161 
162 
163 
164 */
165 Result TryDeleteDirectory( const char* pathName );
166 
167 /* Please see man pages for details
168 
169 
170 
171 
172 
173 
174 
175 */
176 Result TryDeleteDirectoryRecursively( const wchar_t* pathName );
177 
178 /* Please see man pages for details
179 
180 
181 
182 
183 
184 
185 
186 
187 
188 */
189 Result TryDeleteDirectoryRecursively( const char* pathName );
190 
191 /* Please see man pages for details
192 
193 
194 
195 
196 */
197 void CreateFile( const wchar_t* pathName, s64 size );
198 
199 /* Please see man pages for details
200 
201 
202 
203 
204 
205 
206 
207 */
208 void CreateFile( const char* pathName, s64 size );
209 
210 /* Please see man pages for details
211 
212 
213 
214 
215 
216 
217 
218 
219 
220 
221 
222 */
223 Result TryCreateFile( const wchar_t* pathName, s64 size );
224 
225 /* Please see man pages for details
226 
227 
228 
229 
230 
231 
232 
233 
234 
235 
236 
237 
238 
239 
240 */
241 Result TryCreateFile( const char* pathName, s64 size );
242 
243 /* Please see man pages for details
244 
245 
246 
247 */
248 void CreateDirectory( const wchar_t* pathName );
249 
250 /* Please see man pages for details
251 
252 
253 
254 
255 
256 
257 */
258 void CreateDirectory( const char* pathName );
259 
260 /* Please see man pages for details
261 
262 
263 
264 
265 
266 
267 
268 */
269 Result TryCreateDirectory( const wchar_t* pathName );
270 
271 /* Please see man pages for details
272 
273 
274 
275 
276 
277 
278 
279 
280 
281 
282 */
283 Result TryCreateDirectory( const char* pathName );
284 
285 /* Please see man pages for details
286 
287 
288 
289 
290 */
291 void RenameDirectory( const wchar_t* currentPath, const wchar_t* newPath);
292 
293 /* Please see man pages for details
294 
295 
296 
297 
298 
299 
300 
301 */
302 void RenameDirectory( const char* currentPath, const char* newPath);
303 
304 /* Please see man pages for details
305 
306 
307 
308 
309 
310 
311 
312 
313 */
314 Result TryRenameDirectory( const wchar_t* currentPath, const wchar_t* newPath);
315 
316 /* Please see man pages for details
317 
318 
319 
320 
321 
322 
323 
324 
325 
326 
327 
328 */
329 Result TryRenameDirectory( const char* currentPath, const char* newPath);
330 
331 //
332 
DeleteFile(const wchar_t * pathName)333 inline void DeleteFile(const wchar_t* pathName)
334 {
335     detail::GetGlobalFileSystemBase().DeleteFile(pathName);
336 }
DeleteFile(const char * pathName)337 inline void DeleteFile(const char* pathName)
338 {
339     detail::GetGlobalFileSystemBase().DeleteFile(pathName);
340 }
TryDeleteFile(const wchar_t * pathName)341 inline Result TryDeleteFile(const wchar_t* pathName)
342 {
343     return detail::GetGlobalFileSystemBase().TryDeleteFile(pathName);
344 }
TryDeleteFile(const char * pathName)345 inline Result TryDeleteFile(const char* pathName)
346 {
347     return detail::GetGlobalFileSystemBase().TryDeleteFile(pathName);
348 }
349 
RenameFile(const wchar_t * currentPath,const wchar_t * newPath)350 inline void RenameFile( const wchar_t* currentPath, const wchar_t* newPath)
351 {
352     detail::GetGlobalFileSystemBase().RenameFile(currentPath, newPath);
353 }
RenameFile(const char * currentPath,const char * newPath)354 inline void RenameFile( const char* currentPath, const char* newPath)
355 {
356     detail::GetGlobalFileSystemBase().RenameFile(currentPath, newPath);
357 }
TryRenameFile(const wchar_t * currentPath,const wchar_t * newPath)358 inline Result TryRenameFile( const wchar_t* currentPath, const wchar_t* newPath)
359 {
360     return detail::GetGlobalFileSystemBase().TryRenameFile(currentPath, newPath);
361 }
TryRenameFile(const char * currentPath,const char * newPath)362 inline Result TryRenameFile( const char* currentPath, const char* newPath)
363 {
364     return detail::GetGlobalFileSystemBase().TryRenameFile(currentPath, newPath);
365 }
366 
DeleteDirectory(const wchar_t * pathName)367 inline void DeleteDirectory(const wchar_t* pathName)
368 {
369     detail::GetGlobalFileSystemBase().DeleteDirectory(pathName);
370 }
DeleteDirectory(const char * pathName)371 inline void DeleteDirectory(const char* pathName)
372 {
373     detail::GetGlobalFileSystemBase().DeleteDirectory(pathName);
374 }
DeleteDirectoryRecursively(const wchar_t * pathName)375 inline void DeleteDirectoryRecursively(const wchar_t* pathName)
376 {
377     detail::GetGlobalFileSystemBase().DeleteDirectoryRecursively(pathName);
378 }
DeleteDirectoryRecursively(const char * pathName)379 inline void DeleteDirectoryRecursively(const char* pathName)
380 {
381     detail::GetGlobalFileSystemBase().DeleteDirectoryRecursively(pathName);
382 }
TryDeleteDirectory(const wchar_t * pathName)383 inline Result TryDeleteDirectory(const wchar_t* pathName)
384 {
385     return detail::GetGlobalFileSystemBase().TryDeleteDirectory(pathName);
386 }
TryDeleteDirectory(const char * pathName)387 inline Result TryDeleteDirectory(const char* pathName)
388 {
389     return detail::GetGlobalFileSystemBase().TryDeleteDirectory(pathName);
390 }
TryDeleteDirectoryRecursively(const wchar_t * pathName)391 inline Result TryDeleteDirectoryRecursively(const wchar_t* pathName)
392 {
393     return detail::GetGlobalFileSystemBase().TryDeleteDirectoryRecursively(pathName);
394 }
TryDeleteDirectoryRecursively(const char * pathName)395 inline Result TryDeleteDirectoryRecursively(const char* pathName)
396 {
397     return detail::GetGlobalFileSystemBase().TryDeleteDirectoryRecursively(pathName);
398 }
399 
CreateFile(const wchar_t * pathName,s64 size)400 inline void CreateFile(const wchar_t* pathName, s64 size)
401 {
402     detail::GetGlobalFileSystemBase().CreateFile(pathName, size);
403 }
CreateFile(const char * pathName,s64 size)404 inline void CreateFile(const char* pathName, s64 size)
405 {
406     detail::GetGlobalFileSystemBase().CreateFile(pathName, size);
407 }
TryCreateFile(const wchar_t * pathName,s64 size)408 inline Result TryCreateFile(const wchar_t* pathName, s64 size)
409 {
410     return detail::GetGlobalFileSystemBase().TryCreateFile(pathName, size);
411 }
TryCreateFile(const char * pathName,s64 size)412 inline Result TryCreateFile(const char* pathName, s64 size)
413 {
414     return detail::GetGlobalFileSystemBase().TryCreateFile(pathName, size);
415 }
416 
CreateDirectory(const wchar_t * pathName)417 inline void CreateDirectory(const wchar_t* pathName)
418 {
419     detail::GetGlobalFileSystemBase().CreateDirectory(pathName);
420 }
CreateDirectory(const char * pathName)421 inline void CreateDirectory(const char* pathName)
422 {
423     detail::GetGlobalFileSystemBase().CreateDirectory(pathName);
424 }
TryCreateDirectory(const wchar_t * pathName)425 inline Result TryCreateDirectory(const wchar_t* pathName)
426 {
427     return detail::GetGlobalFileSystemBase().TryCreateDirectory(pathName);
428 }
TryCreateDirectory(const char * pathName)429 inline Result TryCreateDirectory(const char* pathName)
430 {
431     return detail::GetGlobalFileSystemBase().TryCreateDirectory(pathName);
432 }
433 
RenameDirectory(const wchar_t * currentPath,const wchar_t * newPath)434 inline void RenameDirectory( const wchar_t* currentPath, const wchar_t* newPath)
435 {
436     detail::GetGlobalFileSystemBase().RenameDirectory(currentPath, newPath);
437 }
RenameDirectory(const char * currentPath,const char * newPath)438 inline void RenameDirectory( const char* currentPath, const char* newPath)
439 {
440     detail::GetGlobalFileSystemBase().RenameDirectory(currentPath, newPath);
441 }
TryRenameDirectory(const wchar_t * currentPath,const wchar_t * newPath)442 inline Result TryRenameDirectory( const wchar_t* currentPath, const wchar_t* newPath)
443 {
444     return detail::GetGlobalFileSystemBase().TryRenameDirectory(currentPath, newPath);
445 }
TryRenameDirectory(const char * currentPath,const char * newPath)446 inline Result TryRenameDirectory( const char* currentPath, const char* newPath)
447 {
448     return detail::GetGlobalFileSystemBase().TryRenameDirectory(currentPath, newPath);
449 }
450 
451 }
452 }
453 #endif  // ifndef NN_FS_FS_FILESYSTEM_H_
454