ReadRecord, ReadAt
DESCRIPTION: Read a record from FlitBase file. |
CLASS: CFlitBase
PROTOTYPE(S):CRecord* ReadRecord(int Type, int ID, CRecordHnd *phBuff = NULL); | CRecord* ReadRecord(CTag TID, CRecordHnd *phBuff = NULL); | CRecord* ReadRecord(int &DefPos, int Type, int ID, CRecordHnd *phBuff = NULL); | CRecord* ReadRecord(int &DefPos, CTag TID, CRecordHnd *phBuff = NULL); | CRecord* ReadRecord(int Type, LPCSTR pStr, int TextGrp, int TextID, bool CreateIndex = true); | CRecord* ReadAt(int Pos, CRecordHnd *phBuff = NULL); |
ARGUMENT(S):int Type | The record type to be read. | int ID | The record id to be read. | CTag TID | A tag containing record type and id to be read. | int &DefPos | The default position to be fisrt checked by the system before scanning for the record. | int Pos | The position of the record to be read. | CRecordHnd* phBuff | The pointer to a buffer to be used to hold the record for permanent usage. | LPCSTR pStr | The pointer to a string used to search the record. | int TextGrp | Text group id to search to. | int TextID | Text id to search to. | bool CreateIndex | If true, a new index list will be created if currently not found. |
RETURN VALUE: This function returns the pointer to the read record. In case of error, this function returns a null pointer.
EXAMPLE:
COMMENT: Use these functions to retreive a record from FlitBase file. The record to be read can be determined by its type and id or containing text. ReadAt function can be used to read a record that is determined by its position. A record read from a file is temporary and will be released when the file is closing or when the memory was reallocated by the system for other purposes. In order to make the record always available, you must supply a pointer to a handler to hold the read record permanently. The DefPos argument purposed to speed up the record access by suggesting the position and to hold a new position scanned by the system in case the suggested is not valid. |
|