BFile Class Reference

File operations class. More...

#include <BFile.h>

List of all members.

Public Member Functions

 BFile ()
 BFile (BString name, BString mode)
 Create opened specifed file.
 BFile (const BFile &file)
 Create opened specified file.
 ~BFile ()
BError open (BString name, BString mode)
 Open file.
BError open (FILE *file)
 Assign object to opened file handle.
BError close ()
 Close file.
BError error ()
 Returns current error state.
FILE * getFd ()
 File descriptor.
int length ()
 File size in bytes.
int setVBuf (char *buf, int mode, size_t size)
 Set stream buffering options.
int read (void *buf, int nbytes)
 Read from file.
int readString (BString &str)
 Read string. (ref fgets).
int write (const void *buf, int nbytes)
 Write to file.
int writeString (const BString &str)
 Write string to file.
int seek (int pos, int whence)
 Set seek position.
int printf (const char *fmt,...)
 Formated print into the file.
BFileoperator= (const BFile &file)

Private Attributes

FILE * ofile
BString ofileName
BString omode
BError oerror


Detailed Description

File operations class.

Constructor & Destructor Documentation

BFile::BFile (  ) 

BFile::BFile ( BString  name,
BString  mode 
)

Create opened specifed file.

BFile::BFile ( const BFile file  ) 

Create opened specified file.

BFile::~BFile (  ) 


Member Function Documentation

BError BFile::open ( BString  name,
BString  mode 
)

Open file.

BError BFile::open ( FILE *  file  ) 

Assign object to opened file handle.

BError BFile::close (  ) 

Close file.

BError BFile::error (  ) 

Returns current error state.

FILE * BFile::getFd (  ) 

File descriptor.

int BFile::length (  ) 

File size in bytes.

int BFile::setVBuf ( char *  buf,
int  mode,
size_t  size 
)

Set stream buffering options.

int BFile::read ( void *  buf,
int  nbytes 
)

Read from file.

int BFile::readString ( BString str  ) 

Read string. (ref fgets).

int BFile::write ( const void *  buf,
int  nbytes 
)

Write to file.

int BFile::writeString ( const BString str  ) 

Write string to file.

int BFile::seek ( int  pos,
int  whence 
)

Set seek position.

int BFile::printf ( const char *  fmt,
  ... 
)

Formated print into the file.

BFile & BFile::operator= ( const BFile file  ) 


Member Data Documentation

FILE* BFile::ofile [private]

BString BFile::omode [private]

BError BFile::oerror [private]


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

Generated on Thu Dec 18 13:21:09 2008 for LibTmsApi by  doxygen 1.5.6