ADTF  3.18.2
indexedfilereader.h
Go to the documentation of this file.
1 
7 #ifndef _INDEXEDFILE_READER_CLASS_HEADER_
8 #define _INDEXEDFILE_READER_CLASS_HEADER_
9 
10 namespace A_UTILS_NS
11 {
12 
13 //*************************************************************************************************
17 class DOEXPORT cIndexedFileReader : public cIndexedFile
18 {
20 
21  protected:
23  // For internal use only (will be moved to a private implementation).
24  tUInt32 m_ui32Flags;
25  tInt64 m_nEndOfDataMarker;
26  tBool m_bFilePosInvalid;
27  tChunkHeader* m_psCurrentChunk;
28  tVoid* m_pvCurrentChunkData;
29  tBool m_bHeaderValid;
30  tBool m_bDataValid;
31  tBool m_bPrefetched;
32  tInt64 m_nChunkIndex;
33  tInt64 m_nIndexTableIndex;
34  tFilePos m_nFilePosCurrentChunk;
35 
36  cIndexReadTable m_oIndexTable;
37 
38  protected:
39  tBool m_bCompatibilityV110;
40  tVoid* m_pDelegate;
41  std::map<cString, tFileExtension> m_lstExtensionInfoV110ByName;
42  cFilename m_strFilename;
44 
45  public:
49  A_UTILS_DEPRECATED_MESSAGE("The class 'cIndexedFileReader' is deprecated. Please use the aquivalent from the "
50  "adtf_file library instead.")
52 
57 
69  virtual tResult Open(const cString& strFilename, tInt nCacheSize=-1, tUInt32 ui32Flags=0);
70 
78  virtual tResult Close();
79 
87  tResult Reset();
88 
99  tInt64 GetCurrentPos(tInt nTimeFormat);
100 
111  tInt64 SetCurrentPos(tInt64 nPosition, tInt nTimeFormat);
112 
113 
126  tInt64 Seek(tUInt16 ui16StreamId,
127  tInt64 nPosition,
128  tInt nTimeFormat,
129  tUInt32 ui32Flags=0);
130 
140  tResult QueryChunkInfo(tChunkHeader** ppChunkHeader);
141 
153  tResult ReadChunk(tVoid** ppData, tUInt32 ui32Flags=0);
154 
163  tResult SkipChunk();
164 
179  tResult ReadNextChunk(tChunkHeader** ppChunkHeader, tVoid** ppData, tUInt32 ui32Flags=0, tUInt32 ui32StreamId=0);
180 
188  tResult SkipChunkInfo();
189 
199  tResult ReadNextChunkInfo(tChunkHeader** ppChunkHeader);
200 
208  tInt64 GetFilePos();
209 
218  tInt64 GetChunkCount();
219 
228  tTimeStamp GetDuration();
229 
238  tUInt32 GetVersionId();
239 
248  tTimeStamp GetTimeOffset();
249 
260  tInt64 GetStreamTableIndexCount(tUInt16 ui16StreamId);
261 
272  tInt64 GetStreamIndexCount(tUInt16 ui16StreamId);
273 
286  tResult GetAdditionalStreamInfo(tUInt16 ui16StreamId,
287  const tVoid** pInfoData,
288  tUInt* pnInfoSize);
299  const tChar* GetStreamName(tUInt16 ui16StreamId);
300 
311  tTimeStamp GetFirstTime(tUInt16 ui16StreamId);
312 
323  tTimeStamp GetLastTime(tUInt16 ui16StreamId);
324 
330  tInt GetExtensionCount();
331 
344  tResult FindExtension(const tChar* strIdentifier,
345  tFileExtension** ppsExtensionInfo,
346  tVoid** ppData);
347 
360  tResult GetExtension(tInt nIndex,
361  tFileExtension** ppsExtensionInfo,
362  tVoid** ppData);
363 
376  tInt64 LookupChunkRef(tUInt16 ui16StreamId, tInt64 nPosition, tInt nTimeFormat);
377 
378  protected:
383  virtual tResult Initialize();
384 
390  tResult ReadFileHeader();
391 
397  tResult ReadFileHeaderExt();
398 
404  tResult ReadIndexTable();
405 
406  protected:
408  tInt m_nCacheOffset;
410  tInt m_nCacheUsage;
411 
415  tResult ReadCurrentChunkHeader();
416 
420  tResult ReadCurrentChunkData(tVoid* pBuffer);
421 
427  tResult SetEOF();
428 
435  tResult ReadDataBlock(tVoid* pvBuffer, long nBufferSize);
436 
440  tResult ClearCache();
441 
447  tResult CheckFilePtr();
448 
452  tResult AllocReadBuffers();
453 
457  tResult FreeReadBuffers();
458 };
459 
460 } // namespace
461 
462 //*************************************************************************************************
463 #endif // _INDEXEDFILE_READER_CLASS_HEADER_
char tChar
The tChar defines the type for platform character set (platform and compiler dependent 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).
unsigned int tUInt
type definition for unsigned integer value (platform and compiler dependent 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).
File name class.
Definition: filename.h:59
Class for storing an index table of an indexed file.
Base class for all indexed file classes.
Definition: indexedfile.h:74
Class for reading indexed files.
A_UTILS_DEPRECATED_MESSAGE("The class 'cIndexedFileReader' is deprecated. Please use the aquivalent from the " "adtf_file library instead.") cIndexedFileReader()
Default constructor.
#define A_UTILS_D(__pclassname_)
Helper macro for d-pattern definitions.
Definition: d_ptr.h:270
ADTF A_UTIL Namespace - Within adtf this is used as adtf::util or adtf_util.
Definition: d_ptr.h:11
header for chunks Each Chunk header 16 Byte aligned within the file.
Header for a file extensions.