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