TorchCraftAI
A bot for machine learning research on StarCraft: Brood War
Public Member Functions | List of all members
common::IMembuf Class Reference

A stream buffer for reading from a vector of bytes. More...

#include <serialization.h>

Inherits streambuf.

Public Member Functions

 IMembuf (std::vector< char > const &data)
 
 IMembuf (std::string_view sv)
 

Detailed Description

A stream buffer for reading from a vector of bytes.

This can be used to construct a std::istream from a given binary blob as follows:

std::vector<char> data = getDataFromSomewhere();
IMembuf mbuf(data);
std::istream is(&mbuf);
// Extract data from istream as usual.

Constructor & Destructor Documentation

common::IMembuf::IMembuf ( std::vector< char > const &  data)
explicit
common::IMembuf::IMembuf ( std::string_view  sv)
explicit

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