AURobotServers  4
Public Member Functions | Public Attributes | Static Public Attributes | Private Attributes | List of all members
UFileItem Class Reference

#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
 

Constructor & Destructor Documentation

UFileItem::UFileItem ( )

Constructor

References fh, and filename.

Referenced by UResFile::getItem().

UFileItem::~UFileItem ( )

Destructor

References fh.

Member Function Documentation

bool UFileItem::add ( const char *  text)

Add some text to the file

References fh.

Referenced by UResFile::add(), and UResFile::UResFile().

bool UFileItem::closeFile ( )

Close the file (if open).

Returns
true if the file was closed or false if file was not 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.

Parameters
fileDiris the directory where to put the file (may be "." or "./" for current dir)
newNameif not NULL, then the file name is changed to the newName before opening.
Returns
true if file was created.

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().

Member Data Documentation

int UFileItem::client

Client thet owns this file handle.

Referenced by UResFile::getItem(), and UResFile::UResFile().

FILE* UFileItem::fh
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().

const int UFileItem::MFNL = MAX_FILENAME_LENGTH
static

MAX filename length

Referenced by setName().


The documentation for this class was generated from the following files: