diff options
author | 2017-01-19 23:40:02 +0000 | |
---|---|---|
committer | 2017-01-19 23:40:06 +0000 | |
commit | 1f9f11007db09bbbc156965e77b10de82a32a544 (patch) | |
tree | e715a9edb691da38726c2c5487625bd35b05ec94 /tools/aapt2/Resource.h | |
parent | 12375e9e0d14868cf63c0d6584c7a7d9440c30c4 (diff) | |
parent | d5083f6f6b9bc76bbe64052bcec639eee752a321 (diff) |
Merge "Move StringPiece to libandroidfw"
Diffstat (limited to 'tools/aapt2/Resource.h')
-rw-r--r-- | tools/aapt2/Resource.h | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/tools/aapt2/Resource.h b/tools/aapt2/Resource.h index 13330b548d2c..1950ea35a652 100644 --- a/tools/aapt2/Resource.h +++ b/tools/aapt2/Resource.h @@ -24,11 +24,11 @@ #include <tuple> #include <vector> +#include "androidfw/StringPiece.h" #include "utils/JenkinsHash.h" #include "ConfigDescription.h" #include "Source.h" -#include "util/StringPiece.h" namespace aapt { @@ -63,13 +63,13 @@ enum class ResourceType { kXml, }; -StringPiece ToString(ResourceType type); +android::StringPiece ToString(ResourceType type); /** * Returns a pointer to a valid ResourceType, or nullptr if * the string was invalid. */ -const ResourceType* ParseResourceType(const StringPiece& str); +const ResourceType* ParseResourceType(const android::StringPiece& str); /** * A resource's name. This can uniquely identify @@ -81,7 +81,7 @@ struct ResourceName { std::string entry; ResourceName() = default; - ResourceName(const StringPiece& p, ResourceType t, const StringPiece& e); + ResourceName(const android::StringPiece& p, ResourceType t, const android::StringPiece& e); int compare(const ResourceName& other) const; @@ -96,15 +96,15 @@ struct ResourceName { * of the original string. */ struct ResourceNameRef { - StringPiece package; + android::StringPiece package; ResourceType type = ResourceType::kRaw; - StringPiece entry; + android::StringPiece entry; ResourceNameRef() = default; ResourceNameRef(const ResourceNameRef&) = default; ResourceNameRef(ResourceNameRef&&) = default; ResourceNameRef(const ResourceName& rhs); // NOLINT(implicit) - ResourceNameRef(const StringPiece& p, ResourceType t, const StringPiece& e); + ResourceNameRef(const android::StringPiece& p, ResourceType t, const android::StringPiece& e); ResourceNameRef& operator=(const ResourceNameRef& rhs) = default; ResourceNameRef& operator=(ResourceNameRef&& rhs) = default; ResourceNameRef& operator=(const ResourceName& rhs); @@ -258,9 +258,9 @@ inline ::std::ostream& operator<<(::std::ostream& out, // ResourceName implementation. // -inline ResourceName::ResourceName(const StringPiece& p, ResourceType t, - const StringPiece& e) - : package(p.ToString()), type(t), entry(e.ToString()) {} +inline ResourceName::ResourceName(const android::StringPiece& p, ResourceType t, + const android::StringPiece& e) + : package(p.to_string()), type(t), entry(e.to_string()) {} inline int ResourceName::compare(const ResourceName& other) const { int cmp = package.compare(other.package); @@ -311,8 +311,8 @@ inline std::string ResourceName::ToString() const { inline ResourceNameRef::ResourceNameRef(const ResourceName& rhs) : package(rhs.package), type(rhs.type), entry(rhs.entry) {} -inline ResourceNameRef::ResourceNameRef(const StringPiece& p, ResourceType t, - const StringPiece& e) +inline ResourceNameRef::ResourceNameRef(const android::StringPiece& p, ResourceType t, + const android::StringPiece& e) : package(p), type(t), entry(e) {} inline ResourceNameRef& ResourceNameRef::operator=(const ResourceName& rhs) { |