| 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 #ifndef SK_COMMAND_LINE_FLAGS_H | 8 #ifndef SK_COMMAND_LINE_FLAGS_H |
| 9 #define SK_COMMAND_LINE_FLAGS_H | 9 #define SK_COMMAND_LINE_FLAGS_H |
| 10 | 10 |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 */ | 130 */ |
| 131 bool contains(const char* string) const { | 131 bool contains(const char* string) const { |
| 132 for (int i = 0; i < fStrings.count(); i++) { | 132 for (int i = 0; i < fStrings.count(); i++) { |
| 133 if (fStrings[i].equals(string)) { | 133 if (fStrings[i].equals(string)) { |
| 134 return true; | 134 return true; |
| 135 } | 135 } |
| 136 } | 136 } |
| 137 return false; | 137 return false; |
| 138 } | 138 } |
| 139 | 139 |
| 140 void set(int i, const char* str) { |
| 141 fStrings[i].set(str); |
| 142 } |
| 143 |
| 140 private: | 144 private: |
| 141 void reset() { fStrings.reset(); } | 145 void reset() { fStrings.reset(); } |
| 142 | 146 |
| 143 void append(const char* string) { | 147 void append(const char* string) { |
| 144 fStrings.push_back().set(string); | 148 fStrings.push_back().set(string); |
| 145 } | 149 } |
| 146 | 150 |
| 147 void append(const char* string, size_t length) { | 151 void append(const char* string, size_t length) { |
| 148 fStrings.push_back().set(string, length); | 152 fStrings.push_back().set(string, length); |
| 149 } | 153 } |
| (...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 437 double* fDoubleValue; | 441 double* fDoubleValue; |
| 438 double fDefaultDouble; | 442 double fDefaultDouble; |
| 439 SkCommandLineFlags::StringArray* fStrings; | 443 SkCommandLineFlags::StringArray* fStrings; |
| 440 // Both for the help string and in case fStrings is empty. | 444 // Both for the help string and in case fStrings is empty. |
| 441 SkString fDefaultString; | 445 SkString fDefaultString; |
| 442 | 446 |
| 443 // In order to keep a linked list. | 447 // In order to keep a linked list. |
| 444 SkFlagInfo* fNext; | 448 SkFlagInfo* fNext; |
| 445 }; | 449 }; |
| 446 #endif // SK_COMMAND_LINE_FLAGS_H | 450 #endif // SK_COMMAND_LINE_FLAGS_H |
| OLD | NEW |