add a TextStreamBase<>::operator<<(morm::Model & model)

This commit is contained in:
2024-05-29 16:37:53 +02:00
parent f35e2122ed
commit 5fd17175c1
5 changed files with 172 additions and 14 deletions

View File

@@ -43,11 +43,13 @@
#include "membuffer/membuffer.h"
#include "types.h"
#include "utf8/utf8.h"
#include "stream_private.h"
// for snprintf
#include <cstdio>
namespace pt
{
@@ -194,6 +196,10 @@ public:
TextStreamBase & operator<<(const Space & space);
TextStreamBase & operator<<(const Date & date);
#ifdef PT_HAS_MORM_LIBRARY
TextStreamBase & operator<<(morm::Model & model);
#endif
template<typename arg_char_type, size_t arg_stack_size, size_t arg_heap_block_size>
TextStreamBase & operator<<(const TextStreamBase<arg_char_type, arg_stack_size, arg_heap_block_size> & arg);
@@ -1200,6 +1206,23 @@ return *this;
}
#ifdef PT_HAS_MORM_LIBRARY
template<typename char_type, size_t stack_size, size_t heap_block_size>
TextStreamBase<char_type, stack_size, heap_block_size> &
TextStreamBase<char_type, stack_size, heap_block_size>::operator<<(morm::Model & model)
{
private_namespace::serialize_to_stream(model, *this);
return *this;
}
#endif
template<typename char_type, size_t stack_size, size_t heap_block_size>
template<typename arg_char_type, size_t arg_stack_size, size_t arg_heap_block_size>
TextStreamBase<char_type, stack_size, heap_block_size> &