Skip to content

Commit

Permalink
Merge pull request #328 from jmdavis/deprecations
Browse files Browse the repository at this point in the history
Applied deprecations for November 2011.
  • Loading branch information
andralex committed Dec 4, 2011
2 parents 62349ee + afb5a1c commit 6ac45d8
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 46 deletions.
12 changes: 6 additions & 6 deletions std/array.d
Expand Up @@ -575,7 +575,7 @@ unittest
}

/+
Commented out until the insert which is scheduled for deprecation is removed.
Commented out until the insert which has been deprecated has been removed.
I'd love to just remove it in favor of insertInPlace, but then code would then
use this version of insert and silently break. So, it's here so that it can
be used once insert has not only been deprecated but removed, but until then,
Expand Down Expand Up @@ -923,12 +923,12 @@ unittest
}

/++
$(RED Scheduled for deprecation in November 2011.
$(RED Deprecated. It will be removed in May 2012.
Please use $(LREF insertInPlace) instead.)
Same as $(XREF array, insertInPlace).
+/
void insert(T, Range)(ref T[] array, size_t pos, Range stuff)
deprecated void insert(T, Range)(ref T[] array, size_t pos, Range stuff)
if (isInputRange!Range && is(ElementEncodingType!Range : T))
{
insertInPlace(array, pos, stuff);
Expand Down Expand Up @@ -1503,7 +1503,7 @@ unittest
}

/+
Commented out until the replace which is scheduled for deprecation is removed.
Commented out until the replace which has been deprecated has been removed.
I'd love to just remove it in favor of replaceInPlace, but then code would then
use this version of replaceInPlace and silently break. So, it's here so that it
can be used once replace has not only been deprecated but removed, but
Expand Down Expand Up @@ -1742,12 +1742,12 @@ unittest
}

