600
|
1 |
/**
|
|
2 |
* @file cacheentry.hpp
|
|
3 |
*/
|
|
4 |
|
|
5 |
|
|
6 |
#ifndef ROM_TOOLS_ROFSBUILD_CACHE_CACHEENTRY_H_
|
|
7 |
#define ROM_TOOLS_ROFSBUILD_CACHE_CACHEENTRY_H_
|
|
8 |
|
|
9 |
|
|
10 |
/**
|
|
11 |
* @class CacheEntry
|
|
12 |
* @brief CacheEntry holds both original executable data and cached executable data.
|
|
13 |
*/
|
|
14 |
class CacheEntry
|
|
15 |
{
|
|
16 |
public:
|
|
17 |
CacheEntry(void);
|
|
18 |
|
|
19 |
/**
|
|
20 |
* @fn void CacheEntry::SetOriginalFilename(const char* OriginalFilename)
|
|
21 |
* @brief Assign the original filename of the executable to be cached.
|
|
22 |
* @param OriginalFilename The original filename.
|
|
23 |
*/
|
|
24 |
void SetOriginalFilename(const char* OriginalFilename);
|
|
25 |
|
|
26 |
/**
|
|
27 |
* @fn const char* CacheEntry::GetOriginalFilename(void)
|
|
28 |
* @return The original filename.
|
|
29 |
*/
|
|
30 |
const char* GetOriginalFilename(void) const;
|
|
31 |
|
|
32 |
void SetCachedFilename(const char* CachedFilename);
|
|
33 |
|
|
34 |
const char* GetCachedFilename(void) const;
|
|
35 |
|
|
36 |
void SetOriginalFileCreateTime(time_t* CreateRawTime);
|
|
37 |
|
|
38 |
void SetOriginalFileCreateTime(const char* CreateRawTime);
|
|
39 |
|
|
40 |
const char* GetOriginalFileCreateTime(void) const;
|
|
41 |
|
|
42 |
void SetOriginalFileCompression(const char* CompressionMethodID);
|
|
43 |
|
|
44 |
void SetOriginalFileCompression(unsigned int CompressionMethodID);
|
|
45 |
|
|
46 |
const char* GetOriginalFileCompressionID(void) const;
|
|
47 |
|
|
48 |
void SetCachedFileCompression(const char* CompressionMethodID);
|
|
49 |
|
|
50 |
void SetCachedFileCompression(unsigned int CompressionMethodID);
|
|
51 |
|
|
52 |
const char* GetCachedFileCompressionID(void) const;
|
|
53 |
|
|
54 |
void SetCachedFileBuffer(char* FileBuffer, int FileBufferLen);
|
|
55 |
|
|
56 |
const char* GetCachedFileBuffer(void) const;
|
|
57 |
|
|
58 |
int GetCachedFileBufferLen(void) const;
|
|
59 |
|
|
60 |
void AppendEntry(CacheEntry* EntryRef);
|
|
61 |
|
|
62 |
CacheEntry* GetNextEntry(void) const;
|
|
63 |
|
|
64 |
void SetNextEntry(CacheEntry* EntryRef);
|
|
65 |
|
|
66 |
bool Equals(CacheEntry* EntryRef);
|
|
67 |
|
|
68 |
virtual ~CacheEntry(void);
|
|
69 |
protected:
|
|
70 |
std::string originalfile;
|
|
71 |
|
|
72 |
std::string cachedfile;
|
|
73 |
|
|
74 |
std::string originalfilecreatetime;
|
|
75 |
|
|
76 |
std::string originalfilecompression;
|
|
77 |
|
|
78 |
std::string cachedfilecompression;
|
|
79 |
|
|
80 |
std::string compressionenabled;
|
|
81 |
|
|
82 |
std::string compressionindicator;
|
|
83 |
|
|
84 |
CacheEntry* next;
|
|
85 |
|
|
86 |
char* cachedfilebuffer;
|
|
87 |
|
|
88 |
int cachedfilebuffersize;
|
|
89 |
private:
|
|
90 |
CacheEntry(const CacheEntry&);
|
|
91 |
|
|
92 |
CacheEntry& operator = (const CacheEntry&);
|
|
93 |
};
|
|
94 |
|
|
95 |
|
|
96 |
#endif /* defined ROM_TOOLS_ROFSBUILD_CACHE_CACHEENTRY_H_ */
|