|
@@ -131,49 +131,49 @@ public:
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* Write all stored output to the output stream.
|
|
|
* @param out_fp Stream to write the \a data to.
|
|
|
*/
|
|
|
void Write(FILE *out_fp) const
|
|
|
{
|
|
|
for (const OutputBuffer &out_data : output_buffer) {
|
|
|
out_data.Write(out_fp);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
private:
|
|
|
/**
|
|
|
* Does the buffer have room without adding a new #OutputBuffer block?
|
|
|
* @return \c true if room is available, else \c false.
|
|
|
*/
|
|
|
bool BufferHasRoom() const
|
|
|
{
|
|
|
uint num_blocks = this->output_buffer.size();
|
|
|
return num_blocks > 0 && this->output_buffer[num_blocks - 1].HasRoom();
|
|
|
}
|
|
|
|
|
|
typedef SmallVector<OutputBuffer, 2> OutputBufferVector; ///< Vector type for output buffers.
|
|
|
typedef std::vector<OutputBuffer> OutputBufferVector; ///< Vector type for output buffers.
|
|
|
OutputBufferVector output_buffer; ///< Vector of blocks containing the stored output.
|
|
|
};
|
|
|
|
|
|
|
|
|
/** Derived class for loading INI files without going through Fio stuff. */
|
|
|
struct SettingsIniFile : IniLoadFile {
|
|
|
/**
|
|
|
* Construct a new ini loader.
|
|
|
* @param list_group_names A \c NULL terminated list with group names that should be loaded as lists instead of variables. @see IGT_LIST
|
|
|
* @param seq_group_names A \c NULL terminated list with group names that should be loaded as lists of names. @see IGT_SEQUENCE
|
|
|
*/
|
|
|
SettingsIniFile(const char * const *list_group_names = NULL, const char * const *seq_group_names = NULL) :
|
|
|
IniLoadFile(list_group_names, seq_group_names)
|
|
|
{
|
|
|
}
|
|
|
|
|
|
virtual FILE *OpenFile(const char *filename, Subdirectory subdir, size_t *size)
|
|
|
{
|
|
|
/* Open the text file in binary mode to prevent end-of-line translations
|
|
|
* done by ftell() and friends, as defined by K&R. */
|
|
|
FILE *in = fopen(filename, "rb");
|
|
|
if (in == NULL) return NULL;
|
|
|
|
|
|
fseek(in, 0L, SEEK_END);
|