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_input_frame Struct Reference

Input 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_input_frame (char const *begin, char const *end)
 Frame constructor. More...
 
FRAMEWORK_ALWAYS_INLINE bool read (char *s, std::size_t n)
 Read bytes.
 
template<std::size_t N>
FRAMEWORK_ALWAYS_INLINE bool read (char *s)
 Read bytes.
 
FRAMEWORK_ALWAYS_INLINE pos_type tellg () const
 Input iterator position.
 
FRAMEWORK_ALWAYS_INLINE bool seekg (pos_type pos)
 Seek to position. More...
 
FRAMEWORK_ALWAYS_INLINE bool seekg (off_type off, std::ios_base::seekdir dir)
 Seek to offset. More...
 

Detailed Description

Input frame wrapper.

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

Constructor & Destructor Documentation

framework::protocol_buffers::raw_input_frame::raw_input_frame ( char const *  begin,
char const *  end 
)
inline

Frame constructor.

Warning
The lifetime of the underlying character buffer must exceed that of raw_input_frame. Behaviour when this condition is not met is undefined.

Member Function Documentation

FRAMEWORK_ALWAYS_INLINE bool framework::protocol_buffers::raw_input_frame::seekg ( pos_type  pos)
inline

Seek to position.

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

Parameters
posnew input iterator position
Returns
true on success, false on failure
FRAMEWORK_ALWAYS_INLINE bool framework::protocol_buffers::raw_input_frame::seekg ( off_type  off,
std::ios_base::seekdir  dir 
)
inline

Seek to offset.

Sets the input iterator to an offset relative to the provided position (dir). Note that the definition used here may not be compatible with that of basic_istream::seekg.

Parameters
offinput iterator offset
dirreference position
Returns
true on success, false on failure

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