MCPcopy Create free account
hub / github.com/Tencent/MMKV / OpenFlag2NativeFlag

Function OpenFlag2NativeFlag

Core/MemoryFile.cpp:67–87  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

65# endif
66
67static int OpenFlag2NativeFlag(OpenFlag flag) {
68 int native = O_CLOEXEC;
69 if ((flag & OpenFlagRWMask) == OpenFlag::ReadWrite) {
70 native |= O_RDWR;
71 } else if (flag & OpenFlag::ReadOnly) {
72 native |= O_RDONLY;
73 } else if (flag & OpenFlag::WriteOnly) {
74 native |= O_WRONLY;
75 }
76
77 if (flag & OpenFlag::Create) {
78 native |= O_CREAT;
79 }
80 if (flag & OpenFlag::Excel) {
81 native |= O_EXCL;
82 }
83 if (flag & OpenFlag::Truncate) {
84 native |= O_TRUNC;
85 }
86 return native;
87}
88
89bool File::open() {
90# ifdef MMKV_ANDROID

Callers 1

openMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected