imgtools/romtools/rofsbuild/inc/cache/cacheentry.hpp
author Ross Qin <ross.qin@nokia.com>
Tue, 02 Nov 2010 16:47:21 +0800
changeset 672 bc9ef8cca9ec
parent 600 6d08f4a05d93
permissions -rw-r--r--
revert the change to rofsbuild image format, but add checking codes to prevent address overflow
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
600
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
     1
/**
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
     2
 * @file cacheentry.hpp
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
     3
 */
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
     4
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
     5
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
     6
#ifndef ROM_TOOLS_ROFSBUILD_CACHE_CACHEENTRY_H_
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
     7
#define ROM_TOOLS_ROFSBUILD_CACHE_CACHEENTRY_H_
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
     8
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
     9
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    10
/**
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    11
 * @class CacheEntry
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    12
 * @brief CacheEntry holds both original executable data and cached executable data.
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    13
 */
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    14
class CacheEntry
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    15
{
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    16
public:
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    17
	CacheEntry(void);
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    18
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    19
	/**
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    20
	 * @fn void CacheEntry::SetOriginalFilename(const char* OriginalFilename)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    21
	 * @brief Assign the original filename of the executable to be cached.
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    22
	 * @param OriginalFilename The original filename.
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    23
	 */
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    24
	void SetOriginalFilename(const char* OriginalFilename);
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    25
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    26
	/**
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    27
	 * @fn const char* CacheEntry::GetOriginalFilename(void)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    28
	 * @return The original filename.
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    29
	 */
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    30
	const char* GetOriginalFilename(void) const;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    31
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    32
	void SetCachedFilename(const char* CachedFilename);
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    33
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    34
	const char* GetCachedFilename(void) const;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    35
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    36
	void SetOriginalFileCreateTime(time_t* CreateRawTime);
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    37
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    38
	void SetOriginalFileCreateTime(const char* CreateRawTime);
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    39
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    40
	const char* GetOriginalFileCreateTime(void) const;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    41
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    42
	void SetOriginalFileCompression(const char* CompressionMethodID);
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    43
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    44
	void SetOriginalFileCompression(unsigned int CompressionMethodID);
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    45
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    46
	const char* GetOriginalFileCompressionID(void) const;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    47
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    48
	void SetCachedFileCompression(const char* CompressionMethodID);
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    49
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    50
	void SetCachedFileCompression(unsigned int CompressionMethodID);
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    51
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    52
	const char* GetCachedFileCompressionID(void) const;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    53
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    54
	void SetCachedFileBuffer(char* FileBuffer, int FileBufferLen);
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    55
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    56
	const char* GetCachedFileBuffer(void) const;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    57
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    58
	int GetCachedFileBufferLen(void) const;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    59
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    60
	void AppendEntry(CacheEntry* EntryRef);
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    61
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    62
	CacheEntry* GetNextEntry(void) const;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    63
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    64
	void SetNextEntry(CacheEntry* EntryRef);
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    65
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    66
	bool Equals(CacheEntry* EntryRef);
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    67
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    68
	virtual ~CacheEntry(void);
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    69
protected:
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    70
	std::string originalfile;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    71
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    72
	std::string cachedfile;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    73
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    74
	std::string originalfilecreatetime;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    75
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    76
	std::string originalfilecompression;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    77
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    78
	std::string cachedfilecompression;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    79
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    80
	std::string compressionenabled;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    81
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    82
	std::string compressionindicator;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    83
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    84
	CacheEntry* next;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    85
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    86
	char* cachedfilebuffer;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    87
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    88
	int cachedfilebuffersize;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    89
private:
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    90
	CacheEntry(const CacheEntry&);
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    91
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    92
	CacheEntry& operator = (const CacheEntry&);
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    93
};
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    94
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    95
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    96
#endif  /* defined ROM_TOOLS_ROFSBUILD_CACHE_CACHEENTRY_H_ */