Commit graph

16 commits

Author SHA1 Message Date
Orvid King
6bb4e40a89 Properly scoped and selected the import of std.traits in std.ascii, so that it is only imported for the 2 functions that use it, toLower and toUpper.
There are also a couple of style changes, namely the ordering of values in an anonymous enum, and the use of only 1 indent level within an array declaration. The final change is to mark toLower and toUpper explicitly as @safe pure nothrow, as these are checked in unittests, but a unittest wouldn't tell you what was causing one of the attributes to not be valid for them.
2013-10-03 10:02:01 -05:00
monarchdodra
287cd873a3 rework toUpper/toLower unittests 2013-09-22 18:28:46 +02:00
monarchdodra
978250b3aa Fix Issue 10717 - std.ascii.toLower and toUpper should return char instead of dchar and avoid me to use a bad cast(char)
It turns out it was incorrectly working for enum types.

New semantics are that enums are also accepted, and their OriginalType is returned.
2013-09-21 11:28:37 +02:00
jmdavis
28c1a8480a Fix issue# 10717.
This makes it so that if you're operating on chars or wchars with
std.ascii functions, you don't have to cast the return values back to
char or wchar, but it still allows you to operate on dchars without
mangling any Unicode values.
2013-07-28 14:37:30 -07:00
Kozzi11
923b79998f Add LetterCase to to! 2013-07-22 15:29:34 +02:00
Kozzi11
d3922ea6ab Add possibility to set letter case in toHexString helper function 2013-07-18 13:23:04 +02:00
Hackerpilot
13a6e6ac5c Converted C-style array declarations to D-style 2013-07-03 00:06:32 +00:00
jmdavis
75352b99b8 Improved module documentation for std.ascii and std.uni. 2011-06-22 21:00:09 -07:00
jmdavis
15fb65f1bb Reverted toAsciiLower and toAsciiUpper to toLower and toUpper. 2011-06-22 19:22:27 -07:00
jmdavis
25b755a843 Reverted isAsciiWhite to isWhite. 2011-06-22 19:20:15 -07:00
jmdavis
34bce538ce Reverted isAsciiLower and isAsciiUpper to isLower and isUpper. 2011-06-22 19:13:45 -07:00
jmdavis
5de7a8646f Adjust some of the std.ascii function names to be more descriptive.
Given that these functions probably aren't used very often, we'd
probably be better of making their names longer and more descriptive as
Lars suggested. So, they're now isPrintible, isGraphical, and
isPunctuation.
2011-06-19 18:46:11 -07:00
jmdavis
2d310e5e20 Changed the names of some of the std.ascii functions.
isWhite, isLower, isUpper, toLower, and toUpper now have Ascii in their
name, which matches what std.unit does with its versions of those
functions. Hopefully, it should also reduce bugs due to using the wrong
function between the ASCII and unicode versions by making the difference
more obvious.
2011-06-19 18:41:00 -07:00
jmdavis
5afac54c02 Renamed oct stuff to octal as suggested. 2011-06-18 03:25:21 -07:00
jmdavis
f8e35a8288 Fixed it so that capwords' unit tests didn't print out deprecation message. 2011-06-14 23:34:39 -07:00
jmdavis
dd3a0c20a2 Created std.ascii to replace std.ctype.
All of the new, properly camelcased functions in std.ctype have been
moved to std.ascii, and std.ctype has been scheduled for deprecation.
2011-06-14 04:06:54 -07:00