CUBRID Engine
latest
Main Page
Namespaces
Classes
Files
File List
File Members
printer.cpp
Go to the documentation of this file.
1
/*
2
* Copyright 2008 Search Solution Corporation
3
* Copyright 2016 CUBRID Corporation
4
*
5
* Licensed under the Apache License, Version 2.0 (the "License");
6
* you may not use this file except in compliance with the License.
7
* You may obtain a copy of the License at
8
*
9
* http://www.apache.org/licenses/LICENSE-2.0
10
*
11
* Unless required by applicable law or agreed to in writing, software
12
* distributed under the License is distributed on an "AS IS" BASIS,
13
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
* See the License for the specific language governing permissions and
15
* limitations under the License.
16
*
17
*/
18
19
/*
20
* printer.cpp - printing classes
21
*/
22
23
#include "
printer.hpp
"
24
25
void
print_output::operator+=
(
const
char
ch)
26
{
27
m_sb
.operator+= (ch);
28
(void)
flush
();
29
}
30
31
file_print_output::file_print_output
(FILE *fp) :
32
output_file
(fp)
33
{
34
}
35
36
file_print_output
&
file_print_output::std_output
(
void
)
37
{
38
static
file_print_output
s_std_output (stdout);
39
return
s_std_output;
40
}
41
42
int
file_print_output::flush
()
43
{
44
int
res = (int) fwrite (
m_sb
.
get_buffer
(), 1,
m_sb
.
len
(),
output_file
);
45
m_sb
.
clear
();
46
return
res;
47
}
48
49
50
string_print_output::string_print_output
()
51
{
52
}
53
54
int
string_print_output::flush
()
55
{
56
return
(
int
)
m_sb
.
len
();
57
}
print_output::m_sb
string_buffer m_sb
Definition:
printer.hpp:37
file_print_output::file_print_output
file_print_output(FILE *fp)
Definition:
printer.cpp:31
print_output::flush
virtual int flush(void)=0
output_file
FILE * output_file
Definition:
unloaddb.c:48
file_print_output::std_output
static file_print_output & std_output(void)
Definition:
printer.cpp:36
file_print_output::output_file
FILE * output_file
Definition:
printer.hpp:75
file_print_output::flush
int flush(void)
Definition:
printer.cpp:42
print_output::operator+=
void operator+=(const char ch)
Definition:
printer.cpp:25
string_buffer::get_buffer
const char * get_buffer() const
Definition:
string_buffer.hpp:73
string_buffer::len
size_t len() const
Definition:
string_buffer.hpp:87
file_print_output
Definition:
printer.hpp:72
printer.hpp
string_buffer::clear
void clear()
Definition:
string_buffer.hpp:78
string_print_output::string_print_output
string_print_output()
Definition:
printer.cpp:50
string_print_output::flush
int flush(void)
Definition:
printer.cpp:54
src
base
printer.cpp
Generated by
1.8.11