mirror of
https://github.com/dlang/phobos.git
synced 2025-04-29 22:50:38 +03:00
Merge pull request #5628 from jmdavis/deprecations
Move some deprecations along merged-on-behalf-of: Sebastian Wilzbach <sebi.wilzbach@gmail.com>
This commit is contained in:
commit
be29450475
4 changed files with 22 additions and 153 deletions
|
@ -5098,30 +5098,6 @@ if (isRandomAccessRange!Range && hasLength!Range)
|
|||
private Range _r;
|
||||
private bool _empty;
|
||||
|
||||
// Explicitly undocumented. It will be removed in June 2017. @@@DEPRECATED_2017-06@@@
|
||||
deprecated("Private variable. Use front()")
|
||||
@property size_t[] indices() pure nothrow @nogc @safe { return _indices; }
|
||||
|
||||
// Explicitly undocumented. It will be removed in June 2017. @@@DEPRECATED_2017-06@@@
|
||||
deprecated("Private variable. Don't set it manually")
|
||||
@property void indices(size_t[] indices) pure nothrow @nogc @safe { _indices = indices; }
|
||||
|
||||
// Explicitly undocumented. It will be removed in June 2017. @@@DEPRECATED_2017-06@@@
|
||||
deprecated("Private variable. Use front()")
|
||||
@property size_t[] state() pure nothrow @nogc @safe { return _state; }
|
||||
|
||||
// Explicitly undocumented. It will be removed in June 2017. @@@DEPRECATED_2017-06@@@
|
||||
deprecated("Private variable. Don't set it manually")
|
||||
@property void state(size_t[] state) pure nothrow @nogc @safe { state = state; }
|
||||
|
||||
// Explicitly undocumented. It will be removed in June 2017. @@@DEPRECATED_2017-06@@@
|
||||
deprecated("Private variable. Access will be forbidden.")
|
||||
@property Range r() pure nothrow @nogc @safe { return _r; }
|
||||
|
||||
// Explicitly undocumented. It will be removed in June 2017. @@@DEPRECATED_2017-06@@@
|
||||
deprecated("Private variable. Don't set it manually")
|
||||
@property void r(Range r) pure nothrow @nogc @safe { _r = r; }
|
||||
|
||||
///
|
||||
this(Range r)
|
||||
{
|
||||
|
|
|
@ -3991,7 +3991,7 @@ if (isInputRange!Source && isSomeChar!(ElementType!Source) &&
|
|||
string text(T...)(T args)
|
||||
if (T.length > 0) { return textImpl!string(args); }
|
||||
|
||||
// @@@DEPRECATED_2017-06@@@
|
||||
// @@@DEPRECATED_2018-06@@@
|
||||
deprecated("Calling `text` with 0 arguments is deprecated")
|
||||
string text(T...)(T args)
|
||||
if (T.length == 0) { return textImpl!string(args); }
|
||||
|
@ -4000,7 +4000,7 @@ if (T.length == 0) { return textImpl!string(args); }
|
|||
wstring wtext(T...)(T args)
|
||||
if (T.length > 0) { return textImpl!wstring(args); }
|
||||
|
||||
// @@@DEPRECATED_2017-06@@@
|
||||
// @@@DEPRECATED_2018-06@@@
|
||||
deprecated("Calling `wtext` with 0 arguments is deprecated")
|
||||
wstring wtext(T...)(T args)
|
||||
if (T.length == 0) { return textImpl!wstring(args); }
|
||||
|
@ -4017,7 +4017,7 @@ if (T.length > 0) { return textImpl!dstring(args); }
|
|||
assert(dtext(42, ' ', 1.5, ": xyz") == "42 1.5: xyz"d);
|
||||
}
|
||||
|
||||
// @@@DEPRECATED_2017-06@@@
|
||||
// @@@DEPRECATED_2018-06@@@
|
||||
deprecated("Calling `dtext` with 0 arguments is deprecated")
|
||||
dstring dtext(T...)(T args)
|
||||
if (T.length == 0) { return textImpl!dstring(args); }
|
||||
|
|
|
@ -7785,11 +7785,12 @@ public:
|
|||
generated +HH:MM or -HH:MM for the time zone when it was not
|
||||
$(REF LocalTime,std,datetime,timezone) or
|
||||
$(REF UTC,std,datetime,timezone), which is not in conformance with
|
||||
ISO 9601 for the non-extended string format. This has now been
|
||||
ISO 8601 for the non-extended string format. This has now been
|
||||
fixed. However, for now, fromISOString will continue to accept the
|
||||
extended format for the time zone so that any code which has been
|
||||
writing out the result of toISOString to read in later will continue
|
||||
to work.)
|
||||
to work. The current behavior will be kept until July 2019 at which
|
||||
point, fromISOString will be fixed to be standards compliant.)
|
||||
+/
|
||||
string toISOString() @safe const nothrow
|
||||
{
|
||||
|
@ -8248,11 +8249,12 @@ public:
|
|||
$(LREF toISOExtString) and generated +HH:MM or -HH:MM for the time
|
||||
zone when it was not $(REF LocalTime,std,datetime,timezone) or
|
||||
$(REF UTC,std,datetime,timezone), which is not in conformance with
|
||||
ISO 9601 for the non-extended string format. This has now been
|
||||
ISO 8601 for the non-extended string format. This has now been
|
||||
fixed. However, for now, fromISOString will continue to accept the
|
||||
extended format for the time zone so that any code which has been
|
||||
writing out the result of toISOString to read in later will continue
|
||||
to work.)
|
||||
to work. The current behavior will be kept until July 2019 at which
|
||||
point, fromISOString will be fixed to be standards compliant.)
|
||||
|
||||
Params:
|
||||
isoString = A string formatted in the ISO format for dates and times.
|
||||
|
@ -8453,16 +8455,16 @@ public:
|
|||
test("20101222T172201.0000000+0130", SysTime(DateTime(2010, 12, 22, 17, 22, 01), east90));
|
||||
test("20101222T172201.45+0800", SysTime(DateTime(2010, 12, 22, 17, 22, 01), hnsecs(4_500_000), east480));
|
||||
|
||||
// @@@DEPRECATED_2017-07@@@
|
||||
// @@@DEPRECATED_2019-07@@@
|
||||
// This isn't deprecated per se, but that text will make it so that it
|
||||
// pops up when deprecations are moved along around July 2017. At that
|
||||
// time, the notice on the documentation should be removed, and we may
|
||||
// or may not change the behavior of fromISOString to no longer accept
|
||||
// ISO extended time zones (the concern being that programs will have
|
||||
// written out strings somewhere to read in again that they'll still be
|
||||
// reading in for years to come and may not be able to fix, even if the
|
||||
// code is fixed). If/when we do change the behavior, these tests will
|
||||
// start failing and will need to be updated accordingly.
|
||||
// pops up when deprecations are moved along around July 2019. At that
|
||||
// time, we will update fromISOString so that it is conformant with ISO
|
||||
// 8601, and it will no longer accept ISO extended time zones (it does
|
||||
// currently because of issue #15654 - toISOString used to incorrectly
|
||||
// use the ISO extended time zone format). These tests will then start
|
||||
// failing will need to be updated accordingly. Also, the notes about
|
||||
// this issue in toISOString and fromISOString's documentation will need
|
||||
// to be removed.
|
||||
test("20101222T172201-01:00", SysTime(DateTime(2010, 12, 22, 17, 22, 01), west60));
|
||||
test("20101222T172201-01:30", SysTime(DateTime(2010, 12, 22, 17, 22, 01), west90));
|
||||
test("20101222T172201-08:00", SysTime(DateTime(2010, 12, 22, 17, 22, 01), west480));
|
||||
|
|
|
@ -142,43 +142,7 @@ public:
|
|||
return dur!"hnsecs"(utcToTZ(stdTime) - stdTime);
|
||||
}
|
||||
|
||||
// @@@DEPRECATED_2017-07@@@
|
||||
/++
|
||||
$(RED Deprecated. Use either PosixTimeZone.getTimeZone or
|
||||
WindowsTimeZone.getTimeZone. ($(LREF parseTZConversions) can be
|
||||
used to convert time zone names if necessary). Microsoft changes
|
||||
their time zones too often for us to compile the conversions into
|
||||
Phobos and have them be properly up-to-date. TimeZone.getTimeZone
|
||||
will be removed in July 2017.)
|
||||
|
||||
Returns a $(LREF TimeZone) with the give name per the TZ Database.
|
||||
|
||||
This returns a $(LREF PosixTimeZone) on Posix systems and a
|
||||
$(LREF WindowsTimeZone) on Windows systems. For
|
||||
$(LREF PosixTimeZone) on Windows, call $(D PosixTimeZone.getTimeZone)
|
||||
directly and give it the location of the TZ Database time zone files on
|
||||
disk.
|
||||
|
||||
On Windows, the given TZ Database name is converted to the corresponding
|
||||
time zone name on Windows prior to calling
|
||||
$(D WindowsTimeZone.getTimeZone). This function allows for
|
||||
the same time zone names on both Windows and Posix systems.
|
||||
|
||||
See_Also:
|
||||
$(HTTP en.wikipedia.org/wiki/Tz_database, Wikipedia entry on TZ
|
||||
Database)<br>
|
||||
$(HTTP en.wikipedia.org/wiki/List_of_tz_database_time_zones, List of
|
||||
Time Zones)<br>
|
||||
$(HTTP unicode.org/repos/cldr-tmp/trunk/diff/supplemental/zone_tzid.html,
|
||||
Windows <-> TZ Database Name Conversion Table)
|
||||
|
||||
Params:
|
||||
name = The TZ Database name of the desired time zone
|
||||
|
||||
Throws:
|
||||
$(REF DateTimeException,std,datetime,date) if the given time zone
|
||||
could not be found.
|
||||
+/
|
||||
// Explicitly undocumented. It will be removed in June 2018. @@@DEPRECATED_2018-07@@@
|
||||
deprecated("Use PosixTimeZone.getTimeZone or WindowsTimeZone.getTimeZone instead")
|
||||
static immutable(TimeZone) getTimeZone(string name) @safe
|
||||
{
|
||||
|
@ -524,35 +488,7 @@ public:
|
|||
}
|
||||
|
||||
|
||||
// @@@DEPRECATED_2017-07@@@
|
||||
/++
|
||||
$(RED Deprecated. Use either PosixTimeZone.getInstalledTZNames or
|
||||
WindowsTimeZone.getInstalledTZNames. ($(LREF parseTZConversions)
|
||||
can be used to convert time zone names if necessary). Microsoft
|
||||
changes their time zones too often for us to compile the
|
||||
conversions into Phobos and have them be properly up-to-date.
|
||||
TimeZone.getInstalledTZNames will be removed in July 2017.)
|
||||
|
||||
Returns a list of the names of the time zones installed on the system.
|
||||
|
||||
Providing a sub-name narrows down the list of time zones (which
|
||||
can number in the thousands). For example,
|
||||
passing in "America" as the sub-name returns only the time zones which
|
||||
begin with "America".
|
||||
|
||||
On Windows, this function will convert the Windows time zone names to
|
||||
the corresponding TZ Database names with
|
||||
$(D windowsTZNameToTZDatabaseName). To get the actual Windows time
|
||||
zone names, use $(D WindowsTimeZone.getInstalledTZNames) directly.
|
||||
|
||||
Params:
|
||||
subName = The first part of the time zones desired.
|
||||
|
||||
Throws:
|
||||
$(D FileException) on Posix systems if it fails to read from disk.
|
||||
$(REF DateTimeException,std,datetime,date) on Windows systems if
|
||||
it fails to read the registry.
|
||||
+/
|
||||
// Explicitly undocumented. It will be removed in June 2018. @@@DEPRECATED_2018-07@@@
|
||||
deprecated("Use PosixTimeZone.getInstalledTZNames or WindowsTimeZone.getInstalledTZNames instead")
|
||||
static string[] getInstalledTZNames(string subName = "") @safe
|
||||
{
|
||||
|
@ -3523,34 +3459,7 @@ For terms of use, see http://www.unicode.org/copyright.html
|
|||
}
|
||||
|
||||
|
||||
// @@@DEPRECATED_2017-07@@@
|
||||
/++
|
||||
$(RED Deprecated. Use $(LREF parseTZConversions) instead. Microsoft changes
|
||||
their time zones too often for us to compile the conversions into
|
||||
Phobos and have them be properly up-to-date.
|
||||
tzDatabaseNameToWindowsTZName will be removed in July 2017.)
|
||||
|
||||
Converts the given TZ Database name to the corresponding Windows time zone
|
||||
name.
|
||||
|
||||
Note that in a few cases, a TZ Dabatase name corresponds to two different
|
||||
Windows time zone names. So, while in most cases converting from one to the
|
||||
other and back again will result in the same time zone name started
|
||||
with, in a few case, it'll get a different name.
|
||||
|
||||
Also, there are far more TZ Database names than Windows time zones, so some
|
||||
of the more exotic TZ Database names don't have corresponding Windows time
|
||||
zone names.
|
||||
|
||||
Returns null if the given time zone name cannot be converted.
|
||||
|
||||
See_Also:
|
||||
$(HTTP unicode.org/repos/cldr-tmp/trunk/diff/supplemental/zone_tzid.html,
|
||||
Windows <-> TZ Database Name Conversion Table)
|
||||
|
||||
Params:
|
||||
tzName = The TZ Database name to convert.
|
||||
+/
|
||||
// Explicitly undocumented. It will be removed in June 2018. @@@DEPRECATED_2018-07@@@
|
||||
deprecated("Use parseTZConversions instead")
|
||||
string tzDatabaseNameToWindowsTZName(string tzName) @safe pure nothrow @nogc
|
||||
{
|
||||
|
@ -4019,25 +3928,7 @@ version(Windows) version(UpdateWindowsTZTranslations) deprecated @system unittes
|
|||
}
|
||||
|
||||
|
||||
// @@@DEPRECATED_2017-07@@@
|
||||
/++
|
||||
$(RED Deprecated. Use $(LREF parseTZConversions) instead. Microsoft changes
|
||||
their time zones too often for us to compile the conversions into
|
||||
Phobos and have them be properly up-to-date.
|
||||
windowsTZNameToTZDatabaseName will be removed in July 2017.)
|
||||
|
||||
Converts the given Windows time zone name to a corresponding TZ Database
|
||||
name.
|
||||
|
||||
Returns null if the given time zone name cannot be converted.
|
||||
|
||||
See_Also:
|
||||
$(HTTP unicode.org/repos/cldr-tmp/trunk/diff/supplemental/zone_tzid.html,
|
||||
Windows <-> TZ Database Name Conversion Table)
|
||||
|
||||
Params:
|
||||
tzName = The TZ Database name to convert.
|
||||
+/
|
||||
// Explicitly undocumented. It will be removed in June 2018. @@@DEPRECATED_2018-07@@@
|
||||
deprecated("Use parseTZConversions instead")
|
||||
string windowsTZNameToTZDatabaseName(string tzName) @safe pure nothrow @nogc
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue