Output stream serialization. More...
#include <binary_streams.hpp>

Public Member Functions | |
| bostream () | |
| Standard constructor. | |
| template<class T > | |
| bostream & | operator<< (T x) |
| Insert any object to the stream. | |
| bostream & | operator<< (const std::string &s) |
| Insert a string to the stream. | |
| template<class Other > | |
| bostream & | operator<< (const std::vector< Other > &vec) |
| Insert a vector of elements. | |
| bostream & | operator<< (const char *cs) |
| Insert a literal string. | |
| const std::string & | str () const |
| Obtain the string representing the stream. | |
| void | clear () |
| Clear the stream. | |
Private Attributes | |
| std::string | _s |
| The representation of the stream in memory. | |
Friends | |
| struct | _inserter_helper |
Output stream serialization.
This class provides stream functionality to serialize objects in a way similar to that of std::cout or std::ostringstream.
Extracted from MiLi (mili.googlecode.com).
An extensive example of its usage can be seen in: http://code.google.com/p/mili/source/browse/trunk/example_binary-streams.cpp
Definition at line 89 of file binary_streams.hpp.
| ana::serializer::bostream::bostream | ( | ) | [inline] |
Standard constructor.
Definition at line 100 of file binary_streams.hpp.
| void ana::serializer::bostream::clear | ( | ) | [inline] |
Clear the stream.
Enables the user to use it several times.
Definition at line 155 of file binary_streams.hpp.
References _s.
| bostream& ana::serializer::bostream::operator<< | ( | const std::vector< Other > & | vec | ) | [inline] |
Insert a vector of elements.
Definition at line 131 of file binary_streams.hpp.
| bostream& ana::serializer::bostream::operator<< | ( | const std::string & | s | ) | [inline] |
| bostream& ana::serializer::bostream::operator<< | ( | const char * | cs | ) | [inline] |
Insert a literal string.
Definition at line 142 of file binary_streams.hpp.
References operator<<().

| bostream& ana::serializer::bostream::operator<< | ( | T | x | ) | [inline] |
Insert any object to the stream.
| x | : A copy of the object being inserted. |
Definition at line 111 of file binary_streams.hpp.
Referenced by operator<<().

| const std::string& ana::serializer::bostream::str | ( | ) | const [inline] |
Obtain the string representing the stream.
Definition at line 149 of file binary_streams.hpp.
References _s.
Referenced by ana_network_manager::create_client_and_connect(), ana_network_manager::handle_receive(), and asio_sender::send().

friend struct _inserter_helper [friend] |
Definition at line 92 of file binary_streams.hpp.
std::string ana::serializer::bostream::_s [private] |
The representation of the stream in memory.
Definition at line 163 of file binary_streams.hpp.
Referenced by clear(), operator<<(), and str().
| Generated by doxygen 1.7.1 on Thu May 24 2012 01:19:18 for The Battle for Wesnoth | Gna! | Forum | Wiki | CIA | devdocs |