add Model::field(...) methods with a pt::Stream argument

This commit is contained in:
2024-06-04 10:24:05 +02:00
parent 90b4d9af0b
commit cd067ae5c3
9 changed files with 145 additions and 11 deletions

View File

@@ -367,10 +367,23 @@ public:
{
if( val.is_char_stream() )
{
// from utf8 to utf8 or from utf8 to wide
pt::utf8_to_output_function(val, [&](int z) {
esc(static_cast<char32_t>(z), stream, field_type, model_env);
});
if( field_type.is_hexadecimal() || field_type.is_binary() )
{
typename pt::TextStreamBase<char_type, stack_size, heap_block_size>::const_iterator start = val.begin();
typename pt::TextStreamBase<char_type, stack_size, heap_block_size>::const_iterator end = val.end();
for( ; start != end ; ++start )
{
esc(static_cast<char>(*start), stream, field_type, model_env);
}
}
else
{
// from utf8 to utf8 or from utf8 to wide
pt::utf8_to_output_function(val, [&](int z) {
esc(static_cast<char32_t>(z), stream, field_type, model_env);
});
}
}
else
if( val.is_wchar_stream() )