InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Persist Namespace Reference

Classes

struct  Serializer
 
struct  Serializer< adobe::vector< T > >
 
struct  Serializer< IDType< T > >
 
struct  Serializer< K2Pair< _T1, _T2 > >
 
struct  Serializer< KeyValuePair< _T1, _T2 > >
 
struct  Serializer< K2Vector< T > >
 
struct  Serializer< std::pair< _T1, _T2 > >
 
struct  Serializer< std::vector< T > >
 
struct  Serializer< std::map< _KeyType, _DataType > >
 

Functions

template<>
void Read< InterfaceInfo > (IPMStream *stream, InterfaceInfo &entry)
 
template<>
void Write< InterfaceInfo > (IPMStream *stream, const InterfaceInfo &entry)
 
template<typename T >
void Read (IPMStream *stream, T &t)
 
template<typename T >
void Write (IPMStream *stream, const T &t)
 
template<>
void Read< uint8 > (IPMStream *stream, uint8 &n)
 
template<>
void Write< uint8 > (IPMStream *stream, const uint8 &n)
 
template<>
void Read< uint16 > (IPMStream *stream, uint16 &n)
 
template<>
void Write< uint16 > (IPMStream *stream, const uint16 &n)
 
template<>
void Read< uint32 > (IPMStream *stream, uint32 &n)
 
template<>
void Write< uint32 > (IPMStream *stream, const uint32 &n)
 
template<>
void Read< uint64 > (IPMStream *stream, uint64 &i)
 
template<>
void Write< uint64 > (IPMStream *stream, const uint64 &i)
 
template<>
void Read< int16 > (IPMStream *stream, int16 &i)
 
template<>
void Write< int16 > (IPMStream *stream, const int16 &i)
 
template<>
void Read< int32 > (IPMStream *stream, int32 &i)
 
template<>
void Write< int32 > (IPMStream *stream, const int32 &i)
 
template<>
void Read< int64 > (IPMStream *stream, int64 &i)
 
template<>
void Write< int64 > (IPMStream *stream, const int64 &i)
 
template<>
void Read< PMReal > (IPMStream *stream, PMReal &n)
 
template<>
void Write< PMReal > (IPMStream *stream, const PMReal &n)
 
template<>
void Read< PMPoint > (IPMStream *stream, PMPoint &n)
 
template<>
void Write< PMPoint > (IPMStream *stream, const PMPoint &n)
 
template<>
void Read (IPMStream *stream, PMRect &n)
 
template<>
void Write (IPMStream *stream, const PMRect &n)
 
template<>
void Read< UTF32TextChar > (IPMStream *stream, UTF32TextChar &u)
 
template<>
void Write< UTF32TextChar > (IPMStream *stream, const UTF32TextChar &u)
 
template<>
void Read (IPMStream *stream, std::string &str)
 
template<>
void Write (IPMStream *stream, const std::string &str)
 

Detailed Description

Read/Write template specializations for base types. These functions follow the recipe for implementing serialization utilities for non-parameterized types as outlined in IPMStream.h.

Users of these functions need not concern themselves with these implementation specifics. They can simply make calls such as Persist::Read (stream, myUint8) or Persist::Write (stream, myInt32).

Note: We do not provide the same for base types that are platform-dependent, such as bool, wchar_t, size_t.

Serializer template specializations for K2 types. These structs follow the recipe for implementing serialization utilities for parameterized types as outlined in IPMStream.h.

Users of these utilities need not concern themselves with these implementation specifics. They can simply make calls such as Persist::Read (stream, myK2Pair) or Persist::Write (stream, myK2Vector).

Serializer and Read/Write template specializations for STL types. These structs and functions follow the recipes for implementing serialization utilities for parameterized and non-parameterized types respectively as outlined in IPMStream.h.

Users of these utilities need not concern themselves with these implementation specifics. They can simply make calls such as Persist::Read (stream, mySTLPair) or Persist::Write (stream, mySTLString).

Function Documentation

template<>
void Persist::Read (IPMStreamstream,
std::string & str 
)
inline

Specializes template function Read for an std::string.

Parameters
streamIN The stream to read from.
strOUT The std::string being to read into.
template<>
void Persist::Read (IPMStreamstream,
PMRectn 
)
inline

Specializes template function Read for a PMRect.

Parameters
streamIN The stream to read from.
nOUT The PMRect being to read into.
template<typename T >
void Persist::Read (IPMStreamstream,
T & t 
)
inline

A template function for reading a generic type.

Parameters
streamIN The stream to read from.
tOUT The object to read into.

Usage is straightforward; for example Persist::Read(stream, myInt32). The following implementation specifics can be ignored unless you have a type that you want to provide serialization utilities for.

The default implementation of this method calls ReadWrite on the object to be read into.

If you need to override this behavior for a non-parameterized type such as int32, you should provide a template specialization with the appropriate implementation. See Read<int32> in PersistBaseTypes.h for an example. DO NOT PROVIDE A NON-TEMPLATE OVERLOAD FOR THIS METHOD.

If you need to override this behavior for a parameterized type such as std::pair, you would instead need to provide a template specialization for Serializer as mentioned above.

template<>
void Persist::Read< int16 > (IPMStreamstream,
int16 & i 
)
inline

Specializes template function Read for an int16.

Parameters
streamIN The stream to read from.
iOUT The int16 being to read into.
template<>
void Persist::Read< int32 > (IPMStreamstream,
int32 & i 
)
inline

Specializes template function Read for an int32.

Parameters
streamIN The stream to read from.
iOUT The int32 being to read into.
template<>
void Persist::Read< int64 > (IPMStreamstream,
int64 & i 
)
inline

Specializes template function Read for an int64.

Parameters
streamIN The stream to read from.
iOUT The int64 being to read into.
template<>
void Persist::Read< PMPoint > (IPMStreamstream,
PMPointn 
)
inline

Specializes template function Read for a PMPoint.

Parameters
streamIN The stream to read from.
nOUT The PMPoint being to read into.
template<>
void Persist::Read< PMReal > (IPMStreamstream,
PMRealn 
)
inline

Specializes template function Read for a PMReal.

Parameters
streamIN The stream to read from.
nOUT The PMReal being to read into.
template<>
void Persist::Read< uint16 > (IPMStreamstream,
uint16 & n 
)
inline

Specializes template function Read for a uint16.

Parameters
streamIN The stream to read from.
nOUT The uint16 being to read into.
template<>
void Persist::Read< uint32 > (IPMStreamstream,
uint32 & n 
)
inline

Specializes template function Read for a uint32.

Parameters
streamIN The stream to read from.
nOUT The uint32 being to read into.
template<>
void Persist::Read< uint64 > (IPMStreamstream,
uint64 & i 
)
inline

Specializes template function Read for an uint64.

Parameters
streamIN The stream to read from.
iOUT The int64 being to read into.
template<>
void Persist::Read< uint8 > (IPMStreamstream,
uint8 & n 
)
inline

Specializes template function Read for a uint8.

Parameters
streamIN The stream to read from.
nOUT The uint8 being to read into.
template<>
void Persist::Read< UTF32TextChar > (IPMStreamstream,
UTF32TextCharu 
)
inline

Specializes template function Read for a UTF32TextChar.

Parameters
streamIN The stream to read from.
uOUT The UTF32TextChar being to read into.
template<>
void Persist::Write (IPMStreamstream,
const std::string & str 
)
inline

Specializes template function Write for an std::string.

Parameters
streamIN The stream being written to.
strIN The std::string being written.
template<>
void Persist::Write (IPMStreamstream,
const PMRectn 
)
inline

Specializes template function Write for a PMRect.

Parameters
streamIN The stream to write to.
nIN The PMRect being written.
template<typename T >
void Persist::Write (IPMStreamstream,
const T & t 
)
inline

A template function for writing a generic type.

Parameters
streamIN The stream to write to.
tIN The object to write.

Usage is straightforward; for example Persist::Write(stream, myInt32). The following implementation specifics can be ignored unless you have a type that you want to provide serialization utilities for.

The default implementation of this method calls ReadWrite on the object to be written.

If you need to override this behavior for a non-parameterized type such as int32, you should provide a template specialization with the appropriate implementation. See Write<int32> in PersistBaseTypes.h for an example. DO NOT PROVIDE A NON-TEMPLATE OVERLOAD FOR THIS METHOD.

If you need to override this behavior for a parameterized type such as std::pair, you would instead need to provide a template specialization for Serializer as mentioned above.

template<>
void Persist::Write< int16 > (IPMStreamstream,
const int16 & i 
)
inline

Specializes template function Write for an int16.

Parameters
streamIN The stream to write to.
iIN The int16 being written.
template<>
void Persist::Write< int32 > (IPMStreamstream,
const int32 & i 
)
inline

Specializes template function Write for an int32.

Parameters
streamIN The stream to write to.
iIN The int32 being written.
template<>
void Persist::Write< int64 > (IPMStreamstream,
const int64 & i 
)
inline

Specializes template function Write for an int32.

Parameters
streamIN The stream to write to.
iIN The int32 being written.
template<>
void Persist::Write< PMPoint > (IPMStreamstream,
const PMPointn 
)
inline

Specializes template function Write for a PMPoint.

Parameters
streamIN The stream to write to.
nIN The PMPoint being written.
template<>
void Persist::Write< PMReal > (IPMStreamstream,
const PMRealn 
)
inline

Specializes template function Write for a PMReal.

Parameters
streamIN The stream to write to.
nIN The PMReal being written.
template<>
void Persist::Write< uint16 > (IPMStreamstream,
const uint16 & n 
)
inline

Specializes template function Write for a uint16.

Parameters
streamIN The stream to write to.
nIN The uint16 being written.
template<>
void Persist::Write< uint32 > (IPMStreamstream,
const uint32 & n 
)
inline

Specializes template function Write for a uint32.

Parameters
streamIN The stream to write to.
nIN The uint32 being written.
template<>
void Persist::Write< uint64 > (IPMStreamstream,
const uint64 & i 
)
inline

Specializes template function Write for an uint64.

Parameters
streamIN The stream to write to.
iIN The int32 being written.
template<>
void Persist::Write< uint8 > (IPMStreamstream,
const uint8 & n 
)
inline

Specializes template function Write for a uint8.

Parameters
streamIN The stream to write to.
nIN The uint8 being written.
template<>
void Persist::Write< UTF32TextChar > (IPMStreamstream,
const UTF32TextCharu 
)
inline

Specializes template function Write for a UTF32TextChar.

Parameters
streamIN The stream to write to.
uIN The ScriptID being written.