Home
last modified time | relevance | path

Searched refs:StringPiece16 (Results 1 – 25 of 50) sorted by relevance

12

/frameworks/base/tools/aapt2/
DResourceUtils.h40 bool extractResourceName(const StringPiece16& str, StringPiece16* outPackage,
41 StringPiece16* outType, StringPiece16* outEntry);
48 bool parseResourceName(const StringPiece16& str, ResourceNameRef* outResource,
58 bool tryParseReference(const StringPiece16& str, ResourceNameRef* outReference,
64 bool isReference(const StringPiece16& str);
70 bool tryParseAttributeReference(const StringPiece16& str, ResourceNameRef* outReference);
75 bool isAttributeReference(const StringPiece16& str);
80 bool tryParseBool(const StringPiece16& str, bool* outValue);
91 Maybe<Reference> parseStyleParentReference(const StringPiece16& str, std::string* outError);
98 std::unique_ptr<Reference> tryParseReference(const StringPiece16& str, bool* outCreate = nullptr);
[all …]
DResourceUtils.cpp29 bool extractResourceName(const StringPiece16& str, StringPiece16* outPackage, in extractResourceName()
30 StringPiece16* outType, StringPiece16* outEntry) { in extractResourceName()
53 bool parseResourceName(const StringPiece16& str, ResourceNameRef* outRef, bool* outPrivate) { in parseResourceName()
65 StringPiece16 package; in parseResourceName()
66 StringPiece16 type; in parseResourceName()
67 StringPiece16 entry; in parseResourceName()
93 bool tryParseReference(const StringPiece16& str, ResourceNameRef* outRef, bool* outCreate, in tryParseReference()
95 StringPiece16 trimmedStr(util::trimWhitespace(str)); in tryParseReference()
139 bool isReference(const StringPiece16& str) { in isReference()
143 bool tryParseAttributeReference(const StringPiece16& str, ResourceNameRef* outRef) { in tryParseAttributeReference()
[all …]
DResourceTable.h105 ResourceEntry(const StringPiece16& name) : name(name.toString()) { } in ResourceEntry()
146 ResourceEntry* findEntry(const StringPiece16& name);
147 ResourceEntry* findOrCreateEntry(const StringPiece16& name);
208 const StringPiece16& path,
214 const StringPiece16& path,
275 ResourceTablePackage* findPackage(const StringPiece16& name);
279 ResourceTablePackage* createPackage(const StringPiece16& name, Maybe<uint8_t> id = {});
282 ResourceTablePackage* findOrCreatePackage(const StringPiece16& name);
287 const StringPiece16& path,
DResource.h63 StringPiece16 toString(ResourceType type);
69 const ResourceType* parseResourceType(const StringPiece16& str);
81 ResourceName(const StringPiece16& p, ResourceType t, const StringPiece16& e);
94 StringPiece16 package;
96 StringPiece16 entry;
102 ResourceNameRef(const StringPiece16& p, ResourceType t, const StringPiece16& e);
255 inline ResourceName::ResourceName(const StringPiece16& p, ResourceType t, const StringPiece16& e) : in ResourceName()
302 inline ResourceNameRef::ResourceNameRef(const StringPiece16& p, ResourceType t, in ResourceNameRef()
303 const StringPiece16& e) : in ResourceNameRef()
DResourceParser.cpp36 static bool shouldIgnoreElement(const StringPiece16& ns, const StringPiece16& name) { in shouldIgnoreElement()
40 static uint32_t parseFormatType(const StringPiece16& piece) { in parseFormatType()
54 static uint32_t parseFormatAttribute(const StringPiece16& str) { in parseFormatAttribute()
56 for (StringPiece16 part : util::tokenize(str, u'|')) { in parseFormatAttribute()
57 StringPiece16 trimmedPart = util::trimWhitespace(part); in parseFormatAttribute()
84 StringPiece16 trimmedComment = util::trimWhitespace(res->comment); in addResourcesToTable()
276 if (Maybe<StringPiece16> maybeProduct = xml::findNonEmptyAttribute(parser, u"product")) { in parseResources()
349 if (Maybe<StringPiece16> maybeType = xml::findNonEmptyAttribute(parser, u"type")) { in parseResource()
357 if (Maybe<StringPiece16> maybeFormat = xml::findNonEmptyAttribute(parser, u"format")) { in parseResource()
371 Maybe<StringPiece16> maybeName = xml::findNonEmptyAttribute(parser, u"name"); in parseResource()
[all …]
DResourceTable.cpp38 const StringPiece16& rhs) { in lessThanStructWithName()
42 ResourceTablePackage* ResourceTable::findPackage(const StringPiece16& name) { in findPackage()
61 ResourceTablePackage* ResourceTable::createPackage(const StringPiece16& name, Maybe<uint8_t> id) { in createPackage()
74 ResourceTablePackage* ResourceTable::findOrCreatePackage(const StringPiece16& name) { in findOrCreatePackage()
105 ResourceEntry* ResourceTableType::findEntry(const StringPiece16& name) { in findEntry()
115 ResourceEntry* ResourceTableType::findOrCreateEntry(const StringPiece16& name) { in findOrCreateEntry()
278 const StringPiece16& path, in addFileReference()
286 const StringPiece16& path, in addFileReferenceAllowMangled()
295 const StringPiece16& path, in addFileReferenceImpl()
345 << StringPiece16(badCharIter, 1) in addResourceImpl()
[all …]
/frameworks/base/tools/aapt2/util/
DStringPiece_test.cpp31 StringPiece16 a16(u"hello world", 5); in TEST()
32 StringPiece16 b16(u"hello moon", 5); in TEST()
41 EXPECT_TRUE(StringPiece16(testing) > banana); in TEST()
42 EXPECT_TRUE(StringPiece16(testing) > car); in TEST()
43 EXPECT_TRUE(StringPiece16(banana) < testing); in TEST()
44 EXPECT_TRUE(StringPiece16(banana) < car); in TEST()
45 EXPECT_TRUE(StringPiece16(car) < testing); in TEST()
46 EXPECT_TRUE(StringPiece16(car) > banana); in TEST()
78 StringPiece16 text16(u"I am a leaf on the wind."); in TEST()
79 StringPiece16 startNeedle16(u"I am"); in TEST()
[all …]
DUtil_test.cpp29 StringPiece16 trimmed = util::trimWhitespace(full); in TEST()
43 EXPECT_EQ(StringPiece16(u"this is a new\nline."), in TEST()
50 EXPECT_EQ(StringPiece16(u"hey guys this is so cool"), in TEST()
55 EXPECT_EQ(StringPiece16(u" wow, so many \t spaces. what?"), in TEST()
60 EXPECT_EQ(StringPiece16(u"where is the pie?"), in TEST()
67 EXPECT_EQ(StringPiece16(u"hey guys\n this \t is so\\ cool"), in TEST()
72 EXPECT_EQ(StringPiece16(u"@?#\\\'"), in TEST()
83 EXPECT_EQ(StringPiece16(u"\u00AF\u0AF0 woah"), in TEST()
91 auto tokenizer = util::tokenize(StringPiece16(u"this| is|the|end"), u'|'); in TEST()
93 ASSERT_EQ(*iter, StringPiece16(u"this")); in TEST()
[all …]
DUtil.cpp57 StringPiece16 trimWhitespace(const StringPiece16& str) { in trimWhitespace()
73 return StringPiece16(start, end - start); in trimWhitespace()
95 StringPiece16::const_iterator findNonAlphaNumericAndNotInSet(const StringPiece16& str, in findNonAlphaNumericAndNotInSet()
96 const StringPiece16& allowedChars) { in findNonAlphaNumericAndNotInSet()
121 bool isJavaClassName(const StringPiece16& str) { in isJavaClassName()
123 for (const StringPiece16& piece : tokenize(str, u'.')) { in isJavaClassName()
141 bool isJavaPackageName(const StringPiece16& str) { in isJavaPackageName()
147 for (const StringPiece16& piece : tokenize(str, u'.')) { in isJavaPackageName()
164 Maybe<std::u16string> getFullyQualifiedClassName(const StringPiece16& package, in getFullyQualifiedClassName()
165 const StringPiece16& className) { in getFullyQualifiedClassName()
[all …]
DUtil.h63 StringPiece16 trimWhitespace(const StringPiece16& str);
79 StringPiece16::const_iterator findNonAlphaNumericAndNotInSet(const StringPiece16& str,
80 const StringPiece16& allowedChars);
85 bool isJavaClassName(const StringPiece16& str);
90 bool isJavaPackageName(const StringPiece16& str);
100 Maybe<std::u16string> getFullyQualifiedClassName(const StringPiece16& package,
101 const StringPiece16& className);
152 inline StringPiece16 getString(const android::ResStringPool& pool, size_t idx) { in getString()
156 return StringPiece16(str, len); in getString()
158 return StringPiece16(); in getString()
[all …]
/frameworks/base/tools/aapt2/test/
DBuilders.h43 ResourceTableBuilder& setPackageId(const StringPiece16& packageName, uint8_t id) { in setPackageId()
49 ResourceTableBuilder& addSimple(const StringPiece16& name, const ResourceId id = {}) {
53 ResourceTableBuilder& addReference(const StringPiece16& name, const StringPiece16& ref) { in addReference()
57 ResourceTableBuilder& addReference(const StringPiece16& name, const ResourceId id, in addReference()
58 const StringPiece16& ref) { in addReference()
62 ResourceTableBuilder& addString(const StringPiece16& name, const StringPiece16& str) { in addString()
66 ResourceTableBuilder& addString(const StringPiece16& name, const ResourceId id, in addString()
67 const StringPiece16& str) { in addString()
71 ResourceTableBuilder& addString(const StringPiece16& name, const ResourceId id, in addString()
72 const ConfigDescription& config, const StringPiece16& str) { in addString()
[all …]
DCommon.h65 inline ResourceName parseNameOrDie(const StringPiece16& str) { in parseNameOrDie()
80 const StringPiece16& resName, in getValueForConfigAndProduct()
93 template <typename T> T* getValueForConfig(ResourceTable* table, const StringPiece16& resName, in getValueForConfig()
98 template <typename T> T* getValue(ResourceTable* table, const StringPiece16& resName) { in getValue()
/frameworks/base/tools/aapt2/xml/
DXmlPullParser_test.cpp35 EXPECT_EQ(StringPiece16(u"a"), StringPiece16(parser.getElementName())); in TEST()
40 EXPECT_EQ(StringPiece16(u"b"), StringPiece16(parser.getElementName())); in TEST()
45 EXPECT_EQ(StringPiece16(u"c"), StringPiece16(parser.getElementName())); in TEST()
49 EXPECT_EQ(StringPiece16(u"e"), StringPiece16(parser.getElementName())); in TEST()
DXmlPullParser.h118 const StringPiece16& alias, const StringPiece16& localPackage) const override;
144 const_iterator findAttribute(StringPiece16 namespaceUri, StringPiece16 name) const;
182 Maybe<StringPiece16> findAttribute(const XmlPullParser* parser, const StringPiece16& name);
188 Maybe<StringPiece16> findNonEmptyAttribute(const XmlPullParser* parser, const StringPiece16& name);
273 inline XmlPullParser::const_iterator XmlPullParser::findAttribute(StringPiece16 namespaceUri, in findAttribute()
274 StringPiece16 name) const { in findAttribute()
277 std::pair<StringPiece16, StringPiece16>(namespaceUri, name), in findAttribute()
278 [](const Attribute& attr, const std::pair<StringPiece16, StringPiece16>& rhs) -> bool { in findAttribute()
DXmlDom.h95 Attribute* findAttribute(const StringPiece16& ns, const StringPiece16& name);
96 xml::Element* findChild(const StringPiece16& ns, const StringPiece16& name);
97 xml::Element* findChildWithAttribute(const StringPiece16& ns, const StringPiece16& name,
98 const StringPiece16& attrNs,
99 const StringPiece16& attrName,
100 const StringPiece16& attrValue);
189 const StringPiece16& alias, const StringPiece16& localPackage) const override;
DXmlUtil.cpp28 StringPiece16 schemaPrefix = kSchemaPublicPrefix; in extractPackageFromNamespace()
29 StringPiece16 package = namespaceUri; in extractPackageFromNamespace()
37 StringPiece16 schemaPrefix = kSchemaPrivatePrefix; in extractPackageFromNamespace()
38 StringPiece16 package = namespaceUri; in extractPackageFromNamespace()
52 const StringPiece16& localPackage, Reference* inRef) { in transformReferenceFromNamespace()
DXmlUtil.h71 const StringPiece16& alias, const StringPiece16& localPackage) const = 0;
80 const StringPiece16& localPackage, Reference* inRef);
DXmlPullParser.cpp137 const StringPiece16& alias, const StringPiece16& localPackage) const { in transformPackageAlias()
288 Maybe<StringPiece16> findAttribute(const XmlPullParser* parser, const StringPiece16& name) { in findAttribute()
291 return StringPiece16(util::trimWhitespace(iter->value)); in findAttribute()
296 Maybe<StringPiece16> findNonEmptyAttribute(const XmlPullParser* parser, const StringPiece16& name) { in findNonEmptyAttribute()
299 StringPiece16 trimmed = util::trimWhitespace(iter->value); in findNonEmptyAttribute()
DXmlDom.cpp350 Attribute* Element::findAttribute(const StringPiece16& ns, const StringPiece16& name) { in findAttribute()
359 Element* Element::findChild(const StringPiece16& ns, const StringPiece16& name) { in findChild()
363 Element* Element::findChildWithAttribute(const StringPiece16& ns, const StringPiece16& name, in findChildWithAttribute()
364 const StringPiece16& attrNs, const StringPiece16& attrName, in findChildWithAttribute()
365 const StringPiece16& attrValue) { in findChildWithAttribute()
425 const StringPiece16& alias, const StringPiece16& localPackage) const { in transformPackageAlias()
/frameworks/base/tools/aapt2/flatten/
DXmlFlattener_test.cpp93 EXPECT_EQ(StringPiece16(tagName, len), u"View"); in TEST_F()
98 EXPECT_EQ(StringPiece16(attrName, len), u"attr"); in TEST_F()
100 EXPECT_EQ(0, tree.indexOfAttribute(nullptr, 0, u"attr", StringPiece16(u"attr").size())); in TEST_F()
106 EXPECT_EQ(StringPiece16(tagName, len), u"Layout"); in TEST_F()
110 EXPECT_EQ(StringPiece16(attrNamespace, len), u"http://com.test"); in TEST_F()
113 EXPECT_EQ(StringPiece16(attrName, len), u"hello"); in TEST_F()
120 EXPECT_EQ(StringPiece16(tagName, len), u"Layout"); in TEST_F()
125 EXPECT_EQ(StringPiece16(text, len), u"Some text"); in TEST_F()
130 EXPECT_EQ(StringPiece16(tagName, len), u"Layout"); in TEST_F()
135 EXPECT_EQ(StringPiece16(tagName, len), u"View"); in TEST_F()
[all …]
/frameworks/base/tools/aapt2/java/
DJavaClassGenerator.h69 bool generate(const StringPiece16& packageNameToGenerate, std::ostream* out);
71 bool generate(const StringPiece16& packageNameToGenerate,
72 const StringPiece16& outputPackageName,
78 bool addMembersToTypeClass(const StringPiece16& packageNameToGenerate,
83 void addMembersToStyleableClass(const StringPiece16& packageNameToGenerate,
DManifestClassGenerator.cpp28 static Maybe<StringPiece16> extractJavaIdentifier(IDiagnostics* diag, const Source& source, in extractJavaIdentifier()
29 const StringPiece16& value) { in extractJavaIdentifier()
30 const StringPiece16 sep = u"."; in extractJavaIdentifier()
33 StringPiece16 result; in extractJavaIdentifier()
48 << "invalid character '" << StringPiece16(iter, 1) in extractJavaIdentifier()
69 Maybe<StringPiece16> result = extractJavaIdentifier(diag, source.withLine(el->lineNumber), in writeSymbol()
DJavaClassGenerator.cpp42 static const std::set<StringPiece16> sJavaIdentifiers = {
55 static bool isValidSymbol(const StringPiece16& symbol) { in isValidSymbol()
63 static std::string transform(const StringPiece16& symbol) { in transform()
86 const StringPiece16& packageNameToGenerate) { in transformNestedAttr()
207 void JavaClassGenerator::addMembersToStyleableClass(const StringPiece16& packageNameToGenerate, in addMembersToStyleableClass()
287 StringPiece16 attrCommentLine = entry.symbol->attribute->getComment(); in addMembersToStyleableClass()
288 if (attrCommentLine.contains(StringPiece16(u"@removed"))) { in addMembersToStyleableClass()
357 StringPiece16 comment = styleableAttr.attrRef->getComment(); in addMembersToStyleableClass()
362 if (comment.contains(StringPiece16(u"@removed"))) { in addMembersToStyleableClass()
370 StringPiece16 packageName = attrName.package; in addMembersToStyleableClass()
[all …]
/frameworks/base/tools/aapt2/compile/
DPseudolocalizer.cpp41 std::u16string text(const StringPiece16& text) override { return text.toString(); } in text()
42 std::u16string placeholder(const StringPiece16& text) override { return text.toString(); } in placeholder()
47 std::u16string text(const StringPiece16& text) override;
48 std::u16string placeholder(const StringPiece16& text) override;
56 std::u16string text(const StringPiece16& text) override;
57 std::u16string placeholder(const StringPiece16& text) override;
82 std::u16string Pseudolocalizer::text(const StringPiece16& text) { in text()
270 std::u16string PseudoMethodAccent::text(const StringPiece16& source) in text()
359 std::u16string PseudoMethodAccent::placeholder(const StringPiece16& source) { in placeholder()
364 std::u16string PseudoMethodBidi::text(const StringPiece16& source) { in text()
[all …]
DPseudolocalizer.h34 virtual std::u16string text(const StringPiece16& text) = 0;
35 virtual std::u16string placeholder(const StringPiece16& text) = 0;
50 std::u16string text(const StringPiece16& text);

12