gramods
Public Member Functions | List of all members
gramods::gmCore::StringFile Struct Reference

This struct creates a FILE pointer to a temporary file and reads off this file's data into string when finalized. More...

#include <StringFile.hh>

Public Member Functions

 ~StringFile ()
 Closes the temporary file if this has not already been done. More...
 
FILE * getFilePtr ()
 Returns the FILE pointer to a temporary file after, if not already done, creating such a FILE object. More...
 
std::string finalize ()
 Rewinds and reads off the temporary file into a string, closes the FILE object and returns the string. More...
 

Detailed Description

This struct creates a FILE pointer to a temporary file and reads off this file's data into string when finalized.

This is useful in communication with pure C libraries.

Constructor & Destructor Documentation

◆ ~StringFile()

gramods::gmCore::StringFile::~StringFile ( )
inline

Closes the temporary file if this has not already been done.

Member Function Documentation

◆ finalize()

std::string gramods::gmCore::StringFile::finalize ( )
inline

Rewinds and reads off the temporary file into a string, closes the FILE object and returns the string.

This can only be called after getFilePtr and then only once.

◆ getFilePtr()

FILE* gramods::gmCore::StringFile::getFilePtr ( )
inline

Returns the FILE pointer to a temporary file after, if not already done, creating such a FILE object.


The documentation for this struct was generated from the following file: