summaryrefslogtreecommitdiff
path: root/cmdline
diff options
context:
space:
mode:
Diffstat (limited to 'cmdline')
-rw-r--r--cmdline/cmdline.h12
-rw-r--r--cmdline/cmdline_types.h18
-rw-r--r--cmdline/detail/cmdline_parse_argument_detail.h6
-rw-r--r--cmdline/token_range.h4
4 files changed, 24 insertions, 16 deletions
diff --git a/cmdline/cmdline.h b/cmdline/cmdline.h
index 6e042c3c27..f4540ff655 100644
--- a/cmdline/cmdline.h
+++ b/cmdline/cmdline.h
@@ -24,10 +24,12 @@
#include <iostream>
#include <string>
-#include "runtime.h"
+#include "android-base/stringprintf.h"
+
+#include "base/logging.h"
#include "base/stringpiece.h"
#include "noop_compiler_callbacks.h"
-#include "base/logging.h"
+#include "runtime.h"
#if !defined(NDEBUG)
#define DBG_LOG LOG(INFO)
@@ -197,7 +199,7 @@ struct CmdlineArgs {
" Example: --boot-image=/system/framework/boot.art\n"
" (specifies /system/framework/<arch>/boot.art as the image file)\n"
"\n";
- usage += StringPrintf( // Optional.
+ usage += android::base::StringPrintf( // Optional.
" --instruction-set=(arm|arm64|mips|mips64|x86|x86_64): for locating the image\n"
" file based on the image location set.\n"
" Example: --instruction-set=x86\n"
@@ -264,8 +266,8 @@ struct CmdlineArgs {
// Check that the boot image location points to a valid file name.
std::string file_name;
if (!LocationToFilename(boot_image_location, instruction_set_, &file_name)) {
- *error_msg = StringPrintf("No corresponding file for location '%s' exists",
- file_name.c_str());
+ *error_msg = android::base::StringPrintf("No corresponding file for location '%s' exists",
+ file_name.c_str());
return false;
}
diff --git a/cmdline/cmdline_types.h b/cmdline/cmdline_types.h
index 156ca9ef3e..e41d9bde59 100644
--- a/cmdline/cmdline_types.h
+++ b/cmdline/cmdline_types.h
@@ -22,6 +22,8 @@
#include "detail/cmdline_debug_detail.h"
#include "cmdline_type_parser.h"
+#include "android-base/strings.h"
+
// Includes for the types that are being specialized
#include <string>
#include "base/logging.h"
@@ -447,7 +449,7 @@ struct ParseStringList {
}
std::string Join() const {
- return art::Join(list_, Separator);
+ return android::base::Join(list_, Separator);
}
static ParseStringList<Separator> Split(const std::string& str) {
@@ -709,43 +711,43 @@ struct CmdlineType<ProfileSaverOptions> : CmdlineTypeParser<ProfileSaverOptions>
// The rest of these options are always the wildcard from '-Xps-*'
std::string suffix = RemovePrefix(option);
- if (StartsWith(option, "min-save-period-ms:")) {
+ if (android::base::StartsWith(option, "min-save-period-ms:")) {
CmdlineType<unsigned int> type_parser;
return ParseInto(existing,
&ProfileSaverOptions::min_save_period_ms_,
type_parser.Parse(suffix));
}
- if (StartsWith(option, "save-resolved-classes-delay-ms:")) {
+ if (android::base::StartsWith(option, "save-resolved-classes-delay-ms:")) {
CmdlineType<unsigned int> type_parser;
return ParseInto(existing,
&ProfileSaverOptions::save_resolved_classes_delay_ms_,
type_parser.Parse(suffix));
}
- if (StartsWith(option, "startup-method-samples:")) {
+ if (android::base::StartsWith(option, "startup-method-samples:")) {
CmdlineType<unsigned int> type_parser;
return ParseInto(existing,
&ProfileSaverOptions::startup_method_samples_,
type_parser.Parse(suffix));
}
- if (StartsWith(option, "min-methods-to-save:")) {
+ if (android::base::StartsWith(option, "min-methods-to-save:")) {
CmdlineType<unsigned int> type_parser;
return ParseInto(existing,
&ProfileSaverOptions::min_methods_to_save_,
type_parser.Parse(suffix));
}
- if (StartsWith(option, "min-classes-to-save:")) {
+ if (android::base::StartsWith(option, "min-classes-to-save:")) {
CmdlineType<unsigned int> type_parser;
return ParseInto(existing,
&ProfileSaverOptions::min_classes_to_save_,
type_parser.Parse(suffix));
}
- if (StartsWith(option, "min-notification-before-wake:")) {
+ if (android::base::StartsWith(option, "min-notification-before-wake:")) {
CmdlineType<unsigned int> type_parser;
return ParseInto(existing,
&ProfileSaverOptions::min_notification_before_wake_,
type_parser.Parse(suffix));
}
- if (StartsWith(option, "max-notification-before-wake:")) {
+ if (android::base::StartsWith(option, "max-notification-before-wake:")) {
CmdlineType<unsigned int> type_parser;
return ParseInto(existing,
&ProfileSaverOptions::max_notification_before_wake_,
diff --git a/cmdline/detail/cmdline_parse_argument_detail.h b/cmdline/detail/cmdline_parse_argument_detail.h
index 14eac30aa1..da03c2198f 100644
--- a/cmdline/detail/cmdline_parse_argument_detail.h
+++ b/cmdline/detail/cmdline_parse_argument_detail.h
@@ -25,6 +25,8 @@
#include <numeric>
#include <memory>
+#include "android-base/strings.h"
+
#include "cmdline_parse_result.h"
#include "cmdline_types.h"
#include "token_range.h"
@@ -399,7 +401,7 @@ namespace art {
allowed_values.push_back(name);
}
- std::string allowed_values_flat = Join(allowed_values, ',');
+ std::string allowed_values_flat = android::base::Join(allowed_values, ',');
return CmdlineResult(CmdlineResult::kFailure,
"Argument value '" + argument + "' does not match any of known valid"
"values: {" + allowed_values_flat + "}");
@@ -426,7 +428,7 @@ namespace art {
allowed_values.push_back(arg_name);
}
- std::string allowed_values_flat = Join(allowed_values, ',');
+ std::string allowed_values_flat = android::base::Join(allowed_values, ',');
return CmdlineResult(CmdlineResult::kFailure,
"Argument value '" + argument + "' does not match any of known valid"
"values: {" + allowed_values_flat + "}");
diff --git a/cmdline/token_range.h b/cmdline/token_range.h
index 335806795a..c22d6c8959 100644
--- a/cmdline/token_range.h
+++ b/cmdline/token_range.h
@@ -23,6 +23,8 @@
#include <algorithm>
#include <memory>
+#include "android-base/strings.h"
+
namespace art {
// A range of tokens to make token matching algorithms easier.
//
@@ -374,7 +376,7 @@ struct TokenRange {
// e.g. ["hello", "world"].join('$') == "hello$world"
std::string Join(char separator) const {
TokenList tmp(begin(), end());
- return art::Join(tmp, separator);
+ return android::base::Join(tmp, separator);
// TODO: Join should probably take an offset or iterators
}