summaryrefslogtreecommitdiff
path: root/tools/aapt2/compile/Compile.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/aapt2/compile/Compile.cpp')
-rw-r--r--tools/aapt2/compile/Compile.cpp22
1 files changed, 13 insertions, 9 deletions
diff --git a/tools/aapt2/compile/Compile.cpp b/tools/aapt2/compile/Compile.cpp
index 2452a1d29410..39e4489ffda2 100644
--- a/tools/aapt2/compile/Compile.cpp
+++ b/tools/aapt2/compile/Compile.cpp
@@ -43,8 +43,8 @@ namespace aapt {
struct ResourcePathData {
Source source;
- std::u16string resourceDir;
- std::u16string name;
+ std::string resourceDir;
+ std::string name;
std::string extension;
// Original config str. We keep this because when we parse the config, we may add on
@@ -96,8 +96,8 @@ static Maybe<ResourcePathData> extractResourcePathData(const std::string& path,
return ResourcePathData{
Source(path),
- util::utf8ToUtf16(dirStr),
- util::utf8ToUtf16(name),
+ dirStr.toString(),
+ name.toString(),
extension.toString(),
configStr.toString(),
config
@@ -127,7 +127,7 @@ static std::string buildIntermediateFilename(const ResourcePathData& data) {
}
static bool isHidden(const StringPiece& filename) {
- return util::stringStartsWith<char>(filename, ".");
+ return util::stringStartsWith(filename, ".");
}
/**
@@ -200,7 +200,7 @@ static bool compileTable(IAaptContext* context, const CompileOptions& options,
parserOptions.errorOnPositionalArguments = !options.legacyMode;
// If the filename includes donottranslate, then the default translatable is false.
- parserOptions.translatable = pathData.name.find(u"donottranslate") == std::string::npos;
+ parserOptions.translatable = pathData.name.find("donottranslate") == std::string::npos;
ResourceParser resParser(context->getDiagnostics(), &table, pathData.source,
pathData.config, parserOptions);
@@ -440,8 +440,8 @@ public:
return nullptr;
}
- const std::u16string& getCompilationPackage() override {
- static std::u16string empty;
+ const std::string& getCompilationPackage() override {
+ static std::string empty;
return empty;
}
@@ -454,6 +454,10 @@ public:
return nullptr;
}
+ int getMinSdkVersion() override {
+ return 0;
+ }
+
private:
StdErrDiagnostics mDiagnostics;
bool mVerbose = false;
@@ -526,7 +530,7 @@ int compile(const std::vector<StringPiece>& args) {
context.getDiagnostics()->note(DiagMessage(pathData.source) << "processing");
}
- if (pathData.resourceDir == u"values") {
+ if (pathData.resourceDir == "values") {
// Overwrite the extension.
pathData.extension = "arsc";