29 #ifndef Pt_Formatter_h
30 #define Pt_Formatter_h
33 #include <Pt/String.h>
54 void addString(
const std::string& name,
const std::string& type,
55 const Pt::String& value,
const std::string&
id)
61 const Pt::Char* value,
const char*
id)
66 void addBinary(
const std::string& name,
const std::string& type,
67 const char* value, std::size_t length,
const std::string&
id)
68 {
onAddBinary(name.c_str(), type.c_str(), value, length,
id.c_str()); }
73 const char* value, std::size_t length,
const char*
id)
78 void addBool(
const std::string& name,
bool value,
79 const std::string&
id)
80 {
onAddBool(name.c_str(), value,
id.c_str()); }
84 void addBool(
const char* name,
bool value,
91 const std::string&
id)
92 {
onAddChar(name.c_str(), value,
id.c_str()); }
103 const std::string&
id)
104 {
onAddInt8(name.c_str(), value,
id.c_str()); }
115 const std::string&
id)
116 {
onAddInt16(name.c_str(), value,
id.c_str()); }
127 const std::string&
id)
128 {
onAddInt32(name.c_str(), value,
id.c_str()); }
139 const std::string&
id)
140 {
onAddInt64(name.c_str(), value,
id.c_str()); }
151 const std::string&
id)
152 {
onAddUInt8(name.c_str(), value,
id.c_str()); }
163 const std::string&
id)
175 const std::string&
id)
187 const std::string&
id)
198 void addFloat(
const std::string& name,
float value,
199 const std::string&
id)
200 {
onAddFloat(name.c_str(), value,
id.c_str()); }
211 const std::string&
id)
223 const std::string&
id)
244 void beginStruct(
const std::string& name,
const std::string& type,
245 const std::string&
id)
277 const std::string&
id)
303 void beginDict(
const std::string& name,
const std::string& type,
304 const std::string&
id)
305 {
onBeginDict(name.c_str(), type.c_str(),
id.c_str()); }
364 virtual void onAddString(
const char* name,
const char* type,
365 const Pt::Char* value,
const char*
id) = 0;
369 virtual void onAddBinary(
const char* name,
const char* type,
370 const char* value, std::size_t length,
const char*
id) = 0;
374 virtual void onAddBool(
const char* name,
bool value,
424 virtual void onAddFloat(
const char* name,
float value,
429 virtual void onAddDouble(
const char* name,
double value,
439 virtual void onAddReference(
const char* name,
const char* refId) = 0;
443 virtual void onBeginStruct(
const char* name,
const char* type,
uint_type uint16_t
Unsigned 16-bit integer type.
Definition: Types.h:30
int_type int16_t
Signed 16-bit integer type.
Definition: Types.h:24
Composes types during serialization.
Definition: Composer.h:42
const Pt::Char * c_str() const
Returns a null terminated C string.
Definition: String.h:264
int_type int32_t
Signed 32-bit integer type.
Definition: Types.h:36
Unicode character type.
Definition: String.h:66
int_type int64_t
Signed 64-bit integer type.
Definition: Types.h:48
int_type int8_t
Signed 8-bit integer type.
Definition: Types.h:12
uint_type uint64_t
Unsigned 64-bit integer type.
Definition: Types.h:54
Unicode capable basic_string.
Definition: String.h:42
uint_type uint32_t
Unsigned 32-bit integer type.
Definition: Types.h:42
uint_type uint8_t
Unsigned 8-bit integer type.
Definition: Types.h:18