7 #ifndef _INDEXEDFILE_CLASS_HEADER_
8 #define _INDEXEDFILE_CLASS_HEADER_
39 #define IDX_EXT_INDEX "index"
41 #define IDX_EXT_INDEX_0 IDX_EXT_INDEX "0"
43 #define IDX_EXT_INDEX_ADDITONAL "index_add"
45 #define IDX_EXT_INDEX_ADDITONAL_0 IDX_EXT_INDEX_ADDITONAL "0"
uint8_t tUInt8
type definition for unsigned integer values (8bit) (platform and compiler independent type).
char tChar
The tChar defines the type for platform character set (platform and compiler dependent type).
tInt64 tFileSize
type definition for a file or stream size value (platform and compiler independent type).
int64_t tInt64
type definition for signed integer values (64bit) (platform and compiler independent type).
tInt64 tFilePos
type definition for a file or stream position value (platform and compiler independent type).
void tVoid
The tVoid is always the definition for the void (non-type).
uint16_t tUInt16
type definition for unsigned integer values (16bit) (platform and compiler independent type).
int tInt
type definition for signed integer value (platform and compiler dependent type).
bool tBool
The tBool defines the type for the Values tTrue and tFalse (platform and compiler dependent).
uint32_t tUInt32
type definition for unsigned integer values (32bit) (platform and compiler independent type).
Base class for all indexed file classes.
tUInt8 * m_pBuffer
internal Buffer
tVoid InternalFree(tVoid *pMemory)
Release memory.
static const tUInt32 m_nVersionIdWithHistoryEndOffset
supported Version of Indexed File within >= ADTF 2.13.1 if a file buffered history is used while writ...
static const tUInt32 m_nVersionADTF3
supported Version of Indexed File within >= ADTF 3.0.0 (currently 0x00000301)
const tChar * GetDescription() const
Returns the description of the file.
tBool m_bWriteMode
For internal use only (will be moved to a private implementation).
tBool m_bSystemCacheDisabled
whether system cache used or not depend on flags given within Create method of cIndexedFileReader or ...
static tInt64 m_nDefaultCacheSize
Default cache size in bytes.
static const tUInt8 m_ui8ByteOrder
current value of platform ByteOrder (
static const tUInt32 m_nVersionIdWithHistory
supported Version of Indexed File within >= ADTF 2.13 if a file buffered history is used while writin...
tResult GetDateTime(tDateTime *psDateTime)
Get the timestamp of the file.
tResult SetGUID()
Sets the GUID of the file.
tFileSize GetSizeOnDisk(tFileSize nSize, tBool bUseSegmentSize)
Calculates the size a data block requires on disk.
tResult FreeCache()
Releases the cache.
tResult AppendExtension(const tVoid *pData, const tFileExtension *psExtensionInfo)
Adds a new extension to the file.
tResult FreeBuffer()
Releases the internal buffer.
tVoid * InternalMalloc(tInt64 nSize, tBool bUseSegmentSize)
Allocates memory.
tInt GetSectorSize(const tChar *strFilename) const
Get the sector size of the filesystem that a specified file resides on.
tFilePos m_nFilePos
current filepos
virtual tResult Initialize()
Initializes internal data.
tResult FindExtension(const tChar *strIdentifier, tFileExtension **ppsExtensionInfo, tVoid **ppData)
Finds an extension with a specific identifier.
tResult FreeExtensions()
Frees all extensions.
tInt64 m_nBufferSize
internal Buffer size
cFile m_oFile
the open file
cIndexedFile()
Default constructor.
tResult AllocBuffer(tInt64 nSize)
Allocates an internal buffer.
static tInt64 m_nDefaultBlockSize
Default block size in bytes.
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 ...
tResult AllocCache(tInt64 nSize)
Initialzes an internal cache.
tUInt8 GetByteOrder()
Returns the byteorder of the file.
static const tUInt32 m_nFileId
For internal use only (will be moved to a private implementation).
tResult GetExtension(tInt nIndex, tFileExtension **ppsExtensionInfo, tVoid **ppData)
Get an extension with a specific index.
tResult FreeHeader()
Releases the header data.
tResult SetDescription(const tChar *strDescription)
Sets the description of the file.
tResult GetHeader(tFileHeader **ppsFileHeader)
Returns the file header.
virtual tResult Close()
Closes the file.
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.
virtual ~cIndexedFile()
Destructor.
tBool m_bWriteGUID
protection for writing GUID
tResult FreeExtension(const tChar *strIdentifier)
Frees specific extensions.
tVoid * m_pCache
cache data area
tFileHeader * m_psFileHeader
current file header
tResult GetGUID(cString &strGUID)
Get the GUID of the file.
tVoid * GetCacheAddr()
Returns the cache pointer.
std::list< tFileExtensionStruct * > tFileExtensionList
own type definition for a better work with file extension lists
tResult GenerateNewGUID(cString &strGeneratedGUID)
Generates a new GUID (XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX)
tResult AllocExtensionPage(tFileSize nSize, tVoid **ppData)
Allocate memory for an extension.
tResult SetDateTime(const tDateTime *psDateTime)
Set the timestamp of the file.
tFileExtensionList m_lstExtensions
list with all extensions
tResult AllocHeader()
Allocates the header structure/data.
tInt64 m_nCacheSize
size of cache
tInt GetExtensionCount()
Get the amount of extensions in the file.
tInt64 m_nSectorSize
current sector size used for disk device depend on drive given by filename within Create method of cI...
A common result class usable as return value throughout.
#define A_UTILS_D(__pclassname_)
Helper macro for d-pattern definitions.
ADTF A_UTIL Namespace - Within adtf this is used as adtf::util or adtf_util.
combines a file extension information with a concrete extension page
tFileExtension sFileExtension
file extension intormation
tVoid * pExtensionPage
pointer to extension page
Struct to handle date and time together.
Header for a file extensions.