CUBRID Engine  latest
db_value_printer.hpp
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  * db_value_printer.hpp
21  *
22  * format db values
23  * common things (server & client) extracted from object_print
24  */
25 
26 #ifndef _DB_VALUE_PRINTER_HPP_
27 #define _DB_VALUE_PRINTER_HPP_
28 
29 #include <cstdio>
30 
31 struct db_set;
32 struct db_midxkey;
33 struct db_monetary;
34 struct db_value;
35 class string_buffer;
36 class print_output;
37 
39 {
40  private:
42  bool m_padding;
43  public:
44  static const char DECIMAL_FORMAT[];
45 
46  db_value_printer (string_buffer &buf, bool padding=false)
47  : m_buf (buf)
48  , m_padding (padding)
49  {}
50 
51  void describe_money (const db_monetary *value); //former describe_money(parser...)
52  void describe_value (const db_value *value); //former describe_value(parser...)
53  void describe_data (const db_value *value); //former describe_data(parser...)
54 
55  protected:
56  void describe_midxkey (const db_midxkey *midxkey, int help_Max_set_elements=20); //former describe_midxkey()
57  void describe_set (const db_set *set, int help_Max_set_elements=20); //former describe_set()
58 };
59 
60 void db_fprint_value (FILE *fp, const db_value *value);
61 void db_print_value (print_output &output_ctx, const db_value *value);
62 void db_sprint_value (const db_value *value, string_buffer &sb);
63 
64 #endif //_DB_VALUE_PRINTER_HPP_
string_buffer & m_buf
void describe_set(const db_set *set, int help_Max_set_elements=20)
void describe_midxkey(const db_midxkey *midxkey, int help_Max_set_elements=20)
void describe_data(const db_value *value)
void describe_value(const db_value *value)
void db_sprint_value(const db_value *value, string_buffer &sb)
void db_fprint_value(FILE *fp, const db_value *value)
Definition: db_set.h:35
void describe_money(const db_monetary *value)
void db_print_value(print_output &output_ctx, const db_value *value)
static const char DECIMAL_FORMAT[]
db_value_printer(string_buffer &buf, bool padding=false)