Program Listing for File string_stream.hpp

Return to documentation for file (/tmp/ws/src/ecl_core/ecl_streams/include/ecl/streams/string_stream.hpp)

/*****************************************************************************
** Ifdefs
*****************************************************************************/

#ifndef ECL_STREAMS_STRING_STREAM_HPP_
#define ECL_STREAMS_STRING_STREAM_HPP_

/*****************************************************************************
** Includes
*****************************************************************************/

#include <string>
#include <ecl/config/macros.hpp>
#include <ecl/devices/string.hpp>
#include "text_stream.hpp"
#include "macros.hpp"

/*****************************************************************************
** Namespaces
*****************************************************************************/

namespace ecl {

/*****************************************************************************
** Using
*****************************************************************************/
class ecl_streams_PUBLIC StringStream : public TextStream<String> {
public:
    const char* c_str() { return this->io_device.c_str(); }

    std::string str() { return this->io_device.str(); }

    void clear() { io_device.clear(); }

    virtual ~StringStream() {}
};

} // namespace ecl




#endif /* ECL_STREAMS_STRING_STREAM_HPP_ */