source: molecuilder/src/Views/StreamStringView.hpp@ 98a2987

Last change on this file since 98a2987 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
RevLine 
[df55a0]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>
[98a2987]12#include <iostream>
[df55a0]13
14#include "Views/StringView.hpp"
15
[da09909]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 */
[df55a0]24class StreamStringView : public StringView
25{
26public:
[98a2987]27 StreamStringView(boost::function<void(std::ostream *)>);
[df55a0]28 virtual ~StreamStringView();
29
[98a2987]30 virtual const std::string toString();
[df55a0]31
32private:
[98a2987]33 boost::function<void(std::ostream *)> displayMethod;
[df55a0]34};
35
36#endif /* STREAMSTRINGVIEW_HPP_ */
Note: See TracBrowser for help on using the repository browser.