Home
last modified time | relevance | path

Searched refs:StringPiece (Results 1 – 25 of 153) sorted by relevance

1234567

/frameworks/base/tools/aapt2/util/
DUtil.h51 std::vector<std::string> Split(android::StringPiece str, char sep);
52 std::vector<std::string> SplitAndLowercase(android::StringPiece str, char sep);
55 bool StartsWith(android::StringPiece str, android::StringPiece prefix);
58 bool EndsWith(android::StringPiece str, android::StringPiece suffix);
62 android::StringPiece TrimLeadingWhitespace(android::StringPiece str);
66 android::StringPiece TrimTrailingWhitespace(android::StringPiece str);
70 android::StringPiece TrimWhitespace(android::StringPiece str);
73 bool IsJavaClassName(android::StringPiece str);
76 bool IsJavaPackageName(android::StringPiece str);
83 bool IsAndroidPackageName(android::StringPiece str);
[all …]
DUtil.cpp36 using ::android::StringPiece;
47 static std::vector<std::string> SplitAndTransform(StringPiece str, char sep, char (*f)(char)) { in SplitAndTransform()
49 const StringPiece::const_iterator end = std::end(str); in SplitAndTransform()
50 StringPiece::const_iterator start = std::begin(str); in SplitAndTransform()
51 StringPiece::const_iterator current; in SplitAndTransform()
64 std::vector<std::string> Split(StringPiece str, char sep) { in Split()
68 std::vector<std::string> SplitAndLowercase(StringPiece str, char sep) { in SplitAndLowercase()
72 bool StartsWith(StringPiece str, StringPiece prefix) { in StartsWith()
79 bool EndsWith(StringPiece str, StringPiece suffix) { in EndsWith()
86 StringPiece TrimLeadingWhitespace(StringPiece str) { in TrimLeadingWhitespace()
[all …]
DFiles.h60 void AppendPath(std::string* base, android::StringPiece part);
63 std::string BuildPath(std::vector<const android::StringPiece>&& args);
69 android::StringPiece GetStem(android::StringPiece path);
72 android::StringPiece GetFilename(android::StringPiece path);
76 android::StringPiece GetExtension(android::StringPiece path);
79 bool IsHidden(android::StringPiece path);
82 std::string PackageToPath(android::StringPiece package);
88 bool AppendArgsFromFile(android::StringPiece path, std::vector<std::string>* out_arglist,
92 bool AppendSetArgsFromFile(android::StringPiece path, std::unordered_set<std::string>* out_argset,
115 bool SetPattern(android::StringPiece pattern);
[all …]
DFiles.cpp41 using ::android::StringPiece;
142 StringPiece GetStem(StringPiece path) { in GetStem()
147 return StringPiece(start, current - start); in GetStem()
153 StringPiece GetFilename(StringPiece path) { in GetFilename()
161 return StringPiece(last_dir_sep, end - last_dir_sep); in GetFilename()
164 StringPiece GetExtension(StringPiece path) { in GetExtension()
165 StringPiece filename = GetFilename(path); in GetExtension()
169 return StringPiece(c, end - c); in GetExtension()
174 bool IsHidden(android::StringPiece path) { in IsHidden()
178 void AppendPath(std::string* base, StringPiece part) { in AppendPath()
[all …]
/frameworks/base/libs/androidfw/tests/
DStringPiece_test.cpp28 StringPiece a("hello world", 5); in TEST()
29 StringPiece b("hello moon", 5); in TEST()
42 EXPECT_TRUE(StringPiece(testing) > banana); in TEST()
43 EXPECT_TRUE(StringPiece(testing) > car); in TEST()
44 EXPECT_TRUE(StringPiece(banana) < testing); in TEST()
45 EXPECT_TRUE(StringPiece(banana) < car); in TEST()
46 EXPECT_TRUE(StringPiece(car) < testing); in TEST()
47 EXPECT_TRUE(StringPiece(car) > banana); in TEST()
55 EXPECT_TRUE(StringPiece(testing) > banana); in TEST()
56 EXPECT_TRUE(StringPiece(testing) > car); in TEST()
[all …]
/frameworks/base/tools/aapt2/cmd/
DCommand.h33 explicit Command(android::StringPiece name) : name_(name), full_subcommand_name_(name){}; in Command()
35 explicit Command(android::StringPiece name, android::StringPiece short_name) in Command()
52 void AddRequiredFlag(android::StringPiece name, android::StringPiece description,
55 void AddRequiredFlagList(android::StringPiece name, android::StringPiece description,
58 void AddOptionalFlag(android::StringPiece name, android::StringPiece description,
61 void AddOptionalFlagList(android::StringPiece name, android::StringPiece description,
64 void AddOptionalFlagList(android::StringPiece name, android::StringPiece description,
67 void AddOptionalSwitch(android::StringPiece name, android::StringPiece description, bool* value);
71 void SetDescription(android::StringPiece name);
79 int Execute(const std::vector<android::StringPiece>& args, std::ostream* outError);
[all …]
DCommand.cpp32 using android::StringPiece;
36 std::string GetSafePath(StringPiece arg) { in GetSafePath()
54 void Command::AddRequiredFlag(StringPiece name, StringPiece description, std::string* value, in AddRequiredFlag()
56 auto func = [value, flags](StringPiece arg) -> bool { in AddRequiredFlag()
64 void Command::AddRequiredFlagList(StringPiece name, StringPiece description, in AddRequiredFlagList()
66 auto func = [value, flags](StringPiece arg) -> bool { in AddRequiredFlagList()
74 void Command::AddOptionalFlag(StringPiece name, StringPiece description, in AddOptionalFlag()
76 auto func = [value, flags](StringPiece arg) -> bool { in AddOptionalFlag()
84 void Command::AddOptionalFlagList(StringPiece name, StringPiece description, in AddOptionalFlagList()
86 auto func = [value, flags](StringPiece arg) -> bool { in AddOptionalFlagList()
[all …]
/frameworks/minikin/libs/minikin/
DStringPiece.h26 class StringPiece {
28 StringPiece() : mData(nullptr), mLength(0) {} in StringPiece() function
29 StringPiece(const char* data) : mData(data), mLength(data == nullptr ? 0 : strlen(data)) {} in StringPiece() function
30 StringPiece(const char* data, size_t length) : mData(data), mLength(length) {} in StringPiece() function
31 StringPiece(const std::string& str) : mData(str.data()), mLength(str.size()) {} in StringPiece() function
32 StringPiece(std::string_view str) : mData(str.data()), mLength(str.size()) {} in StringPiece() function
41 inline StringPiece substr(size_t from, size_t length) const { in substr()
42 return StringPiece(mData + from, length); in substr()
60 inline bool operator==(const StringPiece& l, const StringPiece& r) {
73 inline bool operator==(const StringPiece& l, const char* s) {
[all …]
/frameworks/base/tools/aapt2/
DResourceUtils.h41 bool ParseResourceName(android::StringPiece str, ResourceNameRef* out_resource,
52 bool ParseReference(android::StringPiece str, ResourceNameRef* out_reference,
59 bool IsReference(android::StringPiece str);
66 bool ParseAttributeReference(android::StringPiece str, ResourceNameRef* out_reference);
72 bool IsAttributeReference(android::StringPiece str);
88 std::optional<bool> ParseBool(android::StringPiece str);
93 std::optional<uint32_t> ParseInt(android::StringPiece str);
98 std::optional<ResourceId> ParseResourceId(android::StringPiece str);
103 std::optional<int> ParseSdkVersion(android::StringPiece str);
116 std::optional<Reference> ParseStyleParentReference(android::StringPiece str,
[all …]
DResource.h72 android::StringPiece to_string(ResourceType type);
77 const ResourceType* ParseResourceType(android::StringPiece str);
90 ResourceNamedType(android::StringPiece n, ResourceType t);
104 android::StringPiece name;
111 ResourceNamedTypeRef(android::StringPiece n, ResourceType t);
123 std::optional<ResourceNamedTypeRef> ParseResourceNamedType(android::StringPiece s);
135 ResourceName(android::StringPiece p, const ResourceNamedTypeRef& t, android::StringPiece e);
136 ResourceName(android::StringPiece p, ResourceType t, android::StringPiece e);
151 android::StringPiece package;
153 android::StringPiece entry;
[all …]
DResourceUtils.cpp36 using ::android::StringPiece;
51 parsed_type = ParseResourceNamedType(StringPiece(type, type_len)); in ToResourceNamedType()
112 bool ParseResourceName(StringPiece str, ResourceNameRef* out_ref, bool* out_private) { in ParseResourceName()
124 StringPiece package; in ParseResourceName()
125 StringPiece type; in ParseResourceName()
126 StringPiece entry; in ParseResourceName()
153 bool ParseReference(StringPiece str, ResourceNameRef* out_ref, bool* out_create, in ParseReference()
155 StringPiece trimmed_str(util::TrimWhitespace(str)); in ParseReference()
200 bool IsReference(StringPiece str) { in IsReference()
204 bool ParseAttributeReference(StringPiece str, ResourceNameRef* out_ref) { in ParseAttributeReference()
[all …]
DResourceTable.h74 Overlayable(android::StringPiece name, android::StringPiece actor) : name(name), actor(actor) { in Overlayable()
76 Overlayable(android::StringPiece name, android::StringPiece actor, const android::Source& source) in Overlayable()
107 ResourceConfigValue(const android::ConfigDescription& config, android::StringPiece product) in ResourceConfigValue()
139 explicit ResourceEntry(android::StringPiece name) : name(name) { in ResourceEntry()
143 android::StringPiece product = {});
145 android::StringPiece product = {}) const;
148 android::StringPiece product);
184 ResourceEntry* CreateEntry(android::StringPiece name);
185 ResourceEntry* FindEntry(android::StringPiece name) const;
186 ResourceEntry* FindOrCreateEntry(android::StringPiece name);
[all …]
/frameworks/base/tools/aapt2/test/
DBuilders.h41 ResourceTableBuilder& AddSimple(android::StringPiece name, const ResourceId& id = {});
42 ResourceTableBuilder& AddSimple(android::StringPiece name,
45 ResourceTableBuilder& AddReference(android::StringPiece name, android::StringPiece ref);
46 ResourceTableBuilder& AddReference(android::StringPiece name, const ResourceId& id,
47 android::StringPiece ref);
48 ResourceTableBuilder& AddString(android::StringPiece name, android::StringPiece str);
49 ResourceTableBuilder& AddString(android::StringPiece name, const ResourceId& id,
50 android::StringPiece str);
51 ResourceTableBuilder& AddString(android::StringPiece name, const ResourceId& id,
53 android::StringPiece str);
[all …]
DBuilders.cpp32 using ::android::StringPiece;
37 ResourceTableBuilder& ResourceTableBuilder::AddSimple(StringPiece name, const ResourceId& id) { in AddSimple()
41 ResourceTableBuilder& ResourceTableBuilder::AddSimple(StringPiece name, in AddSimple()
47 ResourceTableBuilder& ResourceTableBuilder::AddReference(StringPiece name, StringPiece ref) { in AddReference()
51 ResourceTableBuilder& ResourceTableBuilder::AddReference(StringPiece name, const ResourceId& id, in AddReference()
52 StringPiece ref) { in AddReference()
56 ResourceTableBuilder& ResourceTableBuilder::AddString(StringPiece name, StringPiece str) { in AddString()
60 ResourceTableBuilder& ResourceTableBuilder::AddString(StringPiece name, const ResourceId& id, in AddString()
61 StringPiece str) { in AddString()
65 ResourceTableBuilder& ResourceTableBuilder::AddString(StringPiece name, const ResourceId& id, in AddString()
[all …]
/frameworks/base/tools/aapt2/xml/
DXmlDom.h99 Attribute* FindAttribute(android::StringPiece ns, android::StringPiece name);
100 const Attribute* FindAttribute(android::StringPiece ns, android::StringPiece name) const;
101 Attribute* FindOrCreateAttribute(android::StringPiece ns, android::StringPiece name);
102 void RemoveAttribute(android::StringPiece ns, android::StringPiece name);
104 Element* FindChild(android::StringPiece ns, android::StringPiece name);
105 const Element* FindChild(android::StringPiece ns, android::StringPiece name) const;
107 Element* FindChildWithAttribute(android::StringPiece ns, android::StringPiece name,
108 android::StringPiece attr_ns, android::StringPiece attr_name,
109 android::StringPiece attr_value);
111 const Element* FindChildWithAttribute(android::StringPiece ns, android::StringPiece name,
[all …]
DXmlPullParser.h122 std::optional<ExtractedPackage> TransformPackageAlias(android::StringPiece alias) const override;
155 const_iterator FindAttribute(android::StringPiece namespace_uri, android::StringPiece name) const;
194 std::optional<android::StringPiece> FindAttribute(const XmlPullParser* parser,
195 android::StringPiece name);
202 std::optional<android::StringPiece> FindNonEmptyAttribute(const XmlPullParser* parser,
203 android::StringPiece name);
306 android::StringPiece namespace_uri, android::StringPiece name) const { in FindAttribute()
310 std::pair<android::StringPiece, android::StringPiece>(namespace_uri, name), in FindAttribute()
312 const std::pair<android::StringPiece, android::StringPiece>& rhs) -> bool { in FindAttribute()
DXmlUtil.cpp25 using ::android::StringPiece;
30 std::string BuildPackageNamespace(StringPiece package, bool private_reference) { in BuildPackageNamespace()
38 StringPiece schema_prefix = kSchemaPublicPrefix; in ExtractPackageFromNamespace()
39 StringPiece package = namespace_uri; in ExtractPackageFromNamespace()
47 StringPiece schema_prefix = kSchemaPrivatePrefix; in ExtractPackageFromNamespace()
48 StringPiece package = namespace_uri; in ExtractPackageFromNamespace()
DXmlDom.cpp34 using ::android::StringPiece;
158 const StringPiece str(s, len); in CharacterDataHandler()
420 Attribute* Element::FindAttribute(StringPiece ns, StringPiece name) { in FindAttribute()
424 const Attribute* Element::FindAttribute(StringPiece ns, StringPiece name) const { in FindAttribute()
433 void Element::RemoveAttribute(StringPiece ns, StringPiece name) { in RemoveAttribute()
442 Attribute* Element::FindOrCreateAttribute(StringPiece ns, StringPiece name) { in FindOrCreateAttribute()
451 Element* Element::FindChild(StringPiece ns, StringPiece name) { in FindChild()
455 const Element* Element::FindChild(StringPiece ns, StringPiece name) const { in FindChild()
459 Element* Element::FindChildWithAttribute(StringPiece ns, StringPiece name, StringPiece attr_ns, in FindChildWithAttribute()
460 StringPiece attr_name, StringPiece attr_value) { in FindChildWithAttribute()
[all …]
/frameworks/minikin/tests/unittest/
DStringPieceTest.cpp25 StringPiece s(nullptr); in TEST()
31 StringPiece s(""); in TEST()
37 StringPiece s("", 0); in TEST()
43 StringPiece s("abcde"); in TEST()
51 StringPiece s("abcde", 5); in TEST()
59 StringPiece s("abcde", 3); in TEST()
68 StringPiece s(kText + 2, 3); in TEST()
77 StringPiece s(kText + 2); in TEST()
87 StringPiece s("abcde"); in TEST()
97 StringPiece s("mississippi"); in TEST()
[all …]
/frameworks/base/tools/aapt2/java/
DJavaClassGenerator.h72 bool Generate(android::StringPiece package_name_to_generate, android::OutputStream* out,
75 bool Generate(android::StringPiece package_name_to_generate,
76 android::StringPiece output_package_name, android::OutputStream* out,
81 static std::string TransformToFieldName(android::StringPiece symbol);
89 std::optional<std::string> UnmangleResource(android::StringPiece package_name,
90 android::StringPiece package_name_to_generate,
93 bool ProcessType(android::StringPiece package_name_to_generate,
108 const Styleable& styleable, android::StringPiece package_name_to_generate,
DAnnotationProcessor.cpp29 using ::android::StringPiece;
33 StringPiece AnnotationProcessor::ExtractFirstSentence(StringPiece comment) { in ExtractFirstSentence()
55 StringPiece doc_str;
57 StringPiece annotation;
97 const StringPiece trimmed = util::TrimWhitespace(comment); in AppendCommentLine()
114 void AnnotationProcessor::AppendComment(StringPiece comment, bool add_api_annotations) { in AppendComment()
116 for (StringPiece line : util::Tokenize(comment, '\n')) { in AppendComment()
133 for (StringPiece line : util::Tokenize(result, '\n')) { in Print()
/frameworks/base/libs/androidfw/
DResourceUtils.cpp21 bool ExtractResourceName(StringPiece str, StringPiece* out_package, StringPiece* out_type, in ExtractResourceName()
22 StringPiece* out_entry) { in ExtractResourceName()
36 *out_type = StringPiece(start, current - start); in ExtractResourceName()
40 *out_package = StringPiece(start, current - start); in ExtractResourceName()
45 *out_entry = StringPiece(start, end - start); in ExtractResourceName()
53 StringPiece package_name) { in ToResourceName()
59 if (base::expected<StringPiece, NullOrIOError> type_str = type_string_ref.string8(); in ToResourceName()
77 if (base::expected<StringPiece, NullOrIOError> entry_str = entry_string_ref.string8(); in ToResourceName()
/frameworks/base/libs/androidfw/include/androidfw/
DResourceUtils.h28 bool ExtractResourceName(StringPiece str, StringPiece* out_package, StringPiece* out_type,
29 StringPiece* out_entry);
35 StringPiece package_name);
/frameworks/base/tools/aapt2/compile/
DPseudolocalizer.cpp21 using android::StringPiece;
47 std::string Text(StringPiece text) override { in Text()
50 std::string Placeholder(StringPiece text) override { in Placeholder()
57 std::string Text(StringPiece text) override;
58 std::string Placeholder(StringPiece text) override;
66 std::string Text(StringPiece text) override;
67 std::string Placeholder(StringPiece text) override;
93 std::string Pseudolocalizer::Text(StringPiece text) { in Text()
360 std::string PseudoMethodAccent::Text(StringPiece source) { in Text()
446 std::string PseudoMethodAccent::Placeholder(StringPiece source) { in Placeholder()
[all …]
/frameworks/base/tools/aapt2/format/
DArchive.h49 virtual bool WriteFile(android::StringPiece path, uint32_t flags, android::InputStream* in) = 0;
54 virtual bool StartEntry(android::StringPiece path, uint32_t flags) = 0;
73 android::StringPiece path);
76 android::StringPiece path);

1234567