|
enum | FileOpenMode {
kRead = 0
, kWrite = 1
, kTruncate = 1 << 2
, kWriteOnly = 1 << 3
,
kWriteTruncate = kWrite | kTruncate
, kWriteOnlyTruncate = kWriteOnly | kTruncate
} |
|
enum | DartFileOpenMode {
kDartRead = 0
, kDartWrite = 1
, kDartAppend = 2
, kDartWriteOnly = 3
,
kDartWriteOnlyAppend = 4
} |
|
enum | Type {
kIsFile = 0
, kIsDirectory = 1
, kIsLink = 2
, kIsSock = 3
,
kIsPipe = 4
, kDoesNotExist = 5
} |
|
enum | Identical { kIdentical = 0
, kDifferent = 1
, kError = 2
} |
|
enum | StdioHandleType {
kTerminal = 0
, kPipe = 1
, kFile = 2
, kSocket = 3
,
kOther = 4
, kTypeError = 5
} |
|
enum | FileStat {
kType = 0
, kCreatedTime = 1
, kModifiedTime = 2
, kAccessedTime = 3
,
kMode = 4
, kSize = 5
, kStatSize = 6
} |
|
enum | LockType {
kLockMin = 0
, kLockUnlock = 0
, kLockShared = 1
, kLockExclusive = 2
,
kLockBlockingShared = 3
, kLockBlockingExclusive = 4
, kLockMax = 4
} |
|
enum | MapType { kReadOnly = 0
, kReadExecute = 1
, kReadWrite = 2
} |
|
|
intptr_t | GetFD () |
|
MappedMemory * | Map (MapType type, int64_t position, int64_t length, void *start=nullptr) |
|
int64_t | Read (void *buffer, int64_t num_bytes) |
|
int64_t | Write (const void *buffer, int64_t num_bytes) |
|
bool | ReadFully (void *buffer, int64_t num_bytes) |
|
bool | WriteFully (const void *buffer, int64_t num_bytes) |
|
bool | WriteByte (uint8_t byte) |
|
bool | Print (const char *format,...) PRINTF_ATTRIBUTE(2 |
|
bool | va_start (args, format) |
|
| va_end (args) |
|
bool | VPrint (const char *format, va_list args) |
|
int64_t | Length () |
|
int64_t | Position () |
|
bool | SetPosition (int64_t position) |
|
bool | Truncate (int64_t length) |
|
bool | Flush () |
|
bool | Lock (LockType lock, int64_t start, int64_t end) |
|
bool | IsClosed () |
|
void | Close () |
|
Dart_FinalizableHandle | FinalizableHandle () const |
|
void | SetFinalizableHandle (Dart_FinalizableHandle handle) |
|
void | DeleteFinalizableHandle (Dart_Isolate isolate, Dart_Handle strong_ref) |
|
| ReferenceCounted () |
|
virtual | ~ReferenceCounted () |
|
void | Retain () |
|
void | Release () |
|
|
static File * | Open (Namespace *namespc, const char *path, FileOpenMode mode) |
|
static File * | OpenUri (Namespace *namespc, const char *uri, FileOpenMode mode) |
|
static CStringUniquePtr | UriToPath (const char *uri) |
|
static File * | OpenStdio (int fd) |
|
static File * | OpenFD (int fd) |
|
static bool | Exists (Namespace *namespc, const char *path) |
|
static bool | ExistsUri (Namespace *namespc, const char *uri) |
|
static bool | Create (Namespace *namespc, const char *path, bool exclusive) |
|
static bool | CreateLink (Namespace *namespc, const char *path, const char *target) |
|
static bool | CreatePipe (Namespace *namespc, File **readPipe, File **writePipe) |
|
static bool | Delete (Namespace *namespc, const char *path) |
|
static bool | DeleteLink (Namespace *namespc, const char *path) |
|
static bool | Rename (Namespace *namespc, const char *old_path, const char *new_path) |
|
static bool | RenameLink (Namespace *namespc, const char *old_path, const char *new_path) |
|
static bool | Copy (Namespace *namespc, const char *old_path, const char *new_path) |
|
static int64_t | LengthFromPath (Namespace *namespc, const char *path) |
|
static void | Stat (Namespace *namespc, const char *path, int64_t *data) |
|
static time_t | LastModified (Namespace *namespc, const char *path) |
|
static bool | SetLastModified (Namespace *namespc, const char *path, int64_t millis) |
|
static time_t | LastAccessed (Namespace *namespc, const char *path) |
|
static bool | SetLastAccessed (Namespace *namespc, const char *path, int64_t millis) |
|
static bool | IsAbsolutePath (const char *path) |
|
static const char * | PathSeparator () |
|
static const char * | StringEscapedPathSeparator () |
|
static Type | GetType (Namespace *namespc, const char *path, bool follow_links) |
|
static Identical | AreIdentical (Namespace *namespc_1, const char *file_1, Namespace *namespc_2, const char *file_2) |
|
static StdioHandleType | GetStdioHandleType (int fd) |
|
static const char * | LinkTarget (Namespace *namespc, const char *pathname, char *dest=nullptr, int dest_size=0) |
|
static const char * | GetCanonicalPath (Namespace *namespc, const char *path, char *dest=nullptr, int dest_size=0) |
|
static const char * | ReadLink (const char *pathname) |
|
static intptr_t | ReadLinkInto (const char *pathname, char *result, size_t result_size) |
|
static intptr_t | CleanUnixPath (const char *in, char *out, intptr_t outlen) |
|
static FileOpenMode | DartModeToFileMode (DartFileOpenMode mode) |
|
static CObject * | ExistsRequest (const CObjectArray &request) |
|
static CObject * | CreateRequest (const CObjectArray &request) |
|
static CObject * | CreatePipeRequest (const CObjectArray &request) |
|
static CObject * | DeleteRequest (const CObjectArray &request) |
|
static CObject * | RenameRequest (const CObjectArray &request) |
|
static CObject * | CopyRequest (const CObjectArray &request) |
|
static CObject * | OpenRequest (const CObjectArray &request) |
|
static CObject * | ResolveSymbolicLinksRequest (const CObjectArray &request) |
|
static CObject * | CloseRequest (const CObjectArray &request) |
|
static CObject * | PositionRequest (const CObjectArray &request) |
|
static CObject * | SetPositionRequest (const CObjectArray &request) |
|
static CObject * | TruncateRequest (const CObjectArray &request) |
|
static CObject * | LengthRequest (const CObjectArray &request) |
|
static CObject * | LengthFromPathRequest (const CObjectArray &request) |
|
static CObject * | LastModifiedRequest (const CObjectArray &request) |
|
static CObject * | SetLastModifiedRequest (const CObjectArray &request) |
|
static CObject * | LastAccessedRequest (const CObjectArray &request) |
|
static CObject * | SetLastAccessedRequest (const CObjectArray &request) |
|
static CObject * | FlushRequest (const CObjectArray &request) |
|
static CObject * | ReadByteRequest (const CObjectArray &request) |
|
static CObject * | WriteByteRequest (const CObjectArray &request) |
|
static CObject * | ReadRequest (const CObjectArray &request) |
|
static CObject * | ReadIntoRequest (const CObjectArray &request) |
|
static CObject * | WriteFromRequest (const CObjectArray &request) |
|
static CObject * | CreateLinkRequest (const CObjectArray &request) |
|
static CObject * | DeleteLinkRequest (const CObjectArray &request) |
|
static CObject * | RenameLinkRequest (const CObjectArray &request) |
|
static CObject * | LinkTargetRequest (const CObjectArray &request) |
|
static CObject * | TypeRequest (const CObjectArray &request) |
|
static CObject * | IdenticalRequest (const CObjectArray &request) |
|
static CObject * | StatRequest (const CObjectArray &request) |
|
static CObject * | LockRequest (const CObjectArray &request) |
|
Definition at line 53 of file file.h.
MappedMemory * dart::bin::File::Map |
( |
MapType |
type, |
|
|
int64_t |
position, |
|
|
int64_t |
length, |
|
|
void * |
start = nullptr |
|
) |
| |
Maps or copies the file into memory.
'position' and 'length' should be page-aligned.
If 'start' is zero, allocates virtual memory for the mapping. When the returned 'MappedMemory' is destroyed, the mapping is removed.
If 'start' is non-zero, it must point within a suitably sized existing mapping. The returned 'MappedMemory' will not remove the mapping when it is destroyed; rather, the mapping will be removed when the enclosing mapping is removed. This mode is not supported on Fuchsia.
If 'type' is 'kReadWrite', writes to the mapping are not copied back to the file.
'position' + 'length' may be larger than the file size. In this case, the extra memory is zero-filled.