vibe.d beta banner
get vibe.d
0.9.0

Asynchronous I/O that doesn’t get in your way, written in D

Function GenericPath.byPrefix

Iterates over the path by segment, each time returning the sub path leading to that segment.

auto byPrefix() const nothrow @nogc @property;

Example

assert(InetPath("foo/bar/baz").byPrefix
	.equal([
		InetPath("foo/"),
		InetPath("foo/bar/"),
		InetPath("foo/bar/baz")
	]));

assert(InetPath("/foo/bar").byPrefix
	.equal([
		InetPath("/"),
		InetPath("/foo/"),
		InetPath("/foo/bar"),
	]));

Authors

Sönke Ludwig

Copyright

© 2012-2019 Sönke Ludwig

License

Subject to the terms of the MIT license, as written in the included LICENSE.txt file.