mirror of
https://github.com/revanced/aapt2.git
synced 2025-01-15 13:37:33 +01:00
refactor: split patches to separate files
This commit is contained in:
parent
1ad472f500
commit
352ee82400
@ -12,49 +12,6 @@ index cae2d0bc16b3..13c5f8fc84e8 100644
|
||||
#include <binder/TextOutput.h>
|
||||
|
||||
#endif
|
||||
diff --git a/src/base/libs/androidfw/include/androidfw/StringPiece.h b/src/base/libs/androidfw/include/androidfw/StringPiece.h
|
||||
index 921877dc4982..27e27e1c2b94 100644
|
||||
--- a/src/base/libs/androidfw/include/androidfw/StringPiece.h
|
||||
+++ b/src/base/libs/androidfw/include/androidfw/StringPiece.h
|
||||
@@ -75,6 +75,11 @@ class BasicStringPiece {
|
||||
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 +261,26 @@ inline bool BasicStringPiece<TChar>::operator!=(const BasicStringPiece<TChar>& r
|
||||
return compare(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 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_;
|
||||
diff --git a/src/base/tools/aapt2/ResourceTable.cpp b/src/base/tools/aapt2/ResourceTable.cpp
|
||||
index 8ab1493c6ab3..3a855f0f6866 100644
|
||||
--- a/src/base/tools/aapt2/ResourceTable.cpp
|
||||
@ -227,4 +184,4 @@ index d7a8e6fe6ada..74457add2e6b 100644
|
||||
+ return android::base::StringPrintf("%s.%s", sMajorVersion, sMinorVersion);
|
||||
}
|
||||
|
||||
static size_t ConsumeDigits(const char* start, const char* end) {
|
||||
static size_t ConsumeDigits(const char* start, const char* end) {
|
50
patches/androidfw.patch
Normal file
50
patches/androidfw.patch
Normal file
@ -0,0 +1,50 @@
|
||||
--- 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_;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user