COPASI API
4.16.103
|
#include <CWriteConfig.h>
Public Member Functions | |
CWriteConfig () | |
CWriteConfig (const std::string &name, std::ios_base::openmode mode=std::ios_base::out) | |
C_INT32 | fail () |
C_INT32 | flush () |
void | setDefaults () |
C_INT32 | setVariable (const std::string &name, const std::string &type, const void *pout) |
C_INT32 | setVariable (const std::string &name, const std::string &type, const void *pout1, const void *pout2) |
~CWriteConfig () | |
Private Member Functions | |
C_INT32 | commit () |
void | writeVersion (void) |
Private Attributes | |
std::stringstream | mBuffer |
C_INT32 | mFail |
std::string | mFileName |
unsigned C_INT32 | mLineNumber |
std::ios_base::openmode | mOpenMode |
CWriteConfig class. A more elaborate class description.
New Class based on pmutils read functionality (C) Stefan Hoops 2001
Definition at line 25 of file CWriteConfig.h.
CWriteConfig::CWriteConfig | ( | void | ) |
Default consructor. This creates a configuration buffer without assigning a filename. It is currently useless.
Definition at line 30 of file CWriteConfig.cpp.
References mBuffer, mFail, mFileName, mLineNumber, and mOpenMode.
CWriteConfig::CWriteConfig | ( | const std::string & | name, |
std::ios_base::openmode | mode = std::ios_base::out |
||
) |
Specified consructor. This opens the configuration file using the filename specified as the argument.
name | name of the confguration file. |
mode | output mode, defaults to creating a new file. |
Definition at line 42 of file CWriteConfig.cpp.
References mBuffer, mFail, mFileName, mLineNumber, mOpenMode, and writeVersion().
CWriteConfig::~CWriteConfig | ( | void | ) |
Destructor. The destructor calls the method flush().
Definition at line 57 of file CWriteConfig.cpp.
References commit().
Commits all information to the configuration file. This method is called by the destructor.
Definition at line 75 of file CWriteConfig.cpp.
References fatalError, mBuffer, mFail, mFileName, and mOpenMode.
Referenced by flush(), and ~CWriteConfig().
C_INT32 CWriteConfig::fail | ( | ) |
Returns the failure status.
Definition at line 104 of file CWriteConfig.cpp.
References mFail.
Flush the output buffer to the configuration file.
Definition at line 62 of file CWriteConfig.cpp.
References commit(), fatalError, mBuffer, and mFail.
void CWriteConfig::setDefaults | ( | ) |
C_INT32 CWriteConfig::setVariable | ( | const std::string & | name, |
const std::string & | type, | ||
const void * | pout | ||
) |
Writes a variable to the output file.
name | name of the variable to be written. |
type | type of the variable to be written. |
*pout | pointer to the location where the variable is stored. |
Definition at line 110 of file CWriteConfig.cpp.
References C_FLOAT64, C_INT16, C_INT32, fatalError, mBuffer, mFail, and mLineNumber.
Referenced by writeVersion().
C_INT32 CWriteConfig::setVariable | ( | const std::string & | name, |
const std::string & | type, | ||
const void * | pout1, | ||
const void * | pout2 | ||
) |
Definition at line 161 of file CWriteConfig.cpp.
References C_INT32, fatalError, mBuffer, mFail, and mLineNumber.
Writes a version number to the file. This method is called by one of the constructors.
Definition at line 192 of file CWriteConfig.cpp.
References setVariable().
Referenced by CWriteConfig().
|
private |
Output file
Definition at line 108 of file CWriteConfig.h.
Referenced by commit(), CWriteConfig(), flush(), and setVariable().
|
private |
Failure status: 0 = no error !0 = error
Definition at line 125 of file CWriteConfig.h.
Referenced by commit(), CWriteConfig(), fail(), flush(), and setVariable().
|
private |
Name of the configuration file.
Definition at line 103 of file CWriteConfig.h.
Referenced by commit(), and CWriteConfig().
|
private |
Current line number in the configuration file
Definition at line 113 of file CWriteConfig.h.
Referenced by CWriteConfig(), and setVariable().
|
private |
Open mode
Definition at line 118 of file CWriteConfig.h.
Referenced by commit(), and CWriteConfig().