E-MailRelay
Public Member Functions | Static Public Member Functions | List of all members
GNet::LineBufferConfig Class Reference

A configuration structure for GNet::LineBuffer. More...

#include <glinebuffer.h>

Public Member Functions

 LineBufferConfig (const std::string &eol=std::string(1U,'\n'), std::size_t warn=0U, std::size_t fmin=0U, std::size_t initial_expect=0U)
 Constructor. More...
 
const std::string & eol () const
 Returns the end-of-line string as passed to the constructor. More...
 
std::size_t warn () const
 Returns the warn-limit, as passed to the constructor. More...
 
std::size_t fmin () const
 Returns the minimum fragment size, as passed to the constructor. More...
 
std::size_t expect () const
 Returns the initial expect value, as passed to the constructor. More...
 

Static Public Member Functions

static LineBufferConfig transparent ()
 Convenience factory function. More...
 
static LineBufferConfig http ()
 Convenience factory function. More...
 
static LineBufferConfig smtp ()
 Convenience factory function. More...
 
static LineBufferConfig pop ()
 Convenience factory function. More...
 
static LineBufferConfig crlf ()
 Convenience factory function. More...
 
static LineBufferConfig newline ()
 Convenience factory function. More...
 
static LineBufferConfig autodetect ()
 Convenience factory function. More...
 

Detailed Description

A configuration structure for GNet::LineBuffer.

Definition at line 324 of file glinebuffer.h.

Constructor & Destructor Documentation

◆ LineBufferConfig()

GNet::LineBufferConfig::LineBufferConfig ( const std::string &  eol = std::string(1U,'\n'),
std::size_t  warn = 0U,
std::size_t  fmin = 0U,
std::size_t  initial_expect = 0U 
)
explicit

Constructor.

An empty end-of-line string detects either LF or CR-LF. The default end-of-line string is newline. A non-zero warn-limit generates a one-shot warning when breached. The fmin value can be used to prevent trivially small line fragments from being returned. This is useful for SMTP where a fragment containing a single dot character and no end-of-line can cause confusion with respect to the end-of-text marker. The initial-expect parameter is useful for defining transparent operation.

Definition at line 231 of file glinebuffer.cpp.

Member Function Documentation

◆ autodetect()

GNet::LineBufferConfig GNet::LineBufferConfig::autodetect ( )
static

Convenience factory function.

Definition at line 252 of file glinebuffer.cpp.

◆ crlf()

GNet::LineBufferConfig GNet::LineBufferConfig::crlf ( )
static

Convenience factory function.

Definition at line 257 of file glinebuffer.cpp.

◆ eol()

const std::string & GNet::LineBufferConfig::eol ( ) const
inline

Returns the end-of-line string as passed to the constructor.

Definition at line 515 of file glinebuffer.h.

◆ expect()

std::size_t GNet::LineBufferConfig::expect ( ) const
inline

Returns the initial expect value, as passed to the constructor.

Definition at line 533 of file glinebuffer.h.

◆ fmin()

std::size_t GNet::LineBufferConfig::fmin ( ) const
inline

Returns the minimum fragment size, as passed to the constructor.

Definition at line 527 of file glinebuffer.h.

◆ http()

GNet::LineBufferConfig GNet::LineBufferConfig::http ( )
static

Convenience factory function.

Definition at line 272 of file glinebuffer.cpp.

◆ newline()

GNet::LineBufferConfig GNet::LineBufferConfig::newline ( )
static

Convenience factory function.

Definition at line 247 of file glinebuffer.cpp.

◆ pop()

GNet::LineBufferConfig GNet::LineBufferConfig::pop ( )
static

Convenience factory function.

Definition at line 267 of file glinebuffer.cpp.

◆ smtp()

GNet::LineBufferConfig GNet::LineBufferConfig::smtp ( )
static

Convenience factory function.

Definition at line 262 of file glinebuffer.cpp.

◆ transparent()

GNet::LineBufferConfig GNet::LineBufferConfig::transparent ( )
static

Convenience factory function.

Definition at line 240 of file glinebuffer.cpp.

◆ warn()

std::size_t GNet::LineBufferConfig::warn ( ) const
inline

Returns the warn-limit, as passed to the constructor.

Definition at line 521 of file glinebuffer.h.


The documentation for this class was generated from the following files: