Lines Matching refs:FileHandle
1 //===- FileHandle.cpp -----------------------------------------------------===//
10 #include "mcld/Support/FileHandle.h"
27 // FileHandle
29 FileHandle::FileHandle()
37 FileHandle::~FileHandle() {
42 inline static int oflag(FileHandle::OpenMode pMode) {
44 if (FileHandle::Unknown == pMode)
47 if (FileHandle::ReadWrite == (pMode & FileHandle::ReadWrite))
49 else if (FileHandle::ReadOnly == (pMode & FileHandle::ReadOnly))
51 else if (FileHandle::WriteOnly == (pMode & FileHandle::WriteOnly))
54 if (FileHandle::Append == (pMode & FileHandle::Append))
57 if (FileHandle::Create == (pMode & FileHandle::Create))
60 if (FileHandle::Truncate == (pMode & FileHandle::Truncate))
76 bool FileHandle::open(const sys::fs::Path& pPath,
77 FileHandle::OpenMode pMode,
78 FileHandle::Permission pPerm) {
106 bool FileHandle::delegate(int pFD, FileHandle::OpenModeEnum pMode) {
124 bool FileHandle::close() {
144 bool FileHandle::truncate(size_t pSize) {
159 bool FileHandle::read(void* pMemBuffer, size_t pStartOffset, size_t pLength) {
179 bool FileHandle::write(const void* pMemBuffer,
201 void FileHandle::setState(FileHandle::IOState pState) {
205 void FileHandle::cleanState(FileHandle::IOState pState) {
209 bool FileHandle::isOpened() const {
217 bool FileHandle::isReadable() const {
222 bool FileHandle::isWritable() const {
227 bool FileHandle::isReadWrite() const {
228 return (FileHandle::ReadWrite == (m_OpenMode & FileHandle::ReadWrite));
231 bool FileHandle::isGood() const {
235 bool FileHandle::isBad() const {
239 bool FileHandle::isFailed() const {
243 bool FileHandle::isOwned() const {