fixed: getters method (Model::*getter_method)(pt::Stream &) produced boolean value when serializing to flat string

- changed in Model::field_list_generic(...): message "you should set FT::is_foreign_key or FT::is_foreign_key_in_child flag" print only
  for work mode MORM_MODEL_WORK_MODE_SET_PARENT_ID or MORM_MODEL_WORK_MODE_ITERATE_THROUGH_CHILDS_WITHOUT_FOREIGN_KEY
- pt::TextStream::to_string(...) is now pt::TextStream::to_str(...)
- in Model::get_raw_value() for ezc 'pt::TextStream & stream' changed to 'pt::Stream & stream' (a base class of pt::TextStream)
  similar in field(...) methods which take getters: void (Model::*getter_method)(pt::TextStream &) -> void (Model::*getter_method)(pt::Stream &)
This commit is contained in:
2021-06-20 17:49:54 +02:00
parent aba454a4bf
commit a8fe798279
8 changed files with 96 additions and 54 deletions

View File

@@ -220,7 +220,7 @@ void BaseExpression::save_foreign_key(const wchar_t * field_name, const FT & fie
{
model_env->finder_helper->foreign_keys.emplace_back();
std::string & key_str = model_env->finder_helper->foreign_keys.back();
str.to_string(key_str, false);
str.to_str(key_str, false);
}
}
@@ -408,6 +408,7 @@ void BaseExpression::esc(wchar_t val, pt::TextStream & stream, const FT & field_
{
char utf8_buf[10];
// FIXME surrogate pairs are not used
size_t utf8_len = pt::int_to_utf8((int)val, utf8_buf, sizeof(utf8_buf));
for(size_t a = 0 ; a < utf8_len ; ++a)
@@ -430,6 +431,7 @@ void BaseExpression::esc(const wchar_t * val, bool has_known_length, size_t len,
for(size_t i = 0 ; has_known_length ? (i < len) : val[i] != 0 ; ++i)
{
// FIXME surrogate pairs are not used
size_t utf8_len = pt::int_to_utf8((int)val[i], utf8_buf, sizeof(utf8_buf));
for(size_t a = 0 ; a < utf8_len ; ++a)