string_stream.hpp
Go to the documentation of this file.
1 
10 /*****************************************************************************
11 ** Ifdefs
12 *****************************************************************************/
13 
14 #ifndef ECL_STREAMS_STRING_STREAM_HPP_
15 #define ECL_STREAMS_STRING_STREAM_HPP_
16 
17 /*****************************************************************************
18 ** Includes
19 *****************************************************************************/
20 
21 #include <string>
22 #include <ecl/config/macros.hpp>
23 #include <ecl/devices/string.hpp>
24 #include "text_stream.hpp"
25 #include "macros.hpp"
26 
27 /*****************************************************************************
28 ** Namespaces
29 *****************************************************************************/
30 
31 namespace ecl {
32 
33 /*****************************************************************************
34 ** Using
35 *****************************************************************************/
44 class ecl_streams_PUBLIC StringStream : public TextStream<String> {
45 public:
55  const char* c_str() { return this->io_device.c_str(); }
56 
66  std::string str() { return this->io_device.str(); }
67 
74  void clear() { io_device.clear(); }
75 
76  virtual ~StringStream() {}
77 };
78 
79 } // namespace ecl
80 
81 
82 
83 
84 #endif /* ECL_STREAMS_STRING_STREAM_HPP_ */
Macros for ecl streams.
virtual ~StringStream()
const char * c_str()
Character string representation of the underlying device&#39;s contents.
void clear()
Clears the underlying device&#39;s internal buffers.
Convenience wrapper for string device based textstreams.
Convenience header for various text streams.
A text streaming interface.
Definition: text_stream.hpp:94
std::string str()
String representation of the underlying device&#39;s contents.
#define ecl_streams_PUBLIC


xbot_driver
Author(s): Roc, wangpeng@droid.ac.cn
autogenerated on Sat Oct 10 2020 03:27:38