Go to the source code of this file.
◆ LINE_LENGTH
◆ ignore_result()
static void ignore_result |
( |
const T & |
| ) |
|
|
static |
◆ parse_bool_arg()
static bool parse_bool_arg |
( |
const char * |
string, |
|
|
bool * |
result |
|
) |
| |
|
static |
Check to see whether string represents a boolean value.
- Parameters
-
string | C style string to parse. |
result | Pointer to a boolean which will be set to the value in the string, if the string represents a boolean. |
boolean | True if the string represents a boolean, false otherwise. |
Definition at line 77 of file CommandLineFlags.cpp.
77 {
78 static const char* trueValues[] = {"1", "TRUE", "true"};
79 if (
string_is_in(
string, trueValues, std::size(trueValues))) {
81 return true;
82 }
83 static const char* falseValues[] = {"0", "FALSE", "false"};
84 if (
string_is_in(
string, falseValues, std::size(falseValues))) {
86 return true;
87 }
88 SkDebugf(
"Parameter \"%s\" not supported.\n",
string);
89 return false;
90}
static bool string_is_in(const char *target, const char *set[], size_t len)
void SK_SPI SkDebugf(const char format[],...) SK_PRINTF_LIKE(1
◆ print_extended_help_for_flag()
static void print_extended_help_for_flag |
( |
const SkFlagInfo * |
flag | ) |
|
|
static |
Definition at line 201 of file CommandLineFlags.cpp.
201 {
205}
static void print_indented(const SkString &text)
static void print_help_for_flag(const SkFlagInfo *flag)
FlutterSemanticsFlag flag
◆ print_help_for_flag()
static void print_help_for_flag |
( |
const SkFlagInfo * |
flag | ) |
|
|
static |
Definition at line 186 of file CommandLineFlags.cpp.
186 {
189 if (shortName.
size() > 0) {
191 }
193 if (
flag->defaultValue().size() > 0) {
194 SkDebugf(
"\tdefault: %s",
flag->defaultValue().c_str());
195 }
200}
const char * c_str() const
◆ print_indented()
static void print_indented |
( |
const SkString & |
text | ) |
|
|
static |
Definition at line 150 of file CommandLineFlags.cpp.
150 {
152 const char* currLine =
text.c_str();
153 const char* stop = currLine +
length;
154 while (currLine < stop) {
155 int lineBreak =
SkStrFind(currLine,
"\n");
156 if (lineBreak < 0) {
157 lineBreak = static_cast<int>(strlen(currLine));
158 }
160
161
163 while (spaceIndex > 0 && currLine[spaceIndex] != ' ') {
164 spaceIndex--;
165 }
166 int gap;
167 if (0 == spaceIndex) {
168
170 gap = 0;
171 } else {
172
173 gap = 1;
174 }
175 SkDebugf(
" %.*s\n", spaceIndex, currLine);
176 currLine += spaceIndex + gap;
177 } else {
178
179 lineBreak++;
180 SkDebugf(
" %.*s", lineBreak, currLine);
181 currLine += lineBreak;
182 }
183 }
184}
static int SkStrFind(const char string[], const char substring[])
◆ string_is_in()
static bool string_is_in |
( |
const char * |
target, |
|
|
const char * |
set[], |
|
|
size_t |
len |
|
) |
| |
|
static |
Definition at line 61 of file CommandLineFlags.cpp.
61 {
62 for (
size_t i = 0; i <
len; i++) {
63 if (0 == strcmp(
target, set[i])) {
64 return true;
65 }
66 }
67 return false;
68}