#include <File.h>
Public Member Functions | |
File (const char *name, const char *mode) | |
~File () | |
void | read (void *p, unsigned size) |
void | write (const void *p, unsigned size) |
void | printf (const char *format,...) |
bool | exists () const |
bool | eof () const |
File (const char *name, const char *mode) | |
~File () | |
void | read (void *p, unsigned size) |
void | write (const void *p, unsigned size) |
void | printf (const char *format,...) |
bool | exists () const |
bool | eof () const |
File (const char *name, const char *mode) | |
~File () | |
void | read (void *p, unsigned size) |
void | write (const void *p, unsigned size) |
void | printf (const char *format,...) |
bool | exists () const |
bool | eof () |
Static Public Member Functions | |
static char * | getGTDir () |
static char * | getGTDir () |
static char * | getGTDir () |
Private Attributes | |
OFS::FILE * | stream |
char | buf [65536] |
unsigned int | bufSize |
unsigned int | index |
bool | isWrite |
FILE * | stream |
FILE * | stream |
Definition at line 20 of file File.h.
File::File | ( | const char * | name, | |
const char * | mode | |||
) |
Constructor.
name | File name or path. If it is a relative path, it is assumed to be relative to the path for configuration files. Otherwise, the path is used directly. | |
mode | File open mode as used by fopen defined in stdio.h. |
Definition at line 14 of file File.cpp.
References ASSERT, buf, bufSize, getGTDir(), index, isWrite, and stream.
File::~File | ( | ) |
File::File | ( | const char * | name, | |
const char * | mode | |||
) | [inline] |
Constructor.
name | File name or path. If it is a relative path, it is assumed to be relative to the path for configuration files. Otherwise, the path is used directly. | |
mode | File open mode as used by fopen defined in stdio.h. |
Definition at line 30 of file File.h.
References ASSERT, buf, getGTDir(), and stream.
File::File | ( | const char * | name, | |
const char * | mode | |||
) |
File::~File | ( | ) |
Destructor.
bool File::eof | ( | ) |
bool File::eof | ( | ) | const [inline] |
bool File::eof | ( | ) | const |
bool File::exists | ( | ) | const [inline] |
bool File::exists | ( | ) | const [inline] |
bool File::exists | ( | ) | const [inline] |
The function returns whether the file represented by an object of this class actually exists.
Definition at line 72 of file File.h.
References stream.
Referenced by OutFile::exists(), and InFile::exists().
static char* File::getGTDir | ( | ) | [static] |
The function returns the current GT directory, e.g. /MS/OPENR/APP or <...>/GT2003 or /usr/local/GT2003
static char* File::getGTDir | ( | ) | [inline, static] |
char * File::getGTDir | ( | ) | [static] |
The function returns the current GT directory, e.g. /MS/OPENR/APP or <...>/GT2003 or /usr/local/GT2003
Definition at line 92 of file File.cpp.
Referenced by CTacticDesignerDlgBar::AddFromFile(), RoboCupCtrl::connect(), CWLANDeployDialog::copyStick(), CWLANDeployDialog::copyWLAN(), CRobotControlSimulatedRobots::create(), CTimeDiagramDlgBar::exportToFileAsCSV(), File(), generateHeadTailXml(), generateKickSelectionXml(), generateLEDSoundXml(), generateMatlabIDs(), generateMotionNet(), generateSpecialActionXml(), CWLANDeployDialog::getAiboName(), CLogPlayerToolBar::handleCommand(), CSettingsDlgBar::loadSettings(), main(), RobotConsole::msg(), CKickEditorDlgBar::OnContextMenu(), CWLANConfigurationDialog::OnCopy(), CColorTable64DlgBar::OnCt64Open(), CColorTable64DlgBar::OnCt64Save(), CHSIColorTableToolDlgBar::OnHsicolortabletoolLoadcolortableButton(), CHSIColorTableToolDlgBar::OnHsicolortabletoolSavecolortableButton(), CKickEditorDlgBar::OnOpen(), CWLANDeployDialog::OnRefreshAll(), CKickEditorDlgBar::OnSave(), CGT2004WalkingEngineParamSetDlgBar::OnSave(), CTacticDesignerDlgBar::OnSaveButton(), CSettingsDlgBar::OnSettingsDelete(), CSettingsDlgBar::OnSettingsRename(), CWLANDeployDialog::OnSnapshot(), CTSLColorTableToolDlgBar::OnTSLColorTableToolLoad(), CTSLColorTableToolDlgBar::OnTSLColorTableToolSave(), CTSLColorTableToolDlgBar::OnTSLColorTableToolSaveYUV(), CInvKinParametersDlgBar::OnWalkParamLoad(), CInvKinParametersDlgBar::OnWalkParamSave(), CInvKinParametersDlgBar::OnWriteLogFile(), CXABSL2ProfilerDlgBar::OnXabsl2profilerExportxmlButton(), CXABSL2ProfilerDlgBar::OnXabsl2profilerLoadlogButton(), parseExternMof(), parseMofs(), CWLANDeployDialog::prepareImage(), CInvKinParametersDlgBar::readContextMenu(), CPing::readOutARP(), CWLANDeployDialog::refreshBinaryCombo(), CWLANDeployDialog::refreshColortableCombo(), CKickEditorDlgBar::reloadCaseBase(), CValueHistoryDlgBar::saveAllCSV(), CJointViewerDlgBar::saveAllCSV(), CJointViewerDlgBar::saveAsCSV(), CJointViewerDlgBar::saveFTSpectrum(), RouterCtrl::start(), RouterCtrl::stop(), usage(), and CPing::WIN32GetMAC().
void File::printf | ( | const char * | format, | |
... | ||||
) |
The function implements printf for the stream represented by instances of this class.
format | Format string as used by printf defined in stdio.h. | |
... | See printf in stdio.h. |
void File::printf | ( | const char * | format, | |
... | ||||
) | [inline] |
void File::printf | ( | const char * | format, | |
... | ||||
) |
void File::read | ( | void * | p, | |
unsigned | size | |||
) |
The function read a number of bytes from the file to a certain memory location.
p | The start of the memory space the data is written to. | |
size | The number of bytes read from the file. |
void File::read | ( | void * | p, | |
unsigned | size | |||
) | [inline] |
void File::read | ( | void * | p, | |
unsigned | size | |||
) |
The function read a number of bytes from the file to a certain memory location.
p | The start of the memory space the data is written to. | |
size | The number of bytes read from the file. |
Definition at line 42 of file File.cpp.
References ASSERT, buf, bufSize, index, isWrite, and stream.
Referenced by InFile::readFromStream().
void File::write | ( | const void * | p, | |
unsigned | size | |||
) |
The function writes a number of bytes from a certain memory location into the file.
p | The start of the memory space the data is read from. | |
size | The number of bytes written into the file. |
void File::write | ( | const void * | p, | |
unsigned | size | |||
) | [inline] |
void File::write | ( | const void * | p, | |
unsigned | size | |||
) |
The function writes a number of bytes from a certain memory location into the file.
p | The start of the memory space the data is read from. | |
size | The number of bytes written into the file. |
Definition at line 60 of file File.cpp.
References buf, index, stream, and VERIFY.
Referenced by OutFile::writeToStream().
char File::buf[65536] [private] |
unsigned int File::bufSize [private] |
unsigned int File::index [private] |
bool File::isWrite [private] |
FILE* File::stream [private] |
FILE* File::stream [private] |
OFS::FILE* File::stream [private] |