framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | List of all members
framework::protocol_buffers::raw_output_frame< Safe > Struct Template Reference

Output frame wrapper. More...

#include <frame.hpp>

Public Types

using pos_type = std::size_t
 Iterator position type.
 
using off_type = typename std::make_signed< pos_type >::type
 Iterator offset type.
 

Public Member Functions

 raw_output_frame (char *begin, char *end)
 Frame constructor. More...
 
bool write (char const *s, std::streamsize n)
 Write bytes.
 
template<std::size_t N>
bool write (char const *s)
 Write bytes.
 
bool seekp (pos_type pos)
 Seek to position. More...
 
std::size_t tellp () const
 Output iterator position.
 

Detailed Description

template<bool Safe = true>
struct framework::protocol_buffers::raw_output_frame< Safe >

Output frame wrapper.

Provides a trivial output stream wrapper around a raw character buffer.

Template Parameters
Safecheck buffer boundaries when writing to the stream

Constructor & Destructor Documentation

template<bool Safe = true>
framework::protocol_buffers::raw_output_frame< Safe >::raw_output_frame ( char *  begin,
char *  end 
)
inline

Frame constructor.

Warning
The lifetime of the underlying character buffer must exceed that of raw_output_frame. Behaviour when this condition is not met is undefined.
Precondition
begin <= end

Member Function Documentation

template<bool Safe = true>
bool framework::protocol_buffers::raw_output_frame< Safe >::seekp ( pos_type  pos)
inline

Seek to position.

Sets the output iterator to the provided position. Note that the definition used here may not be compatible with that of basic_ostream::seekg.

Parameters
posnew output iterator position
Returns
true on success, false on failure

The documentation for this struct was generated from the following file: