Char type was converted to wchar_t and then was serialized as utf-8 stream.
Let char type will always be one char, of course it need to be a valid utf-8 sequence.
Let FT::dont_use_utf8 apply only to wchar_t and std::wstring
but ignore it if FT::hexadecimal or FT::binary are defined.
Now we have bool BaseExpression::esc_char(wchar_t val, pt::TextStream & stream) method
which (in most cases) will be used in derived classes.
Let wchar_t (and std::wstring) will be stored as 8 hex digits when using FT::hexadecimal
or FT::binary (and ignore FT::dont_use_utf8 in such a case).
added BaseObjectWrapper as base class for: SpaceWrapper and ModelContainerWrapper
removed: ModelWrapperModel, now one Model doesn't need a wrapper
renamed: ModelWrapperSpace -> SpaceWrapper, now as a base class it has BaseObjectWrapper
renamed: Model::get_model_wrapper() -> Model::get_wrapper() - now it returns Wrapper object
removed logging from Model::get_model() and Model::get_wrapper()
field() methods don't take ModelWrapper** but Wrapper& now
reported by clang with -fsanitize=undefined
main.cpp:55:63: runtime error: member access within address 0x614000000040 which does not point to an object of type 'Krolik'
0x614000000040: note: object is of type 'Item'
02 00 00 73 00 4e 75 00 00 00 00 00 a0 b9 ff ff ff 7f 00 00 c0 80 ff ff ff 7f 00 00 00 00 00 00
^~~~~~~~~~~~~~~~~~~~~~~
vptr for 'Item'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior main.cpp:55:63 in
main.cpp:55:97: runtime error: member access within address 0x614000000040 which does not point to an object of type 'Krolik'
0x614000000040: note: object is of type 'Item'
02 00 00 73 00 4e 75 00 00 00 00 00 a0 b9 ff ff ff 7f 00 00 c0 80 ff ff ff 7f 00 00 00 00 00 00
^~~~~~~~~~~~~~~~~~~~~~~
vptr for 'Item'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior main.cpp:55:97 in
- pikotools is in src subdirectory now
- map_fields() -> fields()
- prepare_table() -> table()
- instead of pt::MainSpaceParser we have pt::MainOptionsParser now
- 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 &)
added to Model:
- method field() which can take a pointer to a member which returns bool:
void field(const wchar_t * field_name, bool (ClassName::*method)(), const morm::FT & field_type = morm::FT::default_type)
- method field() which can take a pointer to a member which can set morm::ModelWrapper object
void field(const wchar_t * field_name, void (ClassName::*method)(morm::ModelWrapper **), const morm::FT & field_type = morm::FT::default_type)
- methods: bool Model::convert_to_bool(...) - they are used for creating a result for ezc from local fields
- removed MORM_WORK_MODE_GET_SPECIFIC_FIELD_VALUE from expression work mode
- removed: void BaseExpression::field(const wchar_t * field_name, void (Model::*getter_method)(pt::TextStream &), const FT & field_type, ModelEnv * model_env)
- removed from BaseExpression: template<typename FunInfoStreamType> void field(const wchar_t * field_name, void (Model::*fun)(Ezc::FunInfo<FunInfoStreamType> &), const FT & field_type, ModelEnv * model_env)
- removed: void FlatConnector::to_text(const wchar_t * flat_field_name, pt::TextStream & stream, Model & model)
- renamed/changed: Model::put_field_value(...) -> Model::get_raw_value()
added classes:
class ModelWrapper - base wrapper class for a model or a model container
class ModelWrapperModel : public ModelWrapper - wrapper for a model
template<typename VectorType> class ModelWrapperVector : public ModelWrapper - wrapper for vector of models
template<typename ListType> class ModelWrapperList : public ModelWrapper - wrapper for list of models
ModelWrapper... classes are used by ezc library for iterating through child models and for iterating in [for...] statements
added to Model:
Model * get_model(const wchar_t * db_field_name, const wchar_t * flat_field_name, bool put_log_if_not_found = true);
ModelWrapper * get_model_wrapper(const wchar_t * db_field_name, const wchar_t * flat_field_name, bool put_log_if_not_found = true);
those functions can be used with databases and flat files
- removed support for calling static function
- if MORM_HAS_EZC_LIBRARY macro is defined then we can call a function
which has a first argument Ezc::FunInfo<>& object
(only for generating flat files)