AURobotServers
4
|
#include <uresfile.h>
Public Member Functions | |
bool | add (const char *text) |
bool | closeFile () |
bool | isOpen () |
bool | openFile (const char *fileDir, const char *newName) |
void | setName (const char *newName) |
UFileItem () | |
~UFileItem () | |
Public Attributes | |
int | client |
char | filename [MFNL] |
Static Public Attributes | |
static const int | MFNL = MAX_FILENAME_LENGTH |
Private Attributes | |
FILE * | fh |
UFileItem::UFileItem | ( | ) |
UFileItem::~UFileItem | ( | ) |
Destructor
References fh.
bool UFileItem::add | ( | const char * | text | ) |
bool UFileItem::closeFile | ( | ) |
Close the file (if open).
References fh.
Referenced by UResFile::closeFile(), UResFile::newFile(), openFile(), and UResFile::UResFile().
bool UFileItem::isOpen | ( | ) |
is the file open
References fh.
Referenced by UResFile::newFile(), openFile(), and UResFile::setOpenFilesCnt().
bool UFileItem::openFile | ( | const char * | fileDir, |
const char * | newName | ||
) |
Open the file for write (by calls to add("text")) If file is open already, then it is closed.
fileDir | is the directory where to put the file (may be "." or "./" for current dir) |
newName | if not NULL, then the file name is changed to the newName before opening. |
References closeFile(), fh, filename, isOpen(), MAX_FILENAME_LENGTH, and setName().
Referenced by UResFile::newFile().
void UFileItem::setName | ( | const char * | newName | ) |
Set filename, NB must be a qualified filename and subdirs are not allowed The global variable file.fileDir controls the directory, where files are placed.
References filename, and MFNL.
Referenced by openFile().
int UFileItem::client |
Client thet owns this file handle.
Referenced by UResFile::getItem(), and UResFile::UResFile().
|
private |
File handle - used when file is open
Referenced by add(), closeFile(), isOpen(), openFile(), UFileItem(), and ~UFileItem().
char UFileItem::filename[MFNL] |
File name in current directory
Referenced by UResFile::getFilename(), UResFile::newFile(), openFile(), setName(), and UFileItem().
|
static |
MAX filename length
Referenced by setName().