60int TagBlockHandle::_InDestructor = 0;
69 BlockOffset(blockoffset),
70 DataOffset(
TagBlockFile::Calc_Data_Offset(blockoffset, tagname))
142 int curpos =
sizeof(
Header);
146 for (block = 0; block <
Header.NumBlocks; block++) {
151 Read(&blockheader,
sizeof(blockheader));
154 if (blockheader.
Index == block) {
171 if ((curpos !=
Header.FileSize) || (block !=
Header.NumBlocks)) {
258 Read(blockheader,
sizeof(*blockheader));
303 Write(blockheader,
sizeof(*blockheader));
304 Write(tagname, strlen(tagname) + 1);
347 assert(handle->Called_By_Destructor());
353 delete handle->BlockHeader;
383 Write(handle->BlockHeader,
sizeof(*handle->BlockHeader));
472 assert(name !=
NULL);
473 assert(tagname !=
NULL);
474 if (!strcmpi(name, tagname)) {
536 BlockHeader(blockheader),
556 File->Destroy_Handle(
this);
575 if (!File->Handle_Can_Write(
this)) {
580 File->Seek(Index->Get_DataOffset() + Position,
SEEK_SET);
581 nbytes = File->Write(buf, nbytes);
585 if (Position > BlockHeader->DataSize) {
586 BlockHeader->DataSize = Position;
608 if ((Position + nbytes) > BlockHeader->DataSize) {
609 nbytes = BlockHeader->DataSize - Position;
613 File->Seek(Index->Get_DataOffset() + Position,
SEEK_SET);
614 nbytes = File->Read(buf, nbytes);
645 Position = BlockHeader->DataSize + pos;
unsigned long CRC_Stringi(const char *string, unsigned long crc)
virtual int Open(char const *filename, int rights=READ)
virtual int Seek(int pos, int dir=SEEK_CUR)
RawFileClass(char const *filename)
virtual int Write(void const *buffer, int size)
virtual unsigned long Get_Date_Time(void)
virtual int Read(void *buffer, int size)
virtual void Reset_File()
void Close_Tag(TagBlockHandle *handle)
SList< TagBlockIndex > IndexList
TagBlockHandle * Create_Tag(const char *tagname)
TagBlockIndex * Find_Block(const char *tagname)
TagBlockHandle * CreateHandle
int End_Write_Access(TagBlockHandle *handle)
static int Calc_Tag_Offset(int blockoffset)
TagBlockHandle * Open_Tag(const char *tagname)
TagBlockIndex * Create_Index(const char *tagname, int blockoffset)
void Destroy_Handle(TagBlockHandle *handle)
friend class TagBlockHandle
TagBlockFile(const char *fname)
int Read(void *buf, int nbytes)
int Write(const void *buf, int nbytes)
int Seek(int pos, int dir=SEEK_CUR)
TagBlockIndex(const char *tagname, int blockoffset)