#include <BFile.h>
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. | |
BFile & | operator= (const BFile &file) |
Private Attributes | |
FILE * | ofile |
BString | ofileName |
BString | omode |
BError | oerror |
BFile::BFile | ( | ) |
BFile::BFile | ( | const BFile & | file | ) |
Create opened specified file.
BFile::~BFile | ( | ) |
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.
FILE* BFile::ofile [private] |
BString BFile::ofileName [private] |
BString BFile::omode [private] |
BError BFile::oerror [private] |