summaryrefslogtreecommitdiff
path: root/libartbase/base/utils.h
diff options
context:
space:
mode:
Diffstat (limited to 'libartbase/base/utils.h')
-rw-r--r--libartbase/base/utils.h39
1 files changed, 0 insertions, 39 deletions
diff --git a/libartbase/base/utils.h b/libartbase/base/utils.h
index 11472a8017..9284950c1a 100644
--- a/libartbase/base/utils.h
+++ b/libartbase/base/utils.h
@@ -30,7 +30,6 @@
#include "enums.h"
#include "globals.h"
#include "macros.h"
-#include "stringpiece.h"
namespace art {
@@ -91,44 +90,6 @@ static inline const void* EntryPointToCodePointer(const void* entry_point) {
return reinterpret_cast<const void*>(code);
}
-using UsageFn = void (*)(const char*, ...);
-
-template <typename T>
-static void ParseIntOption(const StringPiece& option,
- const std::string& option_name,
- T* out,
- UsageFn usage,
- bool is_long_option = true) {
- std::string option_prefix = option_name + (is_long_option ? "=" : "");
- DCHECK(option.starts_with(option_prefix)) << option << " " << option_prefix;
- const char* value_string = option.substr(option_prefix.size()).data();
- int64_t parsed_integer_value = 0;
- if (!android::base::ParseInt(value_string, &parsed_integer_value)) {
- usage("Failed to parse %s '%s' as an integer", option_name.c_str(), value_string);
- }
- *out = dchecked_integral_cast<T>(parsed_integer_value);
-}
-
-template <typename T>
-static void ParseUintOption(const StringPiece& option,
- const std::string& option_name,
- T* out,
- UsageFn usage,
- bool is_long_option = true) {
- ParseIntOption(option, option_name, out, usage, is_long_option);
- if (*out < 0) {
- usage("%s passed a negative value %d", option_name.c_str(), *out);
- *out = 0;
- }
-}
-
-void ParseDouble(const std::string& option,
- char after_char,
- double min,
- double max,
- double* parsed_value,
- UsageFn Usage);
-
#if defined(__BIONIC__)
struct Arc4RandomGenerator {
typedef uint32_t result_type;