| 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" |
| (...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 i++; | 275 i++; |
| 276 bool value; | 276 bool value; |
| 277 if (parse_bool_arg(argv[i], &value)) { | 277 if (parse_bool_arg(argv[i], &value)) { |
| 278 flag->setBool(value); | 278 flag->setBool(value); |
| 279 } | 279 } |
| 280 } | 280 } |
| 281 break; | 281 break; |
| 282 case SkFlagInfo::kString_FlagType: | 282 case SkFlagInfo::kString_FlagType: |
| 283 flag->resetStrings(); | 283 flag->resetStrings(); |
| 284 // Add all arguments until another flag is reached. | 284 // Add all arguments until another flag is reached. |
| 285 while (i+1 < argc && !SkStrStartsWith(argv[i+1], '-'
)) { | 285 while (i+1 < argc) { |
| 286 char* end = NULL; |
| 287 (void)strtod(argv[i+1], &end); // Negative numbe
rs aren't flags. |
| 288 if (end == argv[i+1] && SkStrStartsWith(argv[i+1
], '-')) { |
| 289 break; |
| 290 } |
| 286 i++; | 291 i++; |
| 287 flag->append(argv[i]); | 292 flag->append(argv[i]); |
| 288 } | 293 } |
| 289 break; | 294 break; |
| 290 case SkFlagInfo::kInt_FlagType: | 295 case SkFlagInfo::kInt_FlagType: |
| 291 i++; | 296 i++; |
| 292 flag->setInt(atoi(argv[i])); | 297 flag->setInt(atoi(argv[i])); |
| 293 break; | 298 break; |
| 294 case SkFlagInfo::kDouble_FlagType: | 299 case SkFlagInfo::kDouble_FlagType: |
| 295 i++; | 300 i++; |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 364 } | 369 } |
| 365 | 370 |
| 366 } // namespace | 371 } // namespace |
| 367 | 372 |
| 368 bool SkCommandLineFlags::ShouldSkip(const SkTDArray<const char*>& strings, const
char* name) { | 373 bool SkCommandLineFlags::ShouldSkip(const SkTDArray<const char*>& strings, const
char* name) { |
| 369 return ShouldSkipImpl(strings, name); | 374 return ShouldSkipImpl(strings, name); |
| 370 } | 375 } |
| 371 bool SkCommandLineFlags::ShouldSkip(const StringArray& strings, const char* name
) { | 376 bool SkCommandLineFlags::ShouldSkip(const StringArray& strings, const char* name
) { |
| 372 return ShouldSkipImpl(strings, name); | 377 return ShouldSkipImpl(strings, name); |
| 373 } | 378 } |
| OLD | NEW |