summaryrefslogtreecommitdiff
path: root/tools/aapt2/StringPool.h
diff options
context:
space:
mode:
authorAdam Lesinski <adamlesinski@google.com>2017-10-18 15:07:33 -0700
committerAdam Lesinski <adamlesinski@google.com>2017-10-18 15:12:42 -0700
commit8a0b238b1344dae0042bbb17b71c0c3b9b881f22 (patch)
tree08e3b0916bdee1b41d98a58e9049b9938ee6b10b /tools/aapt2/StringPool.h
parent85e7dbc93ee35d134a75a352093baf29127715ea (diff)
AAPT2: Ensure strings are sorted by configuration
Keep strings sorted by configuration so that strings likely to be selected (all match the same locale, for instance) are close together. Bug: 67958501 Test: make aapt2_tests Change-Id: Id17d93bf2e03ce408a6f619d3ea6dc313e393b76
Diffstat (limited to 'tools/aapt2/StringPool.h')
-rw-r--r--tools/aapt2/StringPool.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/aapt2/StringPool.h b/tools/aapt2/StringPool.h
index 8350d0d09108..3c1f3dc3a1bb 100644
--- a/tools/aapt2/StringPool.h
+++ b/tools/aapt2/StringPool.h
@@ -49,6 +49,8 @@ struct StyleString {
// Otherwise, the style data array would have to be sparse and take up more space.
class StringPool {
public:
+ using size_type = size_t;
+
class Context {
public:
enum : uint32_t {
@@ -165,6 +167,9 @@ class StringPool {
// when sorting the string pool. Returns a reference to the string in the pool.
Ref MakeRef(const android::StringPiece& str, const Context& context);
+ // Adds a string from another string pool. Returns a reference to the string in the string pool.
+ Ref MakeRef(const Ref& ref);
+
// Adds a style to the string pool and returns a reference to it.
StyleRef MakeRef(const StyleString& str);