/++
$(RED Scheduled for deprecation in November 2011.
$(RED Deprecated. It will be removed in May 2012.
Please use $(LREF replaceInPlace) instead.)
Same as $(XREF array, replaceInPlace).
+/
void replace(T, Range)(ref T[] array, size_t from, size_t to, Range stuff)
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);
Expand Down
44 changes: 28 additions & 16 deletions std/datetime.d
Expand Up @@ -7949,10 +7949,13 @@ assert(SysTime(DateTime(-4, 1, 5, 0, 0, 2),
}

/++
$(RED Scheduled for deprecation in November 2011.
$(RED Deprecated. It will be removed in May 2012.
Please use toISOExtString instead.)
+/
alias toISOExtString toISOExtendedString;
deprecated string toISOExtendedString() const nothrow
{
return toISOExtString();
}

unittest
{
Expand Down Expand Up @@ -8504,10 +8507,10 @@ assert(SysTime.fromISOExtString("2010-07-04T07:06:12+8:00") ==
}

/++
$(RED Scheduled for deprecation in November 2011.
$(RED Deprecated. It will be removed in May 2012.
Please use fromISOExtString instead.)
+/
static SysTime fromISOExtendedString(S)(in S isoExtString, immutable TimeZone tz = null)
deprecated static SysTime fromISOExtendedString(S)(in S isoExtString, immutable TimeZone tz = null)
if(isSomeString!(S))
{
return fromISOExtString!string(isoExtString, tz);
Expand Down Expand Up @@ -12670,10 +12673,13 @@ assert(Date(-4, 1, 5).toISOExtString() == "-0004-01-05");
}

/++
$(RED Scheduled for deprecation in November 2011.
$(RED Deprecated. It will be removed in May 2012.
Please use toISOExtString instead.)
+/
alias toISOExtString toISOExtendedString;
deprecated string toISOExtendedString() const nothrow
{
return toISOExtString();
}

unittest
{
Expand Down Expand Up @@ -12987,10 +12993,10 @@ assert(Date.fromISOExtString(" 2010-07-04 ") == Date(2010, 7, 4));
}

/++
$(RED Scheduled for deprecation in November 2011.
$(RED Deprecated. It will be removed in May 2012.
Please use fromISOExtString instead.)
+/
static Date fromISOExtendedString(S)(in S isoExtString)
deprecated static Date fromISOExtendedString(S)(in S isoExtString)
if(isSomeString!(S))
{
return fromISOExtString!string(isoExtString);
Expand Down Expand Up @@ -14390,10 +14396,13 @@ assert(TimeOfDay(12, 30, 33).toISOExtString() == "123033");
}

/++
$(RED Scheduled for deprecation in November 2011.
$(RED Deprecated. It will be removed in May 2012.
Please use toISOExtString instead.)
+/
alias toISOExtString toISOExtendedString;
deprecated string toISOExtendedString() const nothrow
{
return toISOExtString();
}

unittest
{
Expand Down Expand Up @@ -14604,10 +14613,10 @@ assert(TimeOfDay.fromISOExtString(" 12:30:33 ") == TimeOfDay(12, 30, 33));
}

/++
$(RED Scheduled for deprecation in November 2011.
$(RED Deprecated. It will be removed in May 2012.
Please use fromISOExtString instead.)
+/
static TimeOfDay fromISOExtendedString(S)(in S isoExtString)
deprecated static TimeOfDay fromISOExtendedString(S)(in S isoExtString)
if(isSomeString!(S))
{
return fromISOExtString!string(isoExtString);
Expand Down Expand Up @@ -17571,10 +17580,13 @@ assert(DateTime(Date(-4, 1, 5), TimeOfDay(0, 0, 2)).toISOExtString() ==
}

/++
$(RED Scheduled for deprecation in November 2011.
$(RED Deprecated. It will be removed in May 2012.
Please use toISOExtString instead.)
+/
alias toISOExtString toISOExtendedString;
deprecated string toISOExtendedString() const nothrow
{
return toISOExtString();
}

unittest
{
Expand Down Expand Up @@ -17843,10 +17855,10 @@ assert(DateTime.fromISOExtString(" 2010-07-04T07:06:12 ") ==
}

/++
$(RED Scheduled for deprecation in November 2011.
$(RED Deprecated. It will be removed in May 2012.
Please use fromISOExtString instead.)
+/
static DateTime fromISOExtendedString(S)(in S isoExtString)
deprecated static DateTime fromISOExtendedString(S)(in S isoExtString)
if(isSomeString!(S))
{
return fromISOExtString!string(isoExtString);
Expand Down
54 changes: 30 additions & 24 deletions std/file.d
Expand Up @@ -899,8 +899,8 @@ version(Windows) unittest
}

/++
$(RED Scheduled for deprecation in November 2011. Please use the
$(D getTimes) with two arguments instead.)
$(RED Deprecated. It will be removed in May 2012.
Please use the $(D getTimes) with two arguments instead.)
$(BLUE This function is Posix-Only.)
Expand Down Expand Up @@ -929,14 +929,14 @@ version(Windows) unittest
Throws:
$(D FileException) on error.
+/
version(StdDdoc) void getTimesPosix(in char[] name,
out SysTime fileStatusChangeTime,
out SysTime fileAccessTime,
out SysTime fileModificationTime);
else version(Posix) void getTimesPosix(C)(in C[] name,
out SysTime fileStatusChangeTime,
out SysTime fileAccessTime,
out SysTime fileModificationTime)
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;
Expand Down Expand Up @@ -1266,19 +1266,22 @@ unittest
$(RED Deprecated. It will be removed in February 2012. Please use
$(D isDir) instead.)
+/
deprecated alias isDir isdir;
deprecated @property bool isdir(in char[] name)
{
return name.isDir;
}


/++
$(RED Scheduled for deprecation in November 2011.
$(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.
+/
@property bool isDir(uint attributes) nothrow
deprecated @property bool isDir(uint attributes) nothrow
{
version(Windows)
{
Expand Down Expand Up @@ -1407,11 +1410,14 @@ unittest
$(RED Deprecated. It will be removed in February 2012. Please use
$(D isDir) instead.)
+/
deprecated alias isFile isfile;
deprecated @property bool isfile(in char[] name)
{
return name.isFile;
}


/++
$(RED Scheduled for deprecation in November 2011.
$(RED Deprecated. It will be removed in May 2012.
Please use $(D attrIsFile) instead.)
Returns whether the given file attributes are for a file.
Expand All @@ -1429,7 +1435,7 @@ deprecated alias isFile isfile;
Params:
attributes = The file attributes.
+/
@property bool isFile(uint attributes) nothrow
deprecated @property bool isFile(uint attributes) nothrow
{
version(Windows)
{
Expand Down Expand Up @@ -1603,7 +1609,7 @@ unittest


/++
$(RED Scheduled for deprecation in November 2011.
$(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.
Expand All @@ -1614,7 +1620,7 @@ unittest
Params:
attributes = The file attributes.
+/
@property bool isSymLink(uint attributes) nothrow
deprecated @property bool isSymLink(uint attributes) nothrow
{
version(Windows)
return (attributes & FILE_ATTRIBUTE_REPARSE_POINT) != 0;
Expand Down Expand Up @@ -2084,7 +2090,7 @@ assert(!de2.isFile);


/++
$(RED Scheduled for deprecation in November 2011. It will not be
$(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.)
Expand All @@ -2093,7 +2099,7 @@ assert(!de2.isFile);
Returns the last time that the status of file represented by this
$(D DirEntry) was changed (i.e. owner, group, link count, mode, etc.).
+/
@property SysTime timeStatusChanged();
deprecated @property SysTime timeStatusChanged();

/++
$(RED Deprecated. It will be removed in February 2012. Please use
Expand Down Expand Up @@ -2596,7 +2602,7 @@ unittest


/******************************************************
* $(RED Scheduled for deprecation in November 2011.
* $(RED Scheduled for deprecation.
* Please use $(D dirEntries) instead.)
*
* For each file and directory $(D DirEntry) in $(D pathname[])
Expand Down Expand Up @@ -3598,7 +3604,7 @@ unittest


/++
$(RED Scheduled for deprecation in November 2011.
$(RED Scheduled for deprecation.
Please use $(D dirEntries) instead.)
Returns the contents of the given directory.
Expand Down Expand Up @@ -3646,7 +3652,7 @@ unittest


/++
$(RED Scheduled for deprecation in November 2011.
$(RED Scheduled for deprecation.
Please use $(D dirEntries) instead.)
Returns all the files in the directory and its sub-directories
Expand Down Expand Up @@ -3730,7 +3736,7 @@ string[] listDir(C, U)(in C[] pathname, U filter, bool followSymlink = true)
}

/******************************************************
* $(RED Scheduled for deprecation in November 2011.
* $(RED Scheduled for deprecation.
* Please use $(D dirEntries) instead.)
*
* For each file and directory name in pathname[],
Expand Down

0 comments on commit 6ac45d8

Please sign in to comment.