v5.4.0: D2 cleanups, enum pretty-printing, pkgzip files streaming
https://github.com/sociomantic-tsunami/ocean/milestone/121
Migrations
Replacement of IEBtree protected operators
ocean.util.container.ebtree.IEBTree
The opAddAssign
and opSubAssign
operators have been replaced with
increaseNodeCount
and decreaseNodeCount
.
These are protected member functions used only in the implementation of
the EBTree classes, so no impact on user code is expected.
Bug fixes
Missing versions added to ocean.LibFeatures
ocean.LibFeatures
This module was supposed to provide means for library writers depending
on Ocean to conditionally support a feature. However the module hasn't been
updated for a long time, and versions 4.2
to 4.8
were missing in the v4
suite, while no v5
version (so 5.0
- 5.3
) were present.
This release adds all the missing features as well as the current (5.4
).
SmartUnion
will no longer produce conflicting opCall
ocean.core.SmartUnion
Before this change, SmartUnion
would generate duplicated static opCall
for initialization. However those opCall
were not callable,
as the call would be ambiguous.
After this change, those opCall
won't be generated anymore,
and only the set
and get
methods will be available on fields
which don't have a unique type in the union
.
New features
The Formatter now pretty-print enums
enum
members are now correctly printed by the Formatter.
For example enum Foo { A, B}
will print either Foo.A
or Foo.B
instead of 0
and 1
, previously.
If a value that is not a member of an enum
is casted to it,
such as cast(Foo) 42
, the Formatter will print cast(Foo) 42
.
Note that the type will be printed qualified, e.g. passing a const
value will print const(Foo).A
, for example.
Support for streaming pkzip files
ocean.io.compress.ZipStream
The new class ZipStreamDecompressor
supports streaming of both gzip and
well-behaved single-file pkzip archives. Streaming of pkzip archives is
supported only when the archive contains a single file, and does not use
any of the exotic features allowed by the pkzip format.
Deprecations
Most calendar types have been deprecated
ocean.time.chrono.Hebrew
,ocean.time.chrono.Hijri
,
ocean.time.chrono.Japanese
,ocean.time.chrono.Korean
,
ocean.time.chrono.Taiwan
,ocean.time.chrono.ThaiBuddhist
Those modules were not used, badly supported, and not up to
any coding convention.
ocean.core.Time
has been deprecated
ocean.core.Time
This module has been completely deprecated and should be replaced by usages of core.time
.
The sole function in this module, seconds
, was mostly used as argument to Thread.sleep
.
It can be replaced by seconds
from core.time
if the argument is an integer,
or msecs
, usecs
, hnsecs
or nsecs
depending on the expected precision.
Module ocean.stdc.posix.netinet.tcp
is deprecated
ocean.stdc.posix.netinet.tcp
This module was just a thin wrapper around core.sys.posix.netinet.tcp
,
which should now be imported directly.
Module ocean.core.Traits
have been deprecated
ocean.core.Traits
All symbols in this module were deprecated in v5.0.0,
but the module itself wasn't marked as deprecated before.
Most modules in ocean.stdc.posix.sys
are deprecated
ocean.stdc.posix.sys.ipc
,ocean.stdc.posix.sys.mman
,
ocean.stdc.posix.sys.select
,ocean.stdc.posix.sys.shm
,
ocean.stdc.posix.sys.stat
,ocean.stdc.posix.sys.statvfs
,
ocean.stdc.posix.sys.uio
,
ocean.stdc.posix.sys.utsname
,ocean.stdc.posix.sys.wait
Those modules where just thin wrapper, publicly importing their
core.sys.posix.sys
counterpart and can be trivially replaced.
The only two remaining modules are ocean.stdc.posix.sys.un
,
which a create
method and a different definition (but binary compatible)
for the sockaddr_un
struct, and ocean.stdc.posix.sys.socket
,
as it contains definitions not available as of DMD 2.091.0.
Exposed declaration of pthread_getattr_np
had been deprecated
ocean.util.aio.internal.ThreadWorker
This module inadvertently exposed the extern (C)
declaration for the
non-standard function pthread_getattr_np
.
Users can import core.thread
instead to get the declaration.
C bindings in ocean.sys.TimerFD
have been deprecated
ocean.sys.TimerFD
This module exposed the functions timerfd_create
, timerfd_gettime
, timerfd_settime
,
as well as the constants CLOCK_MONOTONIC
, TFD_TIMER_ABSTIME
, TFD_CLOEXEC
, TFD_NONBLOCK
.
Those have now been deprecated, as they are part of druntime.
CLOCK_MONOTONIC
is part of core.sys.posix.time
, and the other functions / constants
can be found in core.sys.linux.timerfd
since 2.069.
The rest of the module, which provides wrapper types around this functionality, is not deprecated.