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

Method print

tools/aapt/XMLNode.cpp:1089–1137  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1087}
1088
1089void XMLNode::print(int indent)
1090{
1091 String8 prefix;
1092 int i;
1093 for (i=0; i<indent; i++) {
1094 prefix.append(" ");
1095 }
1096 if (getType() == TYPE_ELEMENT) {
1097 String8 elemNs(getNamespaceUri());
1098 if (elemNs.size() > 0) {
1099 elemNs.append(":");
1100 }
1101 printf("%s E: %s%s", prefix.string(),
1102 elemNs.string(), String8(getElementName()).string());
1103 int N = mAttributes.size();
1104 for (i=0; i<N; i++) {
1105 ssize_t idx = mAttributeOrder.valueAt(i);
1106 if (i == 0) {
1107 printf(" / ");
1108 } else {
1109 printf(", ");
1110 }
1111 const attribute_entry& attr = mAttributes.itemAt(idx);
1112 String8 attrNs(attr.ns);
1113 if (attrNs.size() > 0) {
1114 attrNs.append(":");
1115 }
1116 if (attr.nameResId) {
1117 printf("%s%s(0x%08x)", attrNs.string(),
1118 String8(attr.name).string(), attr.nameResId);
1119 } else {
1120 printf("%s%s", attrNs.string(), String8(attr.name).string());
1121 }
1122 printf("=%s", String8(attr.string).string());
1123 }
1124 printf("\n");
1125 } else if (getType() == TYPE_NAMESPACE) {
1126 printf("%s N: %s=%s\n", prefix.string(),
1127 getNamespacePrefix().size() > 0
1128 ? String8(getNamespacePrefix()).string() : "<DEF>",
1129 String8(getNamespaceUri()).string());
1130 } else {
1131 printf("%s C: \"%s\"\n", prefix.string(), String8(getCData()).string());
1132 }
1133 int N = mChildren.size();
1134 for (i=0; i<N; i++) {
1135 mChildren.itemAt(i)->print(indent+1);
1136 }
1137}
1138
1139static void splitName(const char* name, String16* outNs, String16* outName)
1140{

Callers 15

doListFunction · 0.45
doDumpFunction · 0.45
doPackageFunction · 0.45
compileXmlFileFunction · 0.45
mainFunction · 0.45
buildResourcesFunction · 0.45
parseXMLResourceFunction · 0.45
debugNolnMethod · 0.45
onCreateMethod · 0.45
dumpStreamStatesMethod · 0.45
dumpMethod · 0.45
dumpRingerModeMethod · 0.45

Calls 5

getTypeFunction · 0.85
stringMethod · 0.80
appendMethod · 0.65
sizeMethod · 0.65
valueAtMethod · 0.45

Tested by 6

onCreateMethod · 0.36
readOneLineMethod · 0.36
handleClientMethod · 0.36
psPrintMethod · 0.36
evaluateHeaderMethod · 0.36
writeFileMethod · 0.36