sprint 1-alpha
Public Member Functions
sprint::storage_buffer Class Reference

Use an user buffer to implement IO and cat of string/data. More...

#include <storage_buffer.h>

List of all members.

Public Member Functions

template<class R >
 storage_buffer (R *ptr, unsigned int capacity)
 initialize from an user buffer
template<class R >
 storage_buffer (const R &buf)
 initialize from a buffer object
template<class T >
void insert (const T *a, int len)
 insert array data
void push_back (char c)
storage_bufferoperator<< (const char *str)
storage_bufferoperator<< (char c)
template<class T >
storage_bufferoperator<< (const T &c)
const char * str ()
 place \0 at the end of buffer and return the string
const char * data () const
 return the inner buffer
unsigned int size () const
 size of string
unsigned int lenght () const
 size of data stored in bytes
unsigned int capacity () const
 max capacity

Detailed Description

Use an user buffer to implement IO and cat of string/data.

Note:
buffer memory will not released
 char buffer[256];
 // ...
 foo(storage_buffer<char> (buffer, 256));

Member Function Documentation

storage_buffer& sprint::storage_buffer::operator<< ( char  c)

insert a char

  storage << 'a';
template<class T >
storage_buffer& sprint::storage_buffer::operator<< ( const T &  c)

add a generic T object

  storage << my_class;
storage_buffer& sprint::storage_buffer::operator<< ( const char *  str)

insert a string

  storage << "Hello World";
void sprint::storage_buffer::push_back ( char  c)

insert a single char for compatibilty with policy based on vector


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines