On Saturday, 8 September 2012 at 09:10:30 UTC, Jonathan M Davis
wrote:
If you were to operate on a string in a manner similar to a
stream, you'd be
operating on it as a range, and there are a lot of range-based
functions in
Phobos. But if you want to specifically parse a range of
characters, then use
std.conv.parse:
http://dlang.org/phobos/std_conv.html#parse
If you want to know more about ranges, then this is currently
the best
tutorial on them:
http://ddili.org/ders/d.en/ranges.html
- Jonathan M Davis
Hum, parse. Looks useful. No need to create a temp stream like in
C++ then. Good. Thanks for the info.
That said, is the "abstraction" itself available? Say *someone*
wrote an xml parser, and the public interface expects to operate
on a "File". Now, supposing I don't have a file, but all I have
is a string, is it possible for someone pass that string the the
function?