qCC_db version 2.13.alpha (Qt) - 31 May 2022
CloudCompare 3D entities
Static Public Member Functions | Static Protected Member Functions | List of all members
ccSerializationHelper Class Reference

Serialization helpers. More...

#include <ccSerializableObject.h>

Static Public Member Functions

static void CoordsFromDataStream (QDataStream &stream, int flags, PointCoordinateType *out, unsigned count=1)
 Reads one or several 'PointCoordinateType' values from a QDataStream either in float or double format depending on the 'flag' value.
 
static void ScalarsFromDataStream (QDataStream &stream, int flags, ScalarType *out, unsigned count=1)
 Reads one or several 'ScalarType' values from a QDataStream either in float or double format depending on the 'flag' value.
 
template<class Type , int N, class ComponentType >
static bool GenericArrayToFile (const std::vector< Type > &data, QFile &out)
 Helper: saves a vector to file. More...
 
template<class Type , int N, class ComponentType >
static bool GenericArrayFromFile (std::vector< Type > &data, QFile &in, short dataVersion)
 Helper: loads a vector structure from file. More...
 
template<class Type , int N, class ComponentType , class FileComponentType >
static bool GenericArrayFromTypedFile (std::vector< Type > &data, QFile &in, short dataVersion)
 Helper: loads a vector structure from a file stored with a different type. More...
 

Static Protected Member Functions

static bool ReadArrayHeader (QFile &in, short dataVersion, ::uint8_t &componentCount, ::uint32_t &elementCount)
 

Detailed Description

Serialization helpers.

Member Function Documentation

◆ GenericArrayFromFile()

template<class Type , int N, class ComponentType >
static bool ccSerializationHelper::GenericArrayFromFile ( std::vector< Type > &  data,
QFile &  in,
short  dataVersion 
)
inlinestatic

Helper: loads a vector structure from file.

Parameters
datavector to load
ininput file (must be already opened)
dataVersionversion current data version
Returns
success

◆ GenericArrayFromTypedFile()

template<class Type , int N, class ComponentType , class FileComponentType >
static bool ccSerializationHelper::GenericArrayFromTypedFile ( std::vector< Type > &  data,
QFile &  in,
short  dataVersion 
)
inlinestatic

Helper: loads a vector structure from a file stored with a different type.

Parameters
datavector to load
ininput file (must be already opened)
dataVersionversion current data version
Returns
success

◆ GenericArrayToFile()

template<class Type , int N, class ComponentType >
static bool ccSerializationHelper::GenericArrayToFile ( const std::vector< Type > &  data,
QFile &  out 
)
inlinestatic

Helper: saves a vector to file.

Parameters
datavector to save (must be allocated)
outoutput file (must be already opened)
Returns
success

The documentation for this class was generated from the following file: