ADTF
|
Base class for all indexed file classes. More...
Classes | |
struct | tFileExtensionStruct |
combines a file extension information with a concrete extension page More... | |
Public Member Functions | |
cIndexedFile () | |
Default constructor. | |
virtual | ~cIndexedFile () |
Destructor. | |
virtual tResult | Close () |
Closes the file. More... | |
tResult | SetDescription (const tChar *strDescription) |
Sets the description of the file. More... | |
const tChar * | GetDescription () const |
Returns the description of the file. More... | |
tResult | GetGUID (cString &strGUID) |
Get the GUID of the file. More... | |
tResult | SetDateTime (const tDateTime *psDateTime) |
Set the timestamp of the file. More... | |
tResult | GetDateTime (tDateTime *psDateTime) |
Get the timestamp of the file. More... | |
tUInt8 | GetByteOrder () |
Returns the byteorder of the file. More... | |
tInt | GetExtensionCount () |
Get the amount of extensions in the file. More... | |
tResult | FindExtension (const tChar *strIdentifier, tFileExtension **ppsExtensionInfo, tVoid **ppData) |
Finds an extension with a specific identifier. More... | |
tResult | GetExtension (tInt nIndex, tFileExtension **ppsExtensionInfo, tVoid **ppData) |
Get an extension with a specific index. More... | |
tResult | AppendExtension (const tChar *strIdentifier, const tVoid *pData, tInt nDataSize, tUInt32 ui32TypeId=0, tUInt32 ui32VersionId=0, tUInt16 ui16StreamId=0, tUInt32 ui32UserId=0) |
Adds a new extension to the file. More... | |
tResult | AppendExtension (const tVoid *pData, const tFileExtension *psExtensionInfo) |
Adds a new extension to the file. More... | |
tResult | FreeExtension (const tChar *strIdentifier) |
Frees specific extensions. More... | |
tResult | FreeExtensions () |
Frees all extensions. More... | |
tResult | GetHeader (tFileHeader **ppsFileHeader) |
Returns the file header. More... | |
Protected Types | |
typedef std::list< tFileExtensionStruct * > | tFileExtensionList |
own type definition for a better work with file extension lists | |
Protected Member Functions | |
virtual tResult | Initialize () |
Initializes internal data. | |
tResult | AllocBuffer (tInt64 nSize) |
Allocates an internal buffer. More... | |
tResult | FreeBuffer () |
Releases the internal buffer. | |
tResult | AllocHeader () |
Allocates the header structure/data. | |
tResult | FreeHeader () |
Releases the header data. | |
tResult | AllocExtensionPage (tFileSize nSize, tVoid **ppData) |
Allocate memory for an extension. More... | |
tResult | SetGUID () |
Sets the GUID of the file. More... | |
tResult | GenerateNewGUID (cString &strGeneratedGUID) |
Generates a new GUID (XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX) More... | |
tResult | AllocCache (tInt64 nSize) |
Initialzes an internal cache. More... | |
tResult | FreeCache () |
Releases the cache. | |
tVoid * | GetCacheAddr () |
Returns the cache pointer. | |
tInt | GetSectorSize (const tChar *strFilename) const |
Get the sector size of the filesystem that a specified file resides on. More... | |
tFileSize | GetSizeOnDisk (tFileSize nSize, tBool bUseSegmentSize) |
Calculates the size a data block requires on disk. More... | |
tVoid * | InternalMalloc (tInt64 nSize, tBool bUseSegmentSize) |
Allocates memory. More... | |
tVoid | InternalFree (tVoid *pMemory) |
Release memory. More... | |
Protected Attributes | |
tInt64 | m_nSectorSize |
current sector size used for disk device depend on drive given by filename within Create method of cIndexedFileReader or cIndexFileWriter | |
tBool | m_bSystemCacheDisabled |
whether system cache used or not depend on flags given within Create method of cIndexedFileReader or cIndexFileWriter | |
cFile | m_oFile |
the open file | |
tFilePos | m_nFilePos |
current filepos | |
tUInt8 * | m_pBuffer |
internal Buffer | |
tInt64 | m_nBufferSize |
internal Buffer size | |
tFileHeader * | m_psFileHeader |
current file header | |
tBool | m_bWriteGUID |
protection for writing GUID | |
tFileExtensionList | m_lstExtensions |
list with all extensions | |
tVoid * | m_pCache |
cache data area | |
tInt64 | m_nCacheSize |
size of cache | |
tBool | m_bWriteMode |
For internal use only (will be moved to a private implementation). | |
Static Protected Attributes | |
static const tUInt32 | m_nFileId |
For internal use only (will be moved to a private implementation). | |
static const tUInt32 | m_nVersionId |
supported Version of Indexed File within ADTF 2.0 until 2.12 and >= 2.13 if NO History is used while writing file (currently 0x00000201) | |
static const tUInt32 | m_nVersionIdWithHistory |
supported Version of Indexed File within >= ADTF 2.13 if a file buffered history is used while writing file (currently 0x00000300) | |
static const tUInt32 | m_nVersionIdWithHistoryEndOffset |
supported Version of Indexed File within >= ADTF 2.13.1 if a file buffered history is used while writing file (currently 0x00000301) | |
static const tUInt32 | m_nVersionADTF3 |
supported Version of Indexed File within >= ADTF 3.0.0 (currently 0x00000301) | |
static const tUInt8 | m_ui8ByteOrder |
current value of platform ByteOrder ( More... | |
static tInt64 | m_nDefaultBlockSize |
Default block size in bytes. | |
static tInt64 | m_nDefaultCacheSize |
Default cache size in bytes. | |
Additional Inherited Members | |
Public Types inherited from IIndexedFile | |
enum | tTimeFormat { TF_ChunkIndex = 1 , TF_ChunkTime = 2 , TF_StreamIndex = 3 } |
Time format (for seek etc.) More... | |
enum | tReadFlags { RF_None = 0x0 , RF_UseExternalBuffer = 0x1 , RF_Backwards = 0x2 } |
Read options. | |
enum | tSeekFlags { SF_DEFAULT = 0x0 , SF_KEYDATA = 0x1 , SF_BEFORE = 0x02 } |
Seek flags. More... | |
enum | tChunkType { CT_DATA = 0x00 , CT_KEYDATA = 0x01 , CT_INFO = 0x02 , CT_MARKER = 0x04 , CT_TYPE = 0x08 , CT_TRIGGER = 0x10 } |
The chunk types. More... | |
enum | tOpenMode { OM_None = 0x00 , OM_DisableFileSystemCache = 0x01 , OM_SyncWrite = 0x02 , OM_QueryInfo = 0x04 , OM_ValidateChunkHeader = 0x08 , OM_FileChangeMode = 0x10 } |
File open modes. More... | |
Base class for all indexed file classes.
Definition at line 73 of file indexedfile.h.
Allocates an internal buffer.
[in] | nSize | The size in bytes to allocate. |
Initialzes an internal cache.
[in] | nSize | The size of the cache. |
Allocate memory for an extension.
[in] | nSize | The amount of bytes to allocate. |
[out] | ppData | Pointer to the allocated space. |
tResult AppendExtension | ( | const tChar * | strIdentifier, |
const tVoid * | pData, | ||
tInt | nDataSize, | ||
tUInt32 | ui32TypeId = 0 , |
||
tUInt32 | ui32VersionId = 0 , |
||
tUInt16 | ui16StreamId = 0 , |
||
tUInt32 | ui32UserId = 0 |
||
) |
Adds a new extension to the file.
strIdentifier | [in] The identifier of the extension. |
pData | [in] The extension data. |
nDataSize | [in] The data size. |
ui32TypeId | [in] An optional type id |
ui32VersionId | [in] An optional version id |
ui16StreamId | [in] An optional stream id |
ui32UserId | [in] An optional user id |
tResult AppendExtension | ( | const tVoid * | pData, |
const tFileExtension * | psExtensionInfo | ||
) |
Adds a new extension to the file.
pData | [in] The extension data. |
psExtensionInfo | [in] The extension info. |
|
virtual |
Closes the file.
Reimplemented in cIndexedFileWriter, and cIndexedFileReader.
tResult FindExtension | ( | const tChar * | strIdentifier, |
tFileExtension ** | ppsExtensionInfo, | ||
tVoid ** | ppData | ||
) |
Finds an extension with a specific identifier.
strIdentifier | [in] The identifier of the extension |
ppsExtensionInfo | [out] The extension info data. |
ppData | [out] The extension data. |
Frees specific extensions.
strIdentifier | [in] the specific extension. |
tResult FreeExtensions | ( | ) |
Frees all extensions.
Generates a new GUID (XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX)
strGeneratedGUID | [out] new generated GUID |
tUInt8 GetByteOrder | ( | ) |
Returns the byteorder of the file.
Get the timestamp of the file.
psDateTime | [out] The timestamp of the file. |
const tChar* GetDescription | ( | ) | const |
Returns the description of the file.
tResult GetExtension | ( | tInt | nIndex, |
tFileExtension ** | ppsExtensionInfo, | ||
tVoid ** | ppData | ||
) |
Get an extension with a specific index.
nIndex | [in] The index of the extension. |
ppsExtensionInfo | [out] The extension info data. |
ppData | [out] The extension data. |
tInt GetExtensionCount | ( | ) |
Get the amount of extensions in the file.
Get the GUID of the file.
strGUID | [out] the GUID of the file |
tResult GetHeader | ( | tFileHeader ** | ppsFileHeader | ) |
Returns the file header.
ppsFileHeader | [out] Will point to the file header. |
Get the sector size of the filesystem that a specified file resides on.
strFilename | [in] The filename. |
Calculates the size a data block requires on disk.
[in] | nSize | The size of the data block. |
[in] | bUseSegmentSize | Include the segment size into the calculation. |
Release memory.
[in] | pMemory | The memory which should be free'd. |
Allocates memory.
[in] | nSize | The size of the data block. |
[in] | bUseSegmentSize | Whether or not to align the memory on segment boundaries. |
Set the timestamp of the file.
The timestamp is calculated from the passed date/time structure while the current time zone from the system is used.
psDateTime | [in] The new date/time for the timestamp. |
Sets the description of the file.
strDescription | [in] The new description. |
|
protected |
Sets the GUID of the file.
|
staticprotected |
current value of platform ByteOrder (
Definition at line 92 of file indexedfile.h.