OXY API 1.0
OXY API Library Documentation
Loading...
Searching...
No Matches
oxy::core::make_blob_f Struct Reference

Generate a blob containing the given content. More...

#include <blob.hpp>

Public Member Functions

auto operator() (char const *buffer, const size_t size) const -> blob_t
auto operator() (std::ifstream &in) const -> blob_t
auto operator() (std::istringstream const &stream) const -> blob_t
auto operator() (std::string const &stream) const -> blob_t

Detailed Description

Generate a blob containing the given content.

This functor provides multiple overloads to create a blob_t object from different types of input, including strings, string streams, file streams, and raw buffers. It encapsulates the logic for constructing a blob from various sources of data.

Member Function Documentation

◆ operator()() [1/4]

auto oxy::core::make_blob_f::operator() ( char const * buffer,
const size_t size ) const -> blob_t
inline

This overload constructs a blob_t object from a raw buffer and its size, creating a string from the buffer and using it to initialize the blob.

Parameters
buffer- contents of the new blob.
size- size of the contents.

◆ operator()() [2/4]

auto oxy::core::make_blob_f::operator() ( std::ifstream & in) const -> blob_t
inline

This overload reads the entire contents of the provided input file stream and constructs a blob_t object with the read data.

◆ operator()() [3/4]

auto oxy::core::make_blob_f::operator() ( std::istringstream const & stream) const -> blob_t
inline

This overload reads the entire contents of the provided input string stream and constructs a blob_t object with the read data.

◆ operator()() [4/4]

auto oxy::core::make_blob_f::operator() ( std::string const & stream) const -> blob_t
inline

This overload constructs a blob_t object directly from the provided string