| 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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 return false; | 143 return false; |
| 144 } | 144 } |
| 145 | 145 |
| 146 SkFlagInfo* SkCommandLineFlags::gHead; | 146 SkFlagInfo* SkCommandLineFlags::gHead; |
| 147 SkString SkCommandLineFlags::gUsage; | 147 SkString SkCommandLineFlags::gUsage; |
| 148 | 148 |
| 149 void SkCommandLineFlags::SetUsage(const char* usage) { | 149 void SkCommandLineFlags::SetUsage(const char* usage) { |
| 150 gUsage.set(usage); | 150 gUsage.set(usage); |
| 151 } | 151 } |
| 152 | 152 |
| 153 void SkCommandLineFlags::PrintUsage() { |
| 154 SkDebugf("%s", gUsage.c_str()); |
| 155 } |
| 156 |
| 153 // Maximum line length for the help message. | 157 // Maximum line length for the help message. |
| 154 #define LINE_LENGTH 72 | 158 #define LINE_LENGTH 72 |
| 155 | 159 |
| 156 static void print_indented(const SkString& text) { | 160 static void print_indented(const SkString& text) { |
| 157 size_t length = text.size(); | 161 size_t length = text.size(); |
| 158 const char* currLine = text.c_str(); | 162 const char* currLine = text.c_str(); |
| 159 const char* stop = currLine + length; | 163 const char* stop = currLine + length; |
| 160 while (currLine < stop) { | 164 while (currLine < stop) { |
| 161 int lineBreak = SkStrFind(currLine, "\n"); | 165 int lineBreak = SkStrFind(currLine, "\n"); |
| 162 if (lineBreak < 0) { | 166 if (lineBreak < 0) { |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 395 } | 399 } |
| 396 | 400 |
| 397 } // namespace | 401 } // namespace |
| 398 | 402 |
| 399 bool SkCommandLineFlags::ShouldSkip(const SkTDArray<const char*>& strings, const
char* name) { | 403 bool SkCommandLineFlags::ShouldSkip(const SkTDArray<const char*>& strings, const
char* name) { |
| 400 return ShouldSkipImpl(strings, name); | 404 return ShouldSkipImpl(strings, name); |
| 401 } | 405 } |
| 402 bool SkCommandLineFlags::ShouldSkip(const StringArray& strings, const char* name
) { | 406 bool SkCommandLineFlags::ShouldSkip(const StringArray& strings, const char* name
) { |
| 403 return ShouldSkipImpl(strings, name); | 407 return ShouldSkipImpl(strings, name); |
| 404 } | 408 } |
| OLD | NEW |