Commit graph

8 commits

Author SHA1 Message Date
Elliott Hughes
bf0dd7cb03 Fix ubsan failure in android::base::Split.
ubsan doesn't like us incrementing std::string::npos, even if we won't use
the result.

Bug: http://b/28729303
Test: ran tests
Change-Id: I8227eca57dc6f3e49626c7025514caa04ef18f0a
2017-02-13 14:13:24 -08:00
Elliott Hughes
2140782d24 bootable/recovery wants EqualsIgnoreCase.
Bug: N/A
Test: ran tests
Change-Id: I4a6ee9eba0514b8bb8fb0489f4d370964ce9c1c2
2017-01-13 18:51:32 -08:00
Elliott Hughes
42937492c8 Add StartsWithIgnoreCase/EndsWithIgnoreCase.
This has come up a couple of times now.

Bug: wanted as part of http://b/32094640
Test: ran tests
Change-Id: I51b67074b7ddeedd771d7be9651ba33e05491b33
2016-10-25 14:56:04 -07:00
Elliott Hughes
4f71319df0 Track rename of base/ to android-base/.
Change-Id: Idf9444fece4aa89c93e15640de59a91f6e758ccf
2015-12-04 22:00:26 -08:00
Dan Albert
e0da8a1d37 Generalize Join to work for any container/element.
This is more scalable than explicitly instantiating templates for the
cross product of containers and element types.

Specifically I'm adding this so I can join an unordered_set in adb.

Change-Id: I0055f3390a0ff26a886a0d41bbf0d4fe3d210f9c
2015-05-22 10:07:06 -07:00
Elliott Hughes
8d5fa6da44 Remove strtok from adb.
Also fix android::base::Split to behave like Java, Python, and google3.

Change-Id: Ifbffd4e92950a79e7aea5d153c95fe0980648417
2015-04-27 19:42:20 -07:00
Dan Albert
47328c96d9 Update string Split API.
Return a new vector rather than appending to the parameter.

Delimiters are also a string rather than a character. Split on any
character in the string.

Change-Id: I039b332ace5578590df9e7ca0e8fa3db28db30a3
2015-03-23 10:23:11 -07:00
Dan Albert
0f1e54491c Add common string utilities to libbase.
These are useful outside of ART. Nothing changed (aside from fixing
Trim to not segfault on empty strings), so ART should be able to move
to using these.

Change-Id: Id026ebffe8d31f784a91834786ab189680b13a0f
2015-03-16 20:03:03 -07:00