Skip to content

Additional Cleanup of file, file_stream, and file_writer (and levelized variants) #445

Description

@ssoelvsten

The file stream class has already been quite improved with #397 , but we can do more.

file_stream

  • Rename to adiar::istream, adiar::levelized_istream, ... to better match std.
  • Rename pull into get (similar to std::istream)
  • Rename reset() into seek_begin().
  • Provide iterator-like operator overloading (*, ->, ++).
  • Provide std::istream like syntax operator overloading (>>).
  • The direction is better encapsulated as an enum with values: Forward and Backward.

file

  • Add begin() and rbegin() that creates the file stream in the desired direction.
  • Make end() and rend() a simple sentinel that overloads == into a can_pull check.

tpie::file_stream

In some places, the tpie::file_stream is still used directly.

  • Add an adiar::iofstream that is bi-directional and merely a wrapper of tpie::file_stream.

file_writer

  • Rename into adiar::ostream, adiar::levelized_ostream, .... to better match std.
  • Provide std::ostream like operator overloading (<<).

node_arc_...

  • Rename into narc. This matches the four letters of node, is easily pronounceable and just as clear (or better said: unclear...).

..._random_access

  • Rename into adiar::..._raccess to better match with the istream and ostream renaming.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions