mirror of
https://github.com/revanced/aapt2.git
synced 2025-02-11 01:56:47 +01:00
50 lines
1.8 KiB
Diff
50 lines
1.8 KiB
Diff
|
--- a/base/libs/androidfw/include/androidfw/StringPiece.h 2022-09-24 10:22:22.808291321 +0800
|
||
|
+++ b/base/libs/androidfw/include/androidfw/StringPiece.h 2022-09-24 10:20:04.808277573 +0800
|
||
|
@@ -68,13 +68,19 @@
|
||
|
size_t size() const;
|
||
|
bool empty() const;
|
||
|
std::basic_string<TChar> to_string() const;
|
||
|
+
|
||
|
bool contains(const BasicStringPiece<TChar>& rhs) const;
|
||
|
int compare(const BasicStringPiece<TChar>& rhs) const;
|
||
|
bool operator<(const BasicStringPiece<TChar>& rhs) const;
|
||
|
bool operator>(const BasicStringPiece<TChar>& rhs) const;
|
||
|
bool operator==(const BasicStringPiece<TChar>& rhs) const;
|
||
|
bool operator!=(const BasicStringPiece<TChar>& rhs) const;
|
||
|
-
|
||
|
+ // for std::basic_string
|
||
|
+ bool operator<(const std::basic_string<TChar>& rhs) const;
|
||
|
+ bool operator>(const std::basic_string<TChar>& rhs) const;
|
||
|
+ bool operator==(const std::basic_string<TChar>& rhs) const;
|
||
|
+ bool operator!=(const std::basic_string<TChar>& rhs) const;
|
||
|
+
|
||
|
const_iterator begin() const;
|
||
|
const_iterator end() const;
|
||
|
|
||
|
@@ -256,6 +262,26 @@
|
||
|
}
|
||
|
|
||
|
+ template <typename TChar>
|
||
|
+inline bool BasicStringPiece<TChar>::operator<(const std::basic_string<TChar>& rhs) const {
|
||
|
+ return compare(BasicStringPiece(rhs)) < 0;
|
||
|
+}
|
||
|
+
|
||
|
+template <typename TChar>
|
||
|
+inline bool BasicStringPiece<TChar>::operator>(const std::basic_string<TChar>& rhs) const {
|
||
|
+ return compare(BasicStringPiece(rhs)) > 0;
|
||
|
+}
|
||
|
+
|
||
|
+template <typename TChar>
|
||
|
+inline bool BasicStringPiece<TChar>::operator==(const std::basic_string<TChar>& rhs) const {
|
||
|
+ return compare(BasicStringPiece(rhs)) == 0;
|
||
|
+}
|
||
|
+
|
||
|
+template <typename TChar>
|
||
|
+inline bool BasicStringPiece<TChar>::operator!=(const std::basic_string<TChar>& rhs) const{
|
||
|
+ return compare(BasicStringPiece(rhs)) != 0;
|
||
|
+}
|
||
|
+
|
||
|
template <typename TChar>
|
||
|
inline typename BasicStringPiece<TChar>::const_iterator BasicStringPiece<TChar>::begin() const {
|
||
|
return data_;
|
||
|
}
|