void CBlockFile::WriteBlockHeader(const char *name, const char *comment) { unsigned nameLen, commentLen; const char nullComment[1] = {'\0'}; if (NULL == fp) return; if (comment == NULL) comment = nullComment; nameLen = strlen(name); commentLen = strlen(comment); if (nameLen > 1024) nameLen = 1024; if (commentLen > 1024) commentLen = 1024; // Record current block starting position blockStartPos = ftell(fp); // Write the total block length field WriteDWord(0); // will be automatically updated as we write the file // Write name and comment lengths WriteDWord(nameLen+1); WriteDWord(commentLen+1); WriteBytes(name, nameLen); WriteByte(0); WriteBytes(comment, commentLen); WriteByte(0); // Record the start of the current data section dataStartPos = ftell(fp); }
void ResFile::Release() { size_t pos = stream->tellp(); stream->seekp(base); WriteDWord(pos - base - hdrSize); WriteDWord(hdrSize); stream->seekp(pos); }
void StdCompilerConfigWrite::Boolean(bool &rBool) { WriteDWord(rBool ? 1 : 0); }
void StdCompilerConfigWrite::Byte(uint8_t &rInt) { WriteDWord(rInt); }
void StdCompilerConfigWrite::Word(uint16_t &rInt) { WriteDWord(rInt); }
void StdCompilerConfigWrite::DWord(int32_t &rInt) { WriteDWord(rInt); }