Design Patterns
file_stream.h
Go to the documentation of this file.
1 // Based on "Design Patterns: Elements of Reusable Object-Oriented Software"
2 // book by Erich Gamma, John Vlissides, Ralph Johnson, and Richard Helm
3 //
4 // Created by Bartosz Rachwal. The National Institute of Advanced Industrial Science and Technology, Japan.
5 
6 #ifndef STRUCTURAL_DECORATOR_FILE_STREAM_H_
7 #define STRUCTURAL_DECORATOR_FILE_STREAM_H_
8 
9 #include "stream_interface.h"
10 
11 namespace structural
12 {
13 namespace decorator
14 {
16 {
17  public:
18  FileStream();
19  explicit FileStream(const char*);
20 
21  void PutInt(int value) override;
22  void PutString(const std::string&) override;
23 
24  int value() const;
25  std::string &message();
26 
27  private:
28  int value_;
29  std::string text_string_;
30 };
31 }
32 }
33 
34 #endif
35 
Definition: shape_interface.h:11
void PutInt(int value) override
Definition: file_stream.cc:18
std::string & message()
Definition: file_stream.cc:36
int value() const
Definition: file_stream.cc:31
void PutString(const std::string &) override
Definition: file_stream.cc:24
FileStream()
Definition: file_stream.cc:16
Definition: stream_interface.h:15
Definition: file_stream.h:15