Inheritance diagram for os::File:
Public Types | |
enum | { DEFAULT_BUFFER_SIZE = 32768 } |
Public Member Functions | |
File () | |
Default constructor. | |
File (const String &cPath, int nOpenMode=O_RDONLY) | |
Construct a file from a regular path. | |
File (const Directory &cDir, const String &cName, int nOpenMode=O_RDONLY) | |
Open a file addressed as a name inside a specified directory. | |
File (const FileReference &cRef, int nOpenMode=O_RDONLY) | |
Open a file referred to by a os::FileReference. | |
File (const FSNode &cNode) | |
Construct a file from a FSNode. | |
File (int nFD) | |
Construct a file object from a open filedescriptor. | |
File (const File &cFile) | |
Copy constructor. | |
virtual | ~File () |
virtual status_t | FDChanged (int nNewFD, const struct stat &sStat) |
virtual off_t | GetSize (bool bUpdateCache=true) const |
virtual ssize_t | Read (void *pBuffer, ssize_t nSize) |
virtual ssize_t | Write (const void *pBuffer, ssize_t nSize) |
virtual ssize_t | ReadPos (off_t nPos, void *pBuffer, ssize_t nSize) |
virtual ssize_t | WritePos (off_t nPos, const void *pBuffer, ssize_t nSize) |
virtual off_t | Seek (off_t nPos, int nMode) |
Move the file pointer. | |
status_t | SetBufferSize (int nSize) |
Set the size of the files caching buffer. | |
int | GetBufferSize () const |
Obtain the files buffer size. | |
status_t | Flush () |
Write unwritten data to the underlying file. | |
Classes | |
class | Private |
File::File | ( | ) |
File::File | ( | const String & | cPath, | |
int | nOpenMode = O_RDONLY | |||
) |
cPath
. The node must be a regular file or a symlink pointing at a regular file. Anything else will cause and errno_exception(EINVAL) exception to be thrown.cPath | The file to open. The path can eigther be absolute (starting with "/") or relative to the current working directory. | |
nOpenMode | Flags controling how the file should be opened. The value should be one of the O_RDONLY, O_WRONLY, or O_RDWR. In addition the following flags can be bitwise or'd in to further control the operation: |
cPath
points to a PTY.
cDir | The directory to use as a base for cPath | |
cPath | Path relative to cPath . | |
nOpenMode | Flags controlling how to open the file. See File( const std::string& cPath, int nOpenMode ) for a full description. |
File::File | ( | const FileReference & | cRef, | |
int | nOpenMode = O_RDONLY | |||
) |
cRef | Reference to the file to open. | |
nOpenMode | Flags controlling how to open the file. See File( const std::string& cPath, int nOpenMode ) for a full description. |
File::File | ( | const FSNode & | cNode | ) |
cNode | The FSNode to downcast. |
File::File | ( | int | nFD | ) |
\return |
File::File | ( | const File & | cFile | ) |
cFile
. The copy and original will have their own file pointers and they will have their own attribute directory iterators (see note). cFile | The file object to copy. |
File::~File | ( | ) | [virtual] |
status_t File::FDChanged | ( | int | nNewFD, | |
const struct stat & | sStat | |||
) | [virtual] |
Reimplemented from os::FSNode.
off_t File::GetSize | ( | bool | bUpdateCache = true |
) | const [virtual] |
Reimplemented from os::FSNode.
ssize_t File::Read | ( | void * | pBuffer, | |
ssize_t | nSize | |||
) | [virtual] |
Implements os::StreamableIO.
ssize_t File::Write | ( | const void * | pBuffer, | |
ssize_t | nSize | |||
) | [virtual] |
Implements os::StreamableIO.
ssize_t File::ReadPos | ( | off_t | nPos, | |
void * | pBuffer, | |||
ssize_t | nSize | |||
) | [virtual] |
Implements os::SeekableIO.
ssize_t File::WritePos | ( | off_t | nPos, | |
const void * | pBuffer, | |||
ssize_t | nSize | |||
) | [virtual] |
Implements os::SeekableIO.
off_t File::Seek | ( | off_t | nPos, | |
int | nMode | |||
) | [virtual] |
status_t File::SetBufferSize | ( | int | nBufferSize | ) |
nBufferSize | The buffer size in bytes. If the size is set to 0 the file will be unbuffered and each call to Read()/Write() and ReadPos()/WritePos() will translate directly to kernel calls. |
int File::GetBufferSize | ( | ) | const |
status_t File::Flush | ( | void | ) |