diff options
author | Adam Lesinski <adamlesinski@google.com> | 2016-07-08 15:00:32 -0700 |
---|---|---|
committer | Adam Lesinski <adamlesinski@google.com> | 2016-07-13 17:45:28 -0700 |
commit | d0f116b619feede0cfdb647157ce5ab4d50a1c46 (patch) | |
tree | 5b2a8663602ba2b267890ff85d3cf5618ac922b5 /tools/aapt2/StringPool.h | |
parent | aaac91f4a00a9968ef107ea143e6f2f669f762f1 (diff) |
AAPT2: Remove usage of u16string
For legacy reasons, we kept around the use of UTF-16 internally
in AAPT2. We don't need this and this CL removes all instances of
std::u16string and StringPiece16. The only places still needed
are when interacting with the ResTable APIs that only operate in
UTF16.
Change-Id: I492475b84bb9014fa13bf992cff447ee7a5fe588
Diffstat (limited to 'tools/aapt2/StringPool.h')
-rw-r--r-- | tools/aapt2/StringPool.h | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/tools/aapt2/StringPool.h b/tools/aapt2/StringPool.h index 5f88543432c3..72ae9d184a78 100644 --- a/tools/aapt2/StringPool.h +++ b/tools/aapt2/StringPool.h @@ -30,13 +30,13 @@ namespace aapt { struct Span { - std::u16string name; + std::string name; uint32_t firstChar; uint32_t lastChar; }; struct StyleString { - std::u16string str; + std::string str; std::vector<Span> spans; }; @@ -56,8 +56,8 @@ public: ~Ref(); Ref& operator=(const Ref& rhs); - const std::u16string* operator->() const; - const std::u16string& operator*() const; + const std::string* operator->() const; + const std::string& operator*() const; size_t getIndex() const; const Context& getContext() const; @@ -95,7 +95,7 @@ public: class Entry { public: - std::u16string value; + std::string value; Context context; size_t index; @@ -136,14 +136,14 @@ public: * Adds a string to the pool, unless it already exists. Returns * a reference to the string in the pool. */ - Ref makeRef(const StringPiece16& str); + Ref makeRef(const StringPiece& str); /** * Adds a string to the pool, unless it already exists, with a context * object that can be used when sorting the string pool. Returns * a reference to the string in the pool. */ - Ref makeRef(const StringPiece16& str, const Context& context); + Ref makeRef(const StringPiece& str, const Context& context); /** * Adds a style to the string pool and returns a reference to it. @@ -195,11 +195,11 @@ private: static bool flatten(BigBuffer* out, const StringPool& pool, bool utf8); - Ref makeRefImpl(const StringPiece16& str, const Context& context, bool unique); + Ref makeRefImpl(const StringPiece& str, const Context& context, bool unique); std::vector<std::unique_ptr<Entry>> mStrings; std::vector<std::unique_ptr<StyleEntry>> mStyles; - std::unordered_multimap<StringPiece16, Entry*> mIndexedStrings; + std::unordered_multimap<StringPiece, Entry*> mIndexedStrings; }; // |