staticlib_io  1.2.11
 All Classes Namespaces Files Functions Variables
Public Member Functions | List of all members
staticlib::io::replacer_source< Source > Class Template Reference

Source wrapper that replaces specified substrings in the input. More...

#include <staticlib/io/replacer_source.hpp>

Public Member Functions

 replacer_source (Source &&src, std::map< std::string, std::string > values, std::function< void(const std::string &)> on_error, std::string prefix="{{", std::string postfix="}}", size_t max_placeholder_len=255)
 Constructor, created source wrapper will own specified source.
 replacer_source (const replacer_source &)
 Deleted copy constructor.
replacer_source & operator= (const replacer_source &)
 Deleted copy assignment operator.
 replacer_source (replacer_source &&other) STATICLIB_NOEXCEPT
 Move constructor.
replacer_source & operator= (replacer_source &&other) STATICLIB_NOEXCEPT
 Move assignment operator.
std::streamsize read (span< char > span)
 Replacing read implementation.
Source & get_source ()
 Underlying source accessor.
std::map< std::string,
std::string > & 
get_values ()
 Values mapping accessor.

Detailed Description

template<typename Source>
class staticlib::io::replacer_source< Source >

Source wrapper that replaces specified substrings in the input.

Constructor & Destructor Documentation

template<typename Source >
staticlib::io::replacer_source< Source >::replacer_source ( Source &&  src,
std::map< std::string, std::string >  values,
std::function< void(const std::string &)>  on_error,
std::string  prefix = "{{",
std::string  postfix = "}}",
size_t  max_placeholder_len = 255 
)
inline

Constructor, created source wrapper will own specified source.

Parameters
srcinput source
template<typename Source >
staticlib::io::replacer_source< Source >::replacer_source ( const replacer_source< Source > &  )

Deleted copy constructor.

Parameters
otherinstance
template<typename Source >
staticlib::io::replacer_source< Source >::replacer_source ( replacer_source< Source > &&  other)
inline

Move constructor.

Parameters
otherother instance

Member Function Documentation

template<typename Source >
Source& staticlib::io::replacer_source< Source >::get_source ( )
inline

Underlying source accessor.

Returns
underlying source reference
template<typename Source >
std::map<std::string, std::string>& staticlib::io::replacer_source< Source >::get_values ( )
inline

Values mapping accessor.

Returns
values mapping
template<typename Source >
replacer_source& staticlib::io::replacer_source< Source >::operator= ( const replacer_source< Source > &  )

Deleted copy assignment operator.

Parameters
otherinstance
Returns
this instance
template<typename Source >
replacer_source& staticlib::io::replacer_source< Source >::operator= ( replacer_source< Source > &&  other)
inline

Move assignment operator.

Parameters
otherother instance
Returns
this instance
template<typename Source >
std::streamsize staticlib::io::replacer_source< Source >::read ( span< char >  span)
inline

Replacing read implementation.

Parameters
spanbuffer span
Returns
number of bytes processed

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