SpiecsEngine
 
Loading...
Searching...
No Matches

◆ FileLibrary_Write_Line()

bool Spices::FileLibrary::FileLibrary_Write_Line ( const FileHandle * handle,
const char * text )
static

Write one line data to the file handle pointer.

Parameters
[in]handleThe file handle.
[in]textThe one line data pointer.
Returns
true if file handle is valid and successfully write data.

Definition at line 158 of file FileLibrary.cpp.

159 {
161
162 if (handle->handle)
163 {
164 int result = fputs(text, static_cast<FILE*>(handle->handle));
165 if (result != EOF)
166 {
167 result = fputc('\n', static_cast<FILE*>(handle->handle));
168 }
169
170 // Make sure to flush the stream so it is written to the file immediately.
171 // This prevents data loss in the event of a crash.
172 auto state = fflush(static_cast<FILE*>(handle->handle));
173 return result != EOF;
174 }
175 return false;
176 }
#define SPICES_PROFILE_ZONE

References Spices::FileHandle::handle.

Referenced by SpicesTest::TEST().