www.cemf.ir
masterOstream.cpp
Go to the documentation of this file.
1 /*------------------------------- phasicFlow ---------------------------------
2  O C enter of
3  O O E ngineering and
4  O O M ultiscale modeling of
5  OOOOOOO F luid flow
6 ------------------------------------------------------------------------------
7  Copyright (C): www.cemf.ir
8  email: hamid.r.norouzi AT gmail.com
9 ------------------------------------------------------------------------------
10 Licence:
11  This file is part of phasicFlow code. It is a free software for simulating
12  granular and multiphase flows. You can redistribute it and/or modify it under
13  the terms of GNU General Public License v3 or any other later versions.
14 
15  phasicFlow is distributed to help others in their research in the field of
16  granular and multiphase flows, but WITHOUT ANY WARRANTY; without even the
17  implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 
19 -----------------------------------------------------------------------------*/
20 
21 
22 #include "masterOstream.hpp"
23 #include "token.hpp"
24 
25 
27 (
28  std::ostream& os,
29  const word& streamName
30 )
31 :
32  Ostream(os, streamName, writeFormat::ASCII)
33 {}
34 
35 
37 {
38  if(showOutput())
39  {
40  Ostream::write(c);
41  }
42  return *this;
43 }
44 
45 
47 {
48  if(showOutput())
49  {
50  Ostream::write(str);
51  }
52  return *this;
53 }
54 
55 
57 {
58  if(showOutput())
59  {
60  Ostream::write(str);
61  }
62  return *this;
63 }
64 
65 
67 (
68  const word& str,
69  const bool quoted
70 )
71 {
72  if(showOutput())
73  {
74  Ostream::writeQuoted(str, quoted);
75  }
76  return *this;
77 }
78 
79 
80 
82 {
83  if(showOutput())
84  {
85  Ostream::write(val);
86  }
87  return *this;
88 }
89 
90 
92 {
93  if(showOutput())
94  {
95  Ostream::write(val);
96  }
97  return *this;
98 }
99 
100 
102 {
103  if(showOutput())
104  {
105  Ostream::write(val);
106  }
107  return *this;
108 }
109 
111 {
112  if(showOutput())
113  {
114  Ostream::write(val);
115  }
116  return *this;
117 }
118 
120 {
121  if(showOutput())
122  {
123  Ostream::write(val);
124  }
125  return *this;
126 }
127 
129 {
130  if(showOutput())
131  {
132  Ostream::write(val);
133  }
134  return *this;
135 }
136 
138 {
139  if(showOutput())
140  {
141  Ostream::write(val);
142  }
143  return *this;
144 }
145 
146 
148 {
149  if(showOutput())
150  {
151  Ostream::write(val);
152  }
153  return *this;
154 }
155 
157 {
158  if(showOutput())
159  {
160  Ostream::write(val);
161  }
162  return *this;
163 }
164 
165 
167 (
168  const char* binaryData,
169  std::streamsize count
170 )
171 {
172  if(showOutput())
173  {
174  Ostream::write(binaryData, count);
175  }
176  return *this;
177 }
178 
179 
181 {
182 
183  if(showOutput())
184  {
185  Ostream::indent();
186  }
187 }
pFlow::Ostream::writeQuoted
iOstream & writeQuoted(const word &str, const bool quoted=true) override
Write std::string surrounded by quotes.
Definition: Ostream.cpp:108
pFlow::masterOstream::write
bool write(const token &tok)
Write token to stream or otherwise handle it.
Definition: masterOstream.hpp:75
pFlow::uint32
unsigned int uint32
Definition: builtinTypes.hpp:56
token.hpp
pFlow::word
std::string word
Definition: builtinTypes.hpp:64
pFlow::Ostream::indent
void indent() override
Add indentation characters.
Definition: Ostream.cpp:266
pFlow::int64
long long int int64
Definition: builtinTypes.hpp:52
pFlow::masterOstream::writeQuoted
iOstream & writeQuoted(const word &str, const bool quoted=true) override
Write std::string surrounded by quotes.
Definition: masterOstream.cpp:67
pFlow::masterOstream::showOutput
bool showOutput() const
Definition: masterOstream.hpp:46
pFlow::int32
int int32
Definition: builtinTypes.hpp:50
pFlow::count
auto count(const Vector< T, Allocator > &vec, const T &val)
Definition: VectorAlgorithm.hpp:26
pFlow::masterOstream::indent
void indent() override
Add indentation characters.
Definition: masterOstream.cpp:180
pFlow::uint64
unsigned long long int uint64
Definition: builtinTypes.hpp:58
pFlow::int8
signed char int8
Definition: builtinTypes.hpp:48
pFlow::masterOstream::masterOstream
masterOstream(std::ostream &os, const word &streamName)
From components.
Definition: masterOstream.cpp:27
pFlow::Ostream::write
bool write(const token &tok) override
Write token to stream or otherwise handle it.
Definition: Ostream.cpp:51
pFlow::Ostream
Standard output stream for BINARY and ASCII formats.
Definition: Ostream.hpp:39
pFlow::uint8
unsigned char uint8
Definition: builtinTypes.hpp:54
pFlow::iOstream
Interface class for any output stream.
Definition: iOstream.hpp:59
masterOstream.hpp