Right now, TPIE streams support forward read/can_read, forward peek/can_peek/skip, backward read_back/can_read_back.
In my application, I need peek/skip backwards, so I implement it using this workaround:
bool canPeek; T peekItem;
// initialization skip macro:
canPeek = fs.can_read_back();
if (canPeek) peekItem = fs.read_back();
while (canPeek && peekItem.useful()) {
// Use peekItem ...
// skip macro:
canPeek = fs.can_read_back();
if (canPeek) peekItem = fs.read_back();
}
I request this being possible in file_stream. (I'm not sure if it's a reasonable request -- it's been a while since I've meddled with its implementation.)
Right now, TPIE streams support forward read/can_read, forward peek/can_peek/skip, backward read_back/can_read_back.
In my application, I need peek/skip backwards, so I implement it using this workaround:
I request this being possible in file_stream. (I'm not sure if it's a reasonable request -- it's been a while since I've meddled with its implementation.)