| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #include "SkCommandLineFlags.h" | 8 #include "SkCommandLineFlags.h" |
| 9 #include "SkTDArray.h" | 9 #include "SkTDArray.h" |
| 10 #include "SkTSort.h" | 10 #include "SkTSort.h" |
| 11 | 11 |
| 12 #include <stdlib.h> |
| 13 |
| 12 DEFINE_bool(undefok, false, "Silently ignore unknown flags instead of crashing."
); | 14 DEFINE_bool(undefok, false, "Silently ignore unknown flags instead of crashing."
); |
| 13 | 15 |
| 14 template <typename T> static void ignore_result(const T&) {} | 16 template <typename T> static void ignore_result(const T&) {} |
| 15 | 17 |
| 16 bool SkFlagInfo::CreateStringFlag(const char* name, const char* shortName, | 18 bool SkFlagInfo::CreateStringFlag(const char* name, const char* shortName, |
| 17 SkCommandLineFlags::StringArray* pStrings, | 19 SkCommandLineFlags::StringArray* pStrings, |
| 18 const char* defaultValue, const char* helpStri
ng) { | 20 const char* defaultValue, const char* helpStri
ng) { |
| 19 SkFlagInfo* info = SkNEW_ARGS(SkFlagInfo, (name, shortName, kString_FlagType
, helpString)); | 21 SkFlagInfo* info = SkNEW_ARGS(SkFlagInfo, (name, shortName, kString_FlagType
, helpString)); |
| 20 info->fDefaultString.set(defaultValue); | 22 info->fDefaultString.set(defaultValue); |
| 21 | 23 |
| (...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 375 } | 377 } |
| 376 | 378 |
| 377 } // namespace | 379 } // namespace |
| 378 | 380 |
| 379 bool SkCommandLineFlags::ShouldSkip(const SkTDArray<const char*>& strings, const
char* name) { | 381 bool SkCommandLineFlags::ShouldSkip(const SkTDArray<const char*>& strings, const
char* name) { |
| 380 return ShouldSkipImpl(strings, name); | 382 return ShouldSkipImpl(strings, name); |
| 381 } | 383 } |
| 382 bool SkCommandLineFlags::ShouldSkip(const StringArray& strings, const char* name
) { | 384 bool SkCommandLineFlags::ShouldSkip(const StringArray& strings, const char* name
) { |
| 383 return ShouldSkipImpl(strings, name); | 385 return ShouldSkipImpl(strings, name); |
| 384 } | 386 } |
| OLD | NEW |