Chromium Code Reviews| Index: tools/flags/SkCommandLineFlags.h |
| diff --git a/tools/flags/SkCommandLineFlags.h b/tools/flags/SkCommandLineFlags.h |
| index 08fd3a2ba5974447489db7f5e18712bbde71e7cc..9c0bdcd786dfb189729b8c824011a8bb5fe7f0dc 100644 |
| --- a/tools/flags/SkCommandLineFlags.h |
| +++ b/tools/flags/SkCommandLineFlags.h |
| @@ -132,6 +132,10 @@ public: |
| fStrings.push_back().set(string); |
| } |
| + void append(const char* string, size_t length) { |
| + fStrings.push_back().set(string, length); |
| + } |
| + |
| SkTArray<SkString> fStrings; |
| friend class SkFlagInfo; |
| @@ -227,18 +231,7 @@ public: |
| static bool CreateStringFlag(const char* name, const char* shortName, |
|
epoger
2013/04/23 16:54:13
Please add documentation for this (and maybe other
scroggo
2013/04/24 18:42:36
Done.
|
| SkCommandLineFlags::StringArray* pStrings, |
| - const char* defaultValue, const char* helpString) { |
| - SkFlagInfo* info = SkNEW_ARGS(SkFlagInfo, (name, shortName, kString_FlagType, helpString)); |
| - info->fDefaultString.set(defaultValue); |
| - |
| - info->fStrings = pStrings; |
| - info->fStrings->reset(); |
| - // If default is "", leave the array empty. |
| - if (info->fDefaultString.size() > 0) { |
| - info->fStrings->append(defaultValue); |
| - } |
| - return true; |
| - } |
| + const char* defaultValue, const char* helpString); |
| static bool CreateIntFlag(const char* name, int32_t* pInt, |
| int32_t defaultValue, const char* helpString) { |