MCPcopy Create free account
hub / github.com/CyanogenMod/android_frameworks_base / openReadOnly

Function openReadOnly

tools/aapt/Command.cpp:41–61  ·  view source on GitHub ↗

* Open the file read only. The call fails if the file doesn't exist. * * Returns NULL on failure. */

Source from the content-addressed store, hash-verified

39 * Returns NULL on failure.
40 */
41ZipFile* openReadOnly(const char* fileName)
42{
43 ZipFile* zip;
44 status_t result;
45
46 zip = new ZipFile;
47 result = zip->open(fileName, ZipFile::kOpenReadOnly);
48 if (result != NO_ERROR) {
49 if (result == NAME_NOT_FOUND)
50 fprintf(stderr, "ERROR: '%s' not found\n", fileName);
51 else if (result == PERMISSION_DENIED)
52 fprintf(stderr, "ERROR: '%s' access denied\n", fileName);
53 else
54 fprintf(stderr, "ERROR: failed opening '%s' as Zip file\n",
55 fileName);
56 delete zip;
57 return NULL;
58 }
59
60 return zip;
61}
62
63/*
64 * Open the file read-write. The file will be created if it doesn't

Callers 1

doListFunction · 0.85

Calls 1

openMethod · 0.45

Tested by

no test coverage detected