|
Last change
on this file since da09909 was da09909, checked in by Tillmann Crueger <crueger@…>, 16 years ago |
|
Improved documentation for menu framework.
|
-
Property mode
set to
100644
|
|
File size:
907 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 |
|
|---|
| 13 | #include "Views/StringView.hpp"
|
|---|
| 14 |
|
|---|
| 15 | /**
|
|---|
| 16 | * Wrapper to produce a StringView from any method that uses a stream to display something.
|
|---|
| 17 | *
|
|---|
| 18 | * The function is called with a stringstream which then is turned into a string later.
|
|---|
| 19 | *
|
|---|
| 20 | * Caveat: Make sure the stream passed to the method is actually used. Some methods seem to use a stream parameter for
|
|---|
| 21 | * legacy reasons. These methods internally use the "Log() << Verbose()" mechanism instead of the stream.
|
|---|
| 22 | */
|
|---|
| 23 | class StreamStringView : public StringView
|
|---|
| 24 | {
|
|---|
| 25 | public:
|
|---|
| 26 | StreamStringView(boost::function<void(ofstream *)>);
|
|---|
| 27 | virtual ~StreamStringView();
|
|---|
| 28 |
|
|---|
| 29 | virtual const string toString();
|
|---|
| 30 |
|
|---|
| 31 | private:
|
|---|
| 32 | boost::function<void(ofstream *)> displayMethod;
|
|---|
| 33 | };
|
|---|
| 34 |
|
|---|
| 35 | #endif /* STREAMSTRINGVIEW_HPP_ */
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.