IBR-DTNSuite  0.8
ibrdtn/ibrdtn/api/StringBundle.cpp
Go to the documentation of this file.
00001 /*
00002  * StringBundle.cpp
00003  *
00004  *  Created on: 24.07.2009
00005  *      Author: morgenro
00006  */
00007 
00008 #include "ibrdtn/config.h"
00009 #include "ibrdtn/api/StringBundle.h"
00010 
00011 namespace dtn
00012 {
00013         namespace api
00014         {
00015                 StringBundle::StringBundle(const dtn::data::EID &destination)
00016                  : Bundle(destination), _ref(ibrcommon::BLOB::create())
00017                 {
00018                         _b.push_back(_ref);
00019                 }
00020 
00021                 StringBundle::~StringBundle()
00022                 { }
00023 
00024                 void StringBundle::append(const std::string &data)
00025                 {
00026                         ibrcommon::BLOB::iostream stream = _ref.iostream();
00027                         (*stream).seekp(0, ios::end);
00028                         (*stream) << data;
00029                 }
00030         }
00031 }