|
186 | 186 | Params: c = The character to test. |
187 | 187 | Returns: Whether `c` is a letter or a number (0 .. 9, a .. z, A .. Z). |
188 | 188 | +/ |
| 189 | +pragma(inline, true) |
189 | 190 | bool isAlphaNum(dchar c) @safe pure nothrow @nogc |
190 | 191 | { |
191 | 192 | const hc = c | 0x20; |
@@ -218,6 +219,7 @@ bool isAlphaNum(dchar c) @safe pure nothrow @nogc |
218 | 219 | Params: c = The character to test. |
219 | 220 | Returns: Whether `c` is an ASCII letter (A .. Z, a .. z). |
220 | 221 | +/ |
| 222 | +pragma(inline, true) |
221 | 223 | bool isAlpha(dchar c) @safe pure nothrow @nogc |
222 | 224 | { |
223 | 225 | // Optimizer can turn this into a bitmask operation on 64 bit code |
@@ -250,6 +252,7 @@ bool isAlpha(dchar c) @safe pure nothrow @nogc |
250 | 252 | Params: c = The character to test. |
251 | 253 | Returns: Whether `c` is a lowercase ASCII letter (a .. z). |
252 | 254 | +/ |
| 255 | +pragma(inline, true) |
253 | 256 | bool isLower(dchar c) @safe pure nothrow @nogc |
254 | 257 | { |
255 | 258 | return c >= 'a' && c <= 'z'; |
@@ -282,6 +285,7 @@ bool isLower(dchar c) @safe pure nothrow @nogc |
282 | 285 | Params: c = The character to test. |
283 | 286 | Returns: Whether `c` is an uppercase ASCII letter (A .. Z). |
284 | 287 | +/ |
| 288 | +pragma(inline, true) |
285 | 289 | bool isUpper(dchar c) @safe pure nothrow @nogc |
286 | 290 | { |
287 | 291 | return c <= 'Z' && 'A' <= c; |
@@ -314,6 +318,7 @@ bool isUpper(dchar c) @safe pure nothrow @nogc |
314 | 318 | Params: c = The character to test. |
315 | 319 | Returns: Whether `c` is a digit (0 .. 9). |
316 | 320 | +/ |
| 321 | +pragma(inline, true) |
317 | 322 | bool isDigit(dchar c) @safe pure nothrow @nogc |
318 | 323 | { |
319 | 324 | return '0' <= c && c <= '9'; |
@@ -347,6 +352,7 @@ bool isDigit(dchar c) @safe pure nothrow @nogc |
347 | 352 | Params: c = The character to test. |
348 | 353 | Returns: Whether `c` is a digit in base 8 (0 .. 7). |
349 | 354 | +/ |
| 355 | +pragma(inline, true) |
350 | 356 | bool isOctalDigit(dchar c) @safe pure nothrow @nogc |
351 | 357 | { |
352 | 358 | return c >= '0' && c <= '7'; |
@@ -377,6 +383,7 @@ bool isOctalDigit(dchar c) @safe pure nothrow @nogc |
377 | 383 | Params: c = The character to test. |
378 | 384 | Returns: Whether `c` is a digit in base 16 (0 .. 9, A .. F, a .. f). |
379 | 385 | +/ |
| 386 | +pragma(inline, true) |
380 | 387 | bool isHexDigit(dchar c) @safe pure nothrow @nogc |
381 | 388 | { |
382 | 389 | const hc = c | 0x20; |
@@ -411,6 +418,7 @@ bool isHexDigit(dchar c) @safe pure nothrow @nogc |
411 | 418 | space, tab, vertical tab, form feed, carriage return, and linefeed |
412 | 419 | characters. |
413 | 420 | +/ |
| 421 | +pragma(inline, true) |
414 | 422 | bool isWhite(dchar c) @safe pure nothrow @nogc |
415 | 423 | { |
416 | 424 | return c == ' ' || (c >= 0x09 && c <= 0x0D); |
@@ -447,6 +455,7 @@ bool isWhite(dchar c) @safe pure nothrow @nogc |
447 | 455 | Params: c = The character to test. |
448 | 456 | Returns: Whether `c` is a control character. |
449 | 457 | +/ |
| 458 | +pragma(inline, true) |
450 | 459 | bool isControl(dchar c) @safe pure nothrow @nogc |
451 | 460 | { |
452 | 461 | return c < 0x20 || c == 0x7F; |
@@ -487,6 +496,7 @@ bool isControl(dchar c) @safe pure nothrow @nogc |
487 | 496 | all ASCII characters which are not control characters, letters, digits, or |
488 | 497 | whitespace. |
489 | 498 | +/ |
| 499 | +pragma(inline, true) |
490 | 500 | bool isPunctuation(dchar c) @safe pure nothrow @nogc |
491 | 501 | { |
492 | 502 | return c <= '~' && c >= '!' && !isAlphaNum(c); |
@@ -531,6 +541,7 @@ bool isPunctuation(dchar c) @safe pure nothrow @nogc |
531 | 541 | Returns: Whether or not `c` is a printable character other than the |
532 | 542 | space character. |
533 | 543 | +/ |
| 544 | +pragma(inline, true) |
534 | 545 | bool isGraphical(dchar c) @safe pure nothrow @nogc |
535 | 546 | { |
536 | 547 | return '!' <= c && c <= '~'; |
@@ -567,6 +578,7 @@ bool isGraphical(dchar c) @safe pure nothrow @nogc |
567 | 578 | Returns: Whether or not `c` is a printable character - including the |
568 | 579 | space character. |
569 | 580 | +/ |
| 581 | +pragma(inline, true) |
570 | 582 | bool isPrintable(dchar c) @safe pure nothrow @nogc |
571 | 583 | { |
572 | 584 | return c >= ' ' && c <= '~'; |
|
0 commit comments