33 int setVBuf(
char* buf,
int mode,
size_t size);
35 int read(
void* buf,
int nbytes);
37 char*
fgets(
char* buf,
size_t size);
39 int write(
const void* buf,
int nbytes);
45 int printf(
const char* fmt, ...);
BError bcopyFile(BString source, BString dest)
Copy a file.
Definition: BFile.cpp:259
BError bcopyDir(BString source, BString dest)
Copy complete directory.
Definition: BFile.cpp:287
uint64_t BUInt64
Definition: BTypes.h:26
Error return class. This class is used to return the error status from a function....
Definition: BError.h:31
File operations class.
Definition: BFile.h:17
int isEnd()
Returns 1 if at the end of the file, 0 otherwise.
Definition: BFile.cpp:175
BError close()
Close file.
Definition: BFile.cpp:159
int write(const void *buf, int nbytes)
Write to file.
Definition: BFile.cpp:210
~BFile()
Definition: BFile.cpp:96
int writeString(const BString &str)
Write string to file.
Definition: BFile.cpp:214
BError openTemp(BString name, BString mode)
Open a tempory file with the given name prefix.
Definition: BFile.cpp:128
BUInt64 length()
File size in bytes.
Definition: BFile.cpp:183
int isOpen()
Returns 1 if the file is open.
Definition: BFile.cpp:171
FILE * getFd()
File descriptor.
Definition: BFile.cpp:179
int read(void *buf, int nbytes)
Read from file.
Definition: BFile.cpp:190
BUInt64 position()
The files position.
Definition: BFile.cpp:222
BString fileName()
Return file name.
Definition: BFile.cpp:254
BError truncate()
Truncate the file.
Definition: BFile.cpp:237
int printf(const char *fmt,...)
Formated print into the file.
Definition: BFile.cpp:230
char * fgets(char *buf, size_t size)
Definition: BFile.cpp:206
BFile & operator=(const BFile &file)
Definition: BFile.cpp:91
BError open(BString name, BString mode)
Open file.
Definition: BFile.cpp:100
int setVBuf(char *buf, int mode, size_t size)
Set stream buffering options.
Definition: BFile.cpp:226
BFile()
Definition: BFile.cpp:83
BError flush()
Flush the file.
Definition: BFile.cpp:245
int readString(BString &str)
Read string. (ref fgets)
Definition: BFile.cpp:194
int seek(BUInt64 pos)
Set seek position.
Definition: BFile.cpp:218
This class stores and manipulates ASCII strings.
Definition: BString.h:20