FireSync API
 All Classes Files Functions Variables Typedefs Friends Macros Modules Pages
kArchive.h
Go to the documentation of this file.
1 
8 #ifndef K_FIRESYNC_ARCHIVE_H
9 #define K_FIRESYNC_ARCHIVE_H
10 
11 #include <kFireSync/kFsDef.h>
12 
13 kBeginHeader()
14 
15 //typedef kObject kArchive; --forward-declared in kFsDef.x.h
16 
17 typedef struct kArchiveFileInfo
18 {
19  k64u attributes;
20  k64u time;
21 } kArchiveFileInfo;
22 
23 // TODO:
24 // - Add a flag to allow choosing between "fast load" and "full load"
25 // currently only fast load is supported which does not parse the file
26 // into an editable structure. This is useful on devices with limited
27 // resources such as the DSP. However on the host where package generation
28 // and possibly modification takes place, it is more desirable to be
29 // able to load an archive and then work on that.
30 
31 kFsFx(kStatus) kArchive_Construct(kArchive *archive, kAlloc alloc);
32 
33 kFsFx(kStatus) kArchive_Load(kArchive archive, const kChar *fileName);
34 kFsFx(kStatus) kArchive_Save(kArchive archive, const kChar *fileName);
35 
36 kFsFx(kStatus) kArchive_Read(kArchive archive, kStream stream);
37 kFsFx(kStatus) kArchive_Write(kArchive archive, kStream stream);
38 
39 kFsFx(kStatus) kArchive_ReadSerializer(kArchive archive, kSerializer serializer);
40 
41 kFsFx(k64u) kArchive_Size(kArchive archive);
42 kFsFx(k32u) kArchive_Crc(kArchive archive);
43 
44 kFsFx(kStatus) kArchive_Attach(kArchive archive, const void *data, k64u length);
45 kFsFx(kStatus) kArchive_Detach(kArchive archive);
46 
47 kFsFx(kStatus) kArchive_AddData(kArchive archive, const void *data, k64u size, const kChar *fileName, const kArchiveFileInfo *info);
48 kFsFx(kStatus) kArchive_AddFile(kArchive archive, const kChar *sourceFile, const kChar *destFile);
49 kFsFx(kStatus) kArchive_DeleteFile(kArchive archive, const kChar* fileName);
50 
51 kFsFx(kStatus) kArchive_AddDirectory(kArchive archive, const kChar* sourceDir, const kChar *destBaseDir);
52 
53 kFsFx(kStatus) kArchive_Extract(kArchive archive, const kChar *destDir);
54 
55 kFsFx(kSize) kArchive_Count(kArchive archive);
56 kFsFx(kStatus) kArchive_Find(kArchive archive, const kChar *fileName, kSize *index);
57 
58 kFsFx(k64u) kArchive_FileSize(kArchive archive, kSize fileIndex);
59 kFsFx(const void*) kArchive_FileData(kArchive archive, kSize fileIndex);
60 kFsFx(const kChar*) kArchive_FileName(kArchive archive, kSize fileIndex);
61 kFsFx(kStatus) kArchive_FileInfo(kArchive archive, kSize fileIndex, kArchiveFileInfo *fileInfo);
62 
63 kEndHeader()
64 
65 #include <kFireSync/Data/kArchive.x.h>
66 
67 #endif
Essential API declarations for the kFireSync library.