|
Last change
on this file since e65cc0 was 98a2987, checked in by Tillmann Crueger <crueger@…>, 16 years ago |
|
Added -Wall flag and fixed several small hickups
|
-
Property mode
set to
100644
|
|
File size:
940 bytes
|
| Line | |
|---|
| 1 | /*
|
|---|
| 2 | * StreamStringView.hpp
|
|---|
| 3 | *
|
|---|
| 4 | * Created on: Dec 14, 2009
|
|---|
| 5 | * Author: crueger
|
|---|
| 6 | */
|
|---|
| 7 |
|
|---|
| 8 | #ifndef STREAMSTRINGVIEW_HPP_
|
|---|
| 9 | #define STREAMSTRINGVIEW_HPP_
|
|---|
| 10 |
|
|---|
| 11 | #include <boost/function.hpp>
|
|---|
| 12 | #include <iostream>
|
|---|
| 13 |
|
|---|
| 14 | #include "Views/StringView.hpp"
|
|---|
| 15 |
|
|---|
| 16 | /**
|
|---|
| 17 | * Wrapper to produce a StringView from any method that uses a stream to display something.
|
|---|
| 18 | *
|
|---|
| 19 | * The function is called with a stringstream which then is turned into a string later.
|
|---|
| 20 | *
|
|---|
| 21 | * Caveat: Make sure the stream passed to the method is actually used. Some methods seem to use a stream parameter for
|
|---|
| 22 | * legacy reasons. These methods internally use the "Log() << Verbose()" mechanism instead of the stream.
|
|---|
| 23 | */
|
|---|
| 24 | class StreamStringView : public StringView
|
|---|
| 25 | {
|
|---|
| 26 | public:
|
|---|
| 27 | StreamStringView(boost::function<void(std::ostream *)>);
|
|---|
| 28 | virtual ~StreamStringView();
|
|---|
| 29 |
|
|---|
| 30 | virtual const std::string toString();
|
|---|
| 31 |
|
|---|
| 32 | private:
|
|---|
| 33 | boost::function<void(std::ostream *)> displayMethod;
|
|---|
| 34 | };
|
|---|
| 35 |
|
|---|
| 36 | #endif /* STREAMSTRINGVIEW_HPP_ */
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.