When should I override basic_streambuf::seekoff?

This page summarizes the projects mentioned and recommended in the original post on /r/cpp

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • STL

    MSVC's implementation of the C++ Standard Library.

  • I am writing a custom binary stream buffer inheriting from the standard std::streambuf interface. This stream buffer needs to support writing and reading to an external block of memory (not owned by the stream). So far, I could get away with only overriding the underflow and overflow member functions, which call setp, pbump, and setg with the right positions, handle the logic to circumvent the limitation of Microsoft's STL only accepting int values for offsets (which causes problems with large objects), and get/set a byte using pptr and gptr.

  • asio

    Boost.org asio module (by boostorg)

  • Doing some research on other people's experience in implementing custom stream buffers, I rarely see seekoff (and it's companion seekpos) being overriden. Boost ASIO's basic_streambuf does not. This article on writing custom stream buffers and this other article (both show up on the first page in a Google search) do not.

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • llvm-project

    The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.

  • I did see the various STL implementations of basic_stringbuf use it, though (MSVC, libstdc++, libc++).

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts