From 1a4e2892b64e0235728f98d4b16f4dd673edf480 Mon Sep 17 00:00:00 2001 From: jmdavis Date: Wed, 23 May 2012 00:49:26 -0700 Subject: [PATCH] Removed deprecated functions which were to be removed in May 2012. --- std/array.d | 29 ----------- std/datetime.d | 76 --------------------------- std/file.d | 138 ------------------------------------------------- 3 files changed, 243 deletions(-) diff --git a/std/array.d b/std/array.d index e040d5b709c..fa2aa2bd316 100644 --- a/std/array.d +++ b/std/array.d @@ -913,23 +913,6 @@ unittest // bugzilla 6874 assert(GC.addrOf(&b[0]) == GC.addrOf(&b[$-1])); } -/++ - $(RED Deprecated. It will be removed in May 2012. - Please use $(LREF insertInPlace) instead.) - - Same as $(XREF array, insertInPlace). - +/ -deprecated void insert(T, Range)(ref T[] array, size_t pos, Range stuff) -if (isInputRange!Range && is(ElementEncodingType!Range : T)) -{ - insertInPlace(array, pos, stuff); -} - -/// Ditto -void insert(T)(ref T[] array, size_t pos, T stuff) -{ - insertInPlace(array, pos, stuff); -} /++ Returns whether the $(D front)s of $(D lhs) and $(D rhs) both refer to the @@ -1732,18 +1715,6 @@ unittest testStr!(dstring, dstring)(); } -/++ - $(RED Deprecated. It will be removed in May 2012. - Please use $(LREF replaceInPlace) instead.) - - Same as $(XREF array, replaceInPlace). - +/ -deprecated void replace(T, Range)(ref T[] array, size_t from, size_t to, Range stuff) -if (isDynamicArray!Range && is(ElementType!Range : T)) -{ - replaceInPlace(array, from, to, stuff); -} - /++ Replaces the first occurrence of $(D from) with $(D to) in $(D a). Returns a new array without changing the contents of $(D subject), or the original diff --git a/std/datetime.d b/std/datetime.d index 4701fedae32..534f151e809 100644 --- a/std/datetime.d +++ b/std/datetime.d @@ -7955,15 +7955,6 @@ assert(SysTime(DateTime(-4, 1, 5, 0, 0, 2), assert(0, "format() threw."); } - /++ - $(RED Deprecated. It will be removed in May 2012. - Please use toISOExtString instead.) - +/ - deprecated string toISOExtendedString() const nothrow - { - return toISOExtString(); - } - unittest { version(testStdDateTime) @@ -8513,16 +8504,6 @@ assert(SysTime.fromISOExtString("2010-07-04T07:06:12+8:00") == throw new DateTimeException(format("Invalid ISO Extended String: %s", isoExtString)); } - /++ - $(RED Deprecated. It will be removed in May 2012. - Please use fromISOExtString instead.) - +/ - deprecated static SysTime fromISOExtendedString(S)(in S isoExtString, immutable TimeZone tz = null) - if(isSomeString!(S)) - { - return fromISOExtString!string(isoExtString, tz); - } - unittest { version(testStdDateTime) @@ -12682,15 +12663,6 @@ assert(Date(-4, 1, 5).toISOExtString() == "-0004-01-05"); assert(0, "format() threw."); } - /++ - $(RED Deprecated. It will be removed in May 2012. - Please use toISOExtString instead.) - +/ - deprecated string toISOExtendedString() const nothrow - { - return toISOExtString(); - } - unittest { version(testStdDateTime) @@ -13002,16 +12974,6 @@ assert(Date.fromISOExtString(" 2010-07-04 ") == Date(2010, 7, 4)); return Date(to!short(year), to!ubyte(month), to!ubyte(day)); } - /++ - $(RED Deprecated. It will be removed in May 2012. - Please use fromISOExtString instead.) - +/ - deprecated static Date fromISOExtendedString(S)(in S isoExtString) - if(isSomeString!(S)) - { - return fromISOExtString!string(isoExtString); - } - unittest { version(testStdDateTime) @@ -14405,15 +14367,6 @@ assert(TimeOfDay(12, 30, 33).toISOExtString() == "123033"); assert(0, "format() threw."); } - /++ - $(RED Deprecated. It will be removed in May 2012. - Please use toISOExtString instead.) - +/ - deprecated string toISOExtendedString() const nothrow - { - return toISOExtString(); - } - unittest { version(testStdDateTime) @@ -14622,16 +14575,6 @@ assert(TimeOfDay.fromISOExtString(" 12:30:33 ") == TimeOfDay(12, 30, 33)); return TimeOfDay(to!int(hours), to!int(minutes), to!int(seconds)); } - /++ - $(RED Deprecated. It will be removed in May 2012. - Please use fromISOExtString instead.) - +/ - deprecated static TimeOfDay fromISOExtendedString(S)(in S isoExtString) - if(isSomeString!(S)) - { - return fromISOExtString!string(isoExtString); - } - unittest { version(testStdDateTime) @@ -17592,15 +17535,6 @@ assert(DateTime(Date(-4, 1, 5), TimeOfDay(0, 0, 2)).toISOExtString() == assert(0, "format() threw."); } - /++ - $(RED Deprecated. It will be removed in May 2012. - Please use toISOExtString instead.) - +/ - deprecated string toISOExtendedString() const nothrow - { - return toISOExtString(); - } - unittest { version(testStdDateTime) @@ -17867,16 +17801,6 @@ assert(DateTime.fromISOExtString(" 2010-07-04T07:06:12 ") == return DateTime(date, tod); } - /++ - $(RED Deprecated. It will be removed in May 2012. - Please use fromISOExtString instead.) - +/ - deprecated static DateTime fromISOExtendedString(S)(in S isoExtString) - if(isSomeString!(S)) - { - return fromISOExtString!string(isoExtString); - } - unittest { version(testStdDateTime) diff --git a/std/file.d b/std/file.d index 46a1f29958f..8cde27a4d4c 100644 --- a/std/file.d +++ b/std/file.d @@ -757,56 +757,6 @@ version(Windows) unittest } } -/++ - $(RED Deprecated. It will be removed in May 2012. - Please use the $(D getTimes) with two arguments instead.) - - $(BLUE This function is Posix-Only.) - - Get file status change time, acces time, and modification times - of file $(D name). - - $(D getTimes) is the same on both Windows and Posix, but it is not - possible to get the file creation time on Posix systems, so - $(D getTimes) cannot give you the file creation time. $(D getTimesWin) - does the same thing on Windows as $(D getTimes) except that it also gives - you the file creation time. This function was created to do the same - thing that the old, 3 argument $(D getTimes) was doing on Posix - giving - you the time that the file status last changed - but ultimately, that's - not really very useful, and we don't like having functions which are - OS-specific when we can reasonably avoid it. So, this function is being - deprecated. You can use $(D DirEntry)'s $(D statBuf) property if you - really want to get at that information (along with all of the other - OS-specific stuff that $(D stat) gives you). - - Params: - name = File name to get times for. - fileStatusChangeTime = Time the file's status was last changed. - fileAccessTime = Time the file was last accessed. - fileModificationTime = Time the file was last modified. - - Throws: - $(D FileException) on error. - +/ -version(StdDdoc) deprecated void getTimesPosix(in char[] name, - out SysTime fileStatusChangeTime, - out SysTime fileAccessTime, - out SysTime fileModificationTime); -else version(Posix) deprecated void getTimesPosix(C)(in C[] name, - out SysTime fileStatusChangeTime, - out SysTime fileAccessTime, - out SysTime fileModificationTime) - if(is(Unqual!C == char)) -{ - struct_stat64 statbuf = void; - - cenforce(stat64(toStringz(name), &statbuf) == 0, name); - - fileStatusChangeTime = SysTime(unixTimeToStdTime(statbuf.st_ctime)); - fileAccessTime = SysTime(unixTimeToStdTime(statbuf.st_atime)); - fileModificationTime = SysTime(unixTimeToStdTime(statbuf.st_mtime)); -} - /++ Returns the time that the given file was last modified. @@ -1076,28 +1026,6 @@ unittest } -/++ - $(RED Deprecated. It will be removed in May 2012. - Please use $(D attrIsDir) instead.) - - Returns whether the given file attributes are for a directory. - - Params: - attributes = The file attributes. - +/ -deprecated @property bool isDir(uint attributes) nothrow -{ - version(Windows) - { - return (attributes & FILE_ATTRIBUTE_DIRECTORY) != 0; - } - else version(Posix) - { - return (attributes & S_IFMT) == S_IFDIR; - } -} - - /++ Returns whether the given file attributes are for a directory. @@ -1211,38 +1139,6 @@ unittest } -/++ - $(RED Deprecated. It will be removed in May 2012. - Please use $(D attrIsFile) instead.) - - Returns whether the given file attributes are for a file. - - On Windows, if a file is not a directory, it's a file. So, - either $(D isFile) or $(D isDir) will return $(D true) for any given file. - - On Posix systems, if $(D isFile) is $(D true), that indicates that the file - is a regular file (e.g. not a block not device). So, on Posix systems, - it's possible for both $(D isFile) and $(D isDir) to be $(D false) for a - particular file (in which case, it's a special file). If a file is a special - file, you can use the attributes to check what type of special - file it is (see the man page for $(D stat) for more information). - - Params: - attributes = The file attributes. - +/ -deprecated @property bool isFile(uint attributes) nothrow -{ - version(Windows) - { - return (attributes & FILE_ATTRIBUTE_DIRECTORY) == 0; - } - else version(Posix) - { - return (attributes & S_IFMT) == S_IFREG; - } -} - - /++ Returns whether the given file attributes are for a file. @@ -1403,27 +1299,6 @@ unittest } -/++ - $(RED Deprecated. It will be removed in May 2012. - Please use $(D attrIsSymlink) instead.) - - Returns whether the given file attributes are for a symbolic link. - - On Windows, return $(D true) when the file is either a symbolic link or a - junction point. - - Params: - attributes = The file attributes. - +/ -deprecated @property bool isSymLink(uint attributes) nothrow -{ - version(Windows) - return (attributes & FILE_ATTRIBUTE_REPARSE_POINT) != 0; - else version(Posix) - return (attributes & S_IFMT) == S_IFLNK; -} - - /++ Returns whether the given file attributes are for a symbolic link. @@ -1823,19 +1698,6 @@ assert(!de2.isFile); +/ @property SysTime timeCreated() const; - - /++ - $(RED Deprecated. It will be removed in May 2012. It will not be - replaced. You can use $(D attributes) to get at this - information if you need it.) - - $(BLUE This function is Posix-Only.) - - Returns the last time that the status of file represented by this - $(D DirEntry) was changed (i.e. owner, group, link count, mode, etc.). - +/ - deprecated @property SysTime timeStatusChanged(); - /++ Returns the time that the file represented by this $(D DirEntry) was last accessed.