InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Persist::Serializer< T > Struct Template Reference

#include <IPMStream.h>

Static Public Member Functions

static void Read (IPMStream *stream, T &t)
 
static void Write (IPMStream *stream, const T &t)
 

Detailed Description

template<typename T>
struct Persist::Serializer< T >

Base template with static methods for reading and writing generic types.

If you simply need to use serialization utilities, use Persist::Read or Persist::Write functions below. The following implementation specifics are useful if you have a type that you want to provide serialization utilities for.

The default implementations of the static Read/Write methods call ReadWrite on the object to be read into/written.

If you need to override this behavior for a parameterized type such as std::pair, you should provide a template specialization with appropriate Read and Write implementations. See Serializer<std::pair> in PersistSTLTypes.h or Serializer<K2Vector> in PersistK2Types.h an example.

If you need to override this behavior for a non-parameterized type such as int32, you need not provide a template specialization for Serializer. Instead, you should do so for Persist::Read and Persist::Write methods as mentioned below.