namespace PT renamed to pt

This commit is contained in:
2021-05-20 16:25:01 +02:00
parent b12037a7e5
commit 34274ca230
32 changed files with 383 additions and 383 deletions

View File

@@ -60,14 +60,14 @@ public:
virtual void set_work_mode(int work_mode);
virtual int get_work_mode();
virtual PT::TextStream * get_text_stream();
virtual void set_text_stream(PT::TextStream * out_stream);
virtual pt::TextStream * get_text_stream();
virtual void set_text_stream(pt::TextStream * out_stream);
virtual void clear();
virtual void generate_from_model(PT::TextStream & stream, Model & model);
virtual void generate_from_model(pt::TextStream & stream, Model & model);
virtual PT::TextStream * get_current_stream();
virtual pt::TextStream * get_current_stream();
// rename me
virtual void allow_to_use_prefix(bool use_prefix);
@@ -143,21 +143,21 @@ public:
}
template<typename FieldValue>
void field_in(PT::TextStream & stream, const wchar_t * field_name, const std::set<FieldValue> & container, ModelEnv * model_env)
void field_in(pt::TextStream & stream, const wchar_t * field_name, const std::set<FieldValue> & container, ModelEnv * model_env)
{
field_in_generic<FieldValue, std::set<FieldValue>>(stream, field_name, container, model_env);
}
template<typename FieldValue>
void field_in(PT::TextStream & stream, const wchar_t * field_name, const std::list<FieldValue> & container, ModelEnv * model_env)
void field_in(pt::TextStream & stream, const wchar_t * field_name, const std::list<FieldValue> & container, ModelEnv * model_env)
{
field_in_generic<FieldValue, std::list<FieldValue>>(stream, field_name, container, model_env);
}
template<typename FieldValue>
void field_in(PT::TextStream & stream, const wchar_t * field_name, const std::vector<FieldValue> & container, ModelEnv * model_env)
void field_in(pt::TextStream & stream, const wchar_t * field_name, const std::vector<FieldValue> & container, ModelEnv * model_env)
{
field_in_generic<FieldValue, std::vector<FieldValue>>(stream, field_name, container, model_env);
}
@@ -215,7 +215,7 @@ public:
}
template<typename FieldValue>
void field_to_stream(PT::TextStream & stream, const wchar_t * field_name, const FieldValue & field_value, const FT & field_type, ModelEnv * model_env)
void field_to_stream(pt::TextStream & stream, const wchar_t * field_name, const FieldValue & field_value, const FT & field_type, ModelEnv * model_env)
{
this->out_stream = &stream;
field(field_name, field_value, field_type, model_env);
@@ -224,26 +224,26 @@ public:
virtual void put_schema_table(const wchar_t * schema_name, const wchar_t * table_name);
virtual void put_schema_table(const PT::WTextStream & schema_name, const PT::WTextStream & table_name);
virtual void put_schema_table(const pt::WTextStream & schema_name, const pt::WTextStream & table_name);
virtual void put_table(const wchar_t * table_name);
virtual void put_table(const PT::WTextStream & table_name);
virtual void put_table(const pt::WTextStream & table_name);
virtual void put_table_with_index(const wchar_t * table_name, int index);
virtual void put_table_with_index(const PT::WTextStream & table_name, int index);
virtual void put_table_with_index(const pt::WTextStream & table_name, int index);
virtual void put_table_with_index_and_field(const wchar_t * table_name, int index, const wchar_t * field_name, const FT & field_type);
virtual void put_table_with_index_and_field(const PT::WTextStream & table_name, int index, const wchar_t * field_name, const FT & field_type);
virtual void put_table_with_index_and_field(const pt::WTextStream & table_name, int index, const wchar_t * field_name, const FT & field_type);
virtual void put_table_and_field(const wchar_t * table_name, const wchar_t * field_name, const FT & field_type);
virtual void put_table_and_field(const PT::WTextStream & table_name, const wchar_t * field_name, const FT & field_type);
virtual void put_table_and_field(const pt::WTextStream & table_name, const wchar_t * field_name, const FT & field_type);
virtual void schema_table_to_stream(PT::TextStream & stream, const wchar_t * schema_name, const wchar_t * table_name);
virtual void schema_table_to_stream(PT::TextStream & stream, const PT::WTextStream & schema_name, const PT::WTextStream & table_name);
virtual void table_to_stream(PT::TextStream & stream, const wchar_t * table_name);
virtual void table_to_stream(PT::TextStream & stream, const PT::WTextStream & table_name);
virtual void table_with_index_to_stream(PT::TextStream & stream, const wchar_t * table_name, int index);
virtual void table_with_index_to_stream(PT::TextStream & stream, const PT::WTextStream & table_name, int index);
virtual void table_with_index_and_field_to_stream(PT::TextStream & stream, const wchar_t * table_name, int index, const wchar_t * field_name, const FT & field_type);
virtual void table_with_index_and_field_to_stream(PT::TextStream & stream, const PT::WTextStream & table_name, int index, const wchar_t * field_name, const FT & field_type);
virtual void table_and_field_to_stream(PT::TextStream & stream, const wchar_t * table_name, const wchar_t * field_name, const FT & field_type);
virtual void table_and_field_to_stream(PT::TextStream & stream, const PT::WTextStream & table_name, const wchar_t * field_name, const FT & field_type);
virtual void schema_table_to_stream(pt::TextStream & stream, const wchar_t * schema_name, const wchar_t * table_name);
virtual void schema_table_to_stream(pt::TextStream & stream, const pt::WTextStream & schema_name, const pt::WTextStream & table_name);
virtual void table_to_stream(pt::TextStream & stream, const wchar_t * table_name);
virtual void table_to_stream(pt::TextStream & stream, const pt::WTextStream & table_name);
virtual void table_with_index_to_stream(pt::TextStream & stream, const wchar_t * table_name, int index);
virtual void table_with_index_to_stream(pt::TextStream & stream, const pt::WTextStream & table_name, int index);
virtual void table_with_index_and_field_to_stream(pt::TextStream & stream, const wchar_t * table_name, int index, const wchar_t * field_name, const FT & field_type);
virtual void table_with_index_and_field_to_stream(pt::TextStream & stream, const pt::WTextStream & table_name, int index, const wchar_t * field_name, const FT & field_type);
virtual void table_and_field_to_stream(pt::TextStream & stream, const wchar_t * table_name, const wchar_t * field_name, const FT & field_type);
virtual void table_and_field_to_stream(pt::TextStream & stream, const pt::WTextStream & table_name, const wchar_t * field_name, const FT & field_type);
/*
@@ -251,35 +251,35 @@ public:
* esc for: signed char, wchar_t, char16_t, char32_t
*
*/
virtual void esc(char val, PT::TextStream & stream, const FT & field_type = FT::default_type);
virtual void esc(unsigned char val, PT::TextStream & stream, const FT & field_type = FT::default_type);
virtual void esc(char val, pt::TextStream & stream, const FT & field_type = FT::default_type);
virtual void esc(unsigned char val, pt::TextStream & stream, const FT & field_type = FT::default_type);
virtual void esc(wchar_t val, PT::TextStream & stream, const FT & field_type = FT::default_type);
virtual void esc(wchar_t val, pt::TextStream & stream, const FT & field_type = FT::default_type);
virtual void esc(const std::wstring & val, PT::TextStream & stream, const FT & field_type = FT::default_type);
virtual void esc(const wchar_t * val, PT::TextStream & stream, const FT & field_type = FT::default_type);
virtual void esc(const std::wstring & val, pt::TextStream & stream, const FT & field_type = FT::default_type);
virtual void esc(const wchar_t * val, pt::TextStream & stream, const FT & field_type = FT::default_type);
virtual void esc(const std::string & val, PT::TextStream & stream, const FT & field_type = FT::default_type);
virtual void esc(const char * val, PT::TextStream & stream, const FT & field_type = FT::default_type);
virtual void esc(const std::string & val, pt::TextStream & stream, const FT & field_type = FT::default_type);
virtual void esc(const char * val, pt::TextStream & stream, const FT & field_type = FT::default_type);
virtual void esc(bool val, PT::TextStream & stream, const FT & field_type = FT::default_type);
virtual void esc(short val, PT::TextStream & stream, const FT & field_type = FT::default_type);
virtual void esc(unsigned short val, PT::TextStream & stream, const FT & field_type = FT::default_type);
virtual void esc(int val, PT::TextStream & stream, const FT & field_type = FT::default_type);
virtual void esc(unsigned int val, PT::TextStream & stream, const FT & field_type = FT::default_type);
virtual void esc(long val, PT::TextStream & stream, const FT & field_type = FT::default_type);
virtual void esc(unsigned long val, PT::TextStream & stream, const FT & field_type = FT::default_type);
virtual void esc(long long val, PT::TextStream & stream, const FT & field_type = FT::default_type);
virtual void esc(unsigned long long val, PT::TextStream & stream, const FT & field_type = FT::default_type);
virtual void esc(float val, PT::TextStream & stream, const FT & field_type = FT::default_type);
virtual void esc(double val, PT::TextStream & stream, const FT & field_type = FT::default_type);
virtual void esc(long double val, PT::TextStream & stream, const FT & field_type = FT::default_type);
//virtual void esc(void* val, PT::TextStream & stream);
virtual void esc(bool val, pt::TextStream & stream, const FT & field_type = FT::default_type);
virtual void esc(short val, pt::TextStream & stream, const FT & field_type = FT::default_type);
virtual void esc(unsigned short val, pt::TextStream & stream, const FT & field_type = FT::default_type);
virtual void esc(int val, pt::TextStream & stream, const FT & field_type = FT::default_type);
virtual void esc(unsigned int val, pt::TextStream & stream, const FT & field_type = FT::default_type);
virtual void esc(long val, pt::TextStream & stream, const FT & field_type = FT::default_type);
virtual void esc(unsigned long val, pt::TextStream & stream, const FT & field_type = FT::default_type);
virtual void esc(long long val, pt::TextStream & stream, const FT & field_type = FT::default_type);
virtual void esc(unsigned long long val, pt::TextStream & stream, const FT & field_type = FT::default_type);
virtual void esc(float val, pt::TextStream & stream, const FT & field_type = FT::default_type);
virtual void esc(double val, pt::TextStream & stream, const FT & field_type = FT::default_type);
virtual void esc(long double val, pt::TextStream & stream, const FT & field_type = FT::default_type);
//virtual void esc(void* val, pt::TextStream & stream);
virtual void esc(const PT::Date & date, PT::TextStream & stream, const FT & field_type = FT::default_type);
virtual void esc(const PT::TextStream & val,PT::TextStream & stream, const FT & field_type = FT::default_type);
virtual void esc(const PT::WTextStream & val,PT::TextStream & stream, const FT & field_type = FT::default_type);
virtual void esc(const PT::Space & space, PT::TextStream & stream, const FT & field_type = FT::default_type);
virtual void esc(const pt::Date & date, pt::TextStream & stream, const FT & field_type = FT::default_type);
virtual void esc(const pt::TextStream & val,pt::TextStream & stream, const FT & field_type = FT::default_type);
virtual void esc(const pt::WTextStream & val,pt::TextStream & stream, const FT & field_type = FT::default_type);
virtual void esc(const pt::Space & space, pt::TextStream & stream, const FT & field_type = FT::default_type);
@@ -288,7 +288,7 @@ protected:
int work_mode; /* what to do: generating fields list, values list or fields-values list */
bool is_first_field;
PT::TextStream * out_stream;
pt::TextStream * out_stream;
bool use_prefix;
@@ -485,7 +485,7 @@ protected:
put_field_value_list_non_model(field_value, model_connector);
}
void put_field_value_list(std::vector<PT::Date> & field_value, ModelConnector * model_connector, ModelEnv *)
void put_field_value_list(std::vector<pt::Date> & field_value, ModelConnector * model_connector, ModelEnv *)
{
put_field_value_list_non_model(field_value, model_connector);
}
@@ -574,7 +574,7 @@ protected:
put_field_value_list_non_model(field_value, model_connector);
}
void put_field_value_list(std::list<PT::Date> & field_value, ModelConnector * model_connector, ModelEnv *)
void put_field_value_list(std::list<pt::Date> & field_value, ModelConnector * model_connector, ModelEnv *)
{
put_field_value_list_non_model(field_value, model_connector);
}
@@ -583,7 +583,7 @@ protected:
// used in 'in()' statements, may should be renamed?
template<typename FieldValue, typename Container>
void field_in_generic(PT::TextStream & stream, const wchar_t * field_name, const Container & container, ModelEnv * model_env)
void field_in_generic(pt::TextStream & stream, const wchar_t * field_name, const Container & container, ModelEnv * model_env)
{
// IMPROVE ME
// what about if container is empty?
@@ -645,11 +645,11 @@ protected:
virtual void before_field_value(char, const FT & field_type);
virtual void after_field_value(char, const FT & field_type);
virtual void before_field_value(const PT::Date &, const FT & field_type);
virtual void after_field_value(const PT::Date &, const FT & field_type);
virtual void before_field_value(const pt::Date &, const FT & field_type);
virtual void after_field_value(const pt::Date &, const FT & field_type);
virtual void before_field_value(const PT::Space &, const FT & field_type);
virtual void after_field_value(const PT::Space &, const FT & field_type);
virtual void before_field_value(const pt::Space &, const FT & field_type);
virtual void after_field_value(const pt::Space &, const FT & field_type);
template<typename FieldValue>
void before_field_value(const FieldValue &, const FT & field_type)
@@ -669,40 +669,40 @@ protected:
* put_type for: signed char, wchar_t, char16_t, char32_t
*
*/
// virtual void put_type(char val, PT::TextStream & stream);
// virtual void put_type(unsigned char val, PT::TextStream & stream);
// virtual void put_type(char val, pt::TextStream & stream);
// virtual void put_type(unsigned char val, pt::TextStream & stream);
//
// virtual void put_type(const std::wstring & val, PT::TextStream & stream);
// virtual void put_type(const wchar_t * val, PT::TextStream & stream);
// virtual void put_type(const std::wstring & val, pt::TextStream & stream);
// virtual void put_type(const wchar_t * val, pt::TextStream & stream);
//
// virtual void put_type(const std::string & val, PT::TextStream & stream);
// virtual void put_type(const char * val, PT::TextStream & stream);
// virtual void put_type(const std::string & val, pt::TextStream & stream);
// virtual void put_type(const char * val, pt::TextStream & stream);
//
// virtual void put_type(bool val, PT::TextStream & stream);
// virtual void put_type(short val, PT::TextStream & stream);
// virtual void put_type(unsigned short val, PT::TextStream & stream);
// virtual void put_type(int val, PT::TextStream & stream);
// virtual void put_type(unsigned int val, PT::TextStream & stream);
// virtual void put_type(long val, PT::TextStream & stream);
// virtual void put_type(unsigned long val, PT::TextStream & stream);
// virtual void put_type(long long val, PT::TextStream & stream);
// virtual void put_type(unsigned long long val, PT::TextStream & stream);
// virtual void put_type(float val, PT::TextStream & stream);
// virtual void put_type(double val, PT::TextStream & stream);
// virtual void put_type(long double val, PT::TextStream & stream);
//virtual void put_type(void* val, PT::TextStream & stream);
// virtual void put_type(bool val, pt::TextStream & stream);
// virtual void put_type(short val, pt::TextStream & stream);
// virtual void put_type(unsigned short val, pt::TextStream & stream);
// virtual void put_type(int val, pt::TextStream & stream);
// virtual void put_type(unsigned int val, pt::TextStream & stream);
// virtual void put_type(long val, pt::TextStream & stream);
// virtual void put_type(unsigned long val, pt::TextStream & stream);
// virtual void put_type(long long val, pt::TextStream & stream);
// virtual void put_type(unsigned long long val, pt::TextStream & stream);
// virtual void put_type(float val, pt::TextStream & stream);
// virtual void put_type(double val, pt::TextStream & stream);
// virtual void put_type(long double val, pt::TextStream & stream);
//virtual void put_type(void* val, pt::TextStream & stream);
// virtual void put_type(const PT::Date & date, PT::TextStream & stream);
// virtual void put_type(const Model & model, PT::TextStream & stream);
// virtual void put_type(const pt::Date & date, pt::TextStream & stream);
// virtual void put_type(const Model & model, pt::TextStream & stream);
//
// template<typename ListType>
// void put_type(const std::list<ListType> & model, PT::TextStream & stream)
// void put_type(const std::list<ListType> & model, pt::TextStream & stream)
// {
// stream << "table"; // may just use std::list?
// }
//
// template<typename ListType>
// void put_type(const std::vector<ListType> & model, PT::TextStream & stream)
// void put_type(const std::vector<ListType> & model, pt::TextStream & stream)
// {
// stream << "table"; // may just just std::vector?
// }
@@ -713,9 +713,9 @@ protected:
virtual void after_field_value_string(const FT & field_type);
char char_to_hex_part(char c);
void char_to_hex(char c, PT::TextStream & stream);
void char_to_hex(char c, pt::TextStream & stream);
void esc(const wchar_t * val, bool has_known_length, size_t len, PT::TextStream & stream, const FT & field_type = FT::default_type);
void esc(const wchar_t * val, bool has_known_length, size_t len, pt::TextStream & stream, const FT & field_type = FT::default_type);
bool is_empty_field(const wchar_t * value);
};