Giri's C++ Support Library
C++ library providing everything you need to quickly create awesome applications.
giri::Blob Class Reference

Binary large object. More...

#include <Blob.h>

Inheritance diagram for giri::Blob:
Collaboration diagram for giri::Blob:

Public Member Functions

std::string toString () const
 
void loadString (const std::string &s)
 
bool toFile (const std::filesystem::path &file)
 
void loadFile (const std::filesystem::path &file)
 
std::string toBase64 () const
 
void loadBase64 (const std::string &data)
 
void compress ()
 
void decompress ()
 

Additional Inherited Members

- Public Types inherited from giri::Object< Blob >
using SPtr = std::shared_ptr< Blob >
 
using UPtr = std::unique_ptr< Blob >
 
using WPtr = std::weak_ptr< Blob >
 

Detailed Description

Binary large object.

Member Function Documentation

◆ compress()

void giri::Blob::compress ( )
inline

Compresses the blob data.

◆ decompress()

void giri::Blob::decompress ( )
inline

Decompresses formerly compressed blob data.

◆ loadBase64()

void giri::Blob::loadBase64 ( const std::string &  data)
inline

Load Data from a Base64 string.

Parameters
dataBase64 encoded data.

◆ loadFile()

void giri::Blob::loadFile ( const std::filesystem::path &  file)
inline

Loads blob data from the harddisk. Throws FileSystemException on error.

Parameters
fileFilepath to load data from.

◆ loadString()

void giri::Blob::loadString ( const std::string &  s)
inline

Stores a string within the blob object.

Parameters
sString data to load into the blob.

◆ toBase64()

std::string giri::Blob::toBase64 ( ) const
inline
Returns
The stored data encoded as Base64 string.

◆ toFile()

bool giri::Blob::toFile ( const std::filesystem::path &  file)
inline

Writes blob data to the harddisk. If given file does not exist it will be created. If file does already exist it will be overridden.

Parameters
fileFilepath to write data to.
Returns
true on success, false on failure.

◆ toString()

std::string giri::Blob::toString ( ) const
inline
Returns
The stored data as string.

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