BFile Class Reference

File operations class. More...

#include <BFile.h>

List of all members.

Public Member Functions

 BFile ()
 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 open (int fd, BString mode)
 Assign object to opened file descriptor.
BError close ()
 Close file.
int isOpen ()
 Returns 1 if the file is open.
int isEnd ()
 Returns 1 if at the end of the file, 0 otherwise.
FILE * getFd ()
 File descriptor.
BUInt64 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).
char * fgets (char *buf, size_t size)
int write (const void *buf, int nbytes)
 Write to file.
int writeString (const BString &str)
 Write string to file.
int seek (BUInt64 pos)
 Set seek position.
BUInt64 position ()
 The files position.
int printf (const char *fmt,...)
 Formated print into the file.
BError truncate ()
 Truncate the file.
BError flush ()
 Flush the file.
BString fileName ()
 Return file name.
BFileoperator= (const BFile &file)

Private Attributes

FILE * ofile
BString ofileName
BString omode


Detailed Description

File operations class.


Constructor & Destructor Documentation

BFile::BFile (  ) 

BFile::BFile ( const BFile file  ) 

Create opened specified file.

BFile::~BFile (  ) 


Member Function Documentation

BError BFile::close (  ) 

Close file.

char * BFile::fgets ( char *  buf,
size_t  size 
)

BString BFile::fileName (  ) 

Return file name.

BError BFile::flush (  ) 

Flush the file.

FILE * BFile::getFd (  ) 

File descriptor.

int BFile::isEnd (  ) 

Returns 1 if at the end of the file, 0 otherwise.

int BFile::isOpen (  ) 

Returns 1 if the file is open.

BUInt64 BFile::length (  ) 

File size in bytes.

BError BFile::open ( int  fd,
BString  mode 
)

Assign object to opened file descriptor.

BError BFile::open ( FILE *  file  ) 

Assign object to opened file handle.

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

Open file.

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

BUInt64 BFile::position (  ) 

The files position.

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

Formated print into the file.

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

Read from file.

int BFile::readString ( BString str  ) 

Read string. (ref fgets).

int BFile::seek ( BUInt64  pos  ) 

Set seek position.

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

Set stream buffering options.

BError BFile::truncate (  ) 

Truncate the file.

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

Write to file.

int BFile::writeString ( const BString str  ) 

Write string to file.


Member Data Documentation

FILE* BFile::ofile [private]

BString BFile::ofileName [private]

BString BFile::omode [private]


The documentation for this class was generated from the following files:
Generated on Mon Jun 21 11:49:08 2010 for LibBeamApi by  doxygen 1.4.7