Skip to content
Snippets Groups Projects
Commit ac40d05c authored by mark's avatar mark
Browse files

ENH: provide string-streams that can use arbitrary memory (fixes #115)

- This can also be used in combination with the count-stream for
  the following type of use:

    DynamicList<char> buffer(4096);     // allocate some large buffer

    OBufStream os(buffer);
    os << "content1" << " and more content";
    buffer.setSize(os.size());          // synchronize sizes

    something.write(buffer, buffer.size());

    os.rewind();
    os << "content2";
    buffer.setSize(os.size());      // synchronize sizes

    something.write(buffer, buffer.size());

    // or simply using the output size directly (without sync)
    os.rewind();
    os << "content3";

    something.write(buffer, os.size());
parent 1f795c7a
Branches
Tags
1 merge request!38WIP: Memory efficient alternative to string-streams, streams with compact output and simple counter streams (#114, #115)
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment