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

Method next

tools/aapt/Resource.cpp:97–150  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

95 };
96
97 ssize_t next()
98 {
99 while (true) {
100 sp<AaptGroup> group;
101 sp<AaptFile> file;
102
103 // Try to get next file in this current group.
104 if (mGroup != NULL && mGroupPos < mGroup->getFiles().size()) {
105 group = mGroup;
106 file = group->getFiles().valueAt(mGroupPos++);
107
108 // Try to get the next group/file in this directory
109 } else if (mSetPos < mSet->size()) {
110 mGroup = group = mSet->valueAt(mSetPos++);
111 if (group->getFiles().size() < 1) {
112 continue;
113 }
114 file = group->getFiles().valueAt(0);
115 mGroupPos = 1;
116
117 // All done!
118 } else {
119 return EOD;
120 }
121
122 mFile = file;
123
124 String8 leaf(group->getLeaf());
125 mLeafName = String8(leaf);
126 mParams = file->getGroupEntry().toParams();
127 NOISY(printf("Dir %s: mcc=%d mnc=%d lang=%c%c cnt=%c%c orient=%d ui=%d density=%d touch=%d key=%d inp=%d nav=%d\n",
128 group->getPath().string(), mParams.mcc, mParams.mnc,
129 mParams.language[0] ? mParams.language[0] : '-',
130 mParams.language[1] ? mParams.language[1] : '-',
131 mParams.country[0] ? mParams.country[0] : '-',
132 mParams.country[1] ? mParams.country[1] : '-',
133 mParams.orientation, mParams.uiMode,
134 mParams.density, mParams.touchscreen, mParams.keyboard,
135 mParams.inputFlags, mParams.navigation));
136 mPath = "res";
137 mPath.appendPath(file->getGroupEntry().toDirName(mResType));
138 mPath.appendPath(leaf);
139 mBaseName = parseResourceName(leaf);
140 if (mBaseName == "") {
141 fprintf(stderr, "Error: malformed resource filename %s\n",
142 file->getPrintableSource().string());
143 return UNKNOWN_ERROR;
144 }
145
146 NOISY(printf("file name=%s\n", mBaseName.string()));
147
148 return NO_ERROR;
149 }
150 }
151
152private:
153 String8 mResType;

Callers 15

printCompatibleScreensFunction · 0.45
getNfcAidCategoriesFunction · 0.45
doDumpFunction · 0.45
compileAttributeFunction · 0.45
compileResourceFileFunction · 0.45
parsePackageFunction · 0.45
makeFileResourcesFunction · 0.45
preProcessImagesFunction · 0.45
postProcessImagesFunction · 0.45
checkForIdsFunction · 0.45
buildResourcesFunction · 0.45

Calls 8

parseResourceNameFunction · 0.85
stringMethod · 0.80
appendPathMethod · 0.80
toDirNameMethod · 0.80
getPrintableSourceMethod · 0.80
sizeMethod · 0.65
getPathMethod · 0.65
valueAtMethod · 0.45

Tested by 8

runOneActivityMethod · 0.36
reportListContentsMethod · 0.36
updateTexturesMethod · 0.36
validateArrayMapMethod · 0.36
runMethod · 0.36
getFirstErrorMethod · 0.36
parseMenuMethod · 0.36
onInitMethod · 0.36