libcrn  3.9.5
A document image processing library
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Functions
crn::Data Namespace Reference

Functions

UInt ToCRN (int i)
 Converts an int to CRN data. More...
 
UReal ToCRN (double d)
 Converts a double to CRN data. More...
 
UString ToCRN (const String &str)
 Converts a String to CRN data. More...
 
UStringUTF8 ToCRN (const StringUTF8 &str)
 Converts a StringUTF8 to CRN data. More...
 
UPath ToCRN (const Path &str)
 Converts a Path to CRN data. More...
 
UProp3 ToCRN (const Prop3 &val)
 Converts a Prop3 to CRN data. More...
 
template<typename T >
SObject ToCRN (std::shared_ptr< T > ptr)
 Converts a shared pointer to CRN data. More...
 
template<typename T >
UObject ToCRN (const T *ptr)
 Converts a pointer to CRN data (fails in not a Clonable object) More...
 
template<typename T >
UObject ToCRN (const T &obj)
 Converts an object to CRN data (fails in not a Clonable object) More...
 
template<typename T >
Convert (const Object &obj)
 Converts from a CRN object to another type. More...
 
template<>
int Convert (const Object &obj)
 Converts from a CRN object to int. More...
 
template<>
unsigned int Convert (const Object &obj)
 Converts from a CRN object to unsigned int. More...
 
template<>
double Convert (const Object &obj)
 Converts from a CRN object to double. More...
 
template<>
String Convert (const Object &obj)
 Converts from a CRN object to String. More...
 
template<>
StringUTF8 Convert (const Object &obj)
 Converts from a CRN object to StringUTF8. More...
 
template<>
Path Convert (const Object &obj)
 Converts from a CRN object to Path. More...
 
template<>
Prop3 Convert (const Object &obj)
 Converts from a CRN object to Prop3. More...
 
template<>
bool Convert (const Object &obj)
 Converts from a CRN object to bool. More...
 
crn::StringUTF8 ASCII85Encode (const uint8_t *const data, size_t len)
 Encodes any data into a printable string. More...
 
std::vector< uint8_t > ASCII85Decode (const crn::StringUTF8 &s)
 Decodes an ASCII85 string to a vector of bytes. More...
 

Function Documentation

std::vector< T > crn::Data::ASCII85Decode ( const crn::StringUTF8 s)

Decodes an ASCII85 string to a vector of bytes.

Decodes an ASCII85 string to a vector.

Exceptions
ExceptionInvalidArgumentinvalid ASCII85 string
ExceptionDimensioninvalid size
Parameters
[in]san ASCII85 string
Returns
a vector of data
Exceptions
ExceptionInvalidArgumentinvalid ASCII85 string
Parameters
[in]san ASCII85 string
Returns
a vector of data

Definition at line 229 of file CRNData.h.

StringUTF8 crn::Data::ASCII85Encode ( const uint8_t *const  data,
size_t  len 
)

Encodes any data into a printable string.

Encodes any data into a printable string

Parameters
[in]dataa string of bytes
[in]lenthe number of bytes to convert
Returns
an ASCII85-encoded printable string

Definition at line 109 of file CRNData.cpp.

template<typename T >
T crn::Data::Convert ( const Object &  obj)
inline

Converts from a CRN object to another type.

Definition at line 76 of file CRNData.h.

template<>
int crn::Data::Convert ( const Object &  obj)
inline

Converts from a CRN object to int.

Exceptions
ExceptionInvalidArgumentimpossible to convert
Parameters
[in]objan object to convert
Returns
the converted value

Definition at line 85 of file CRNData.h.

template<>
unsigned int crn::Data::Convert ( const Object &  obj)
inline

Converts from a CRN object to unsigned int.

Exceptions
ExceptionInvalidArgumentimpossible to convert
Parameters
[in]objan object to convert
Returns
the converted value

Definition at line 103 of file CRNData.h.

template<>
double crn::Data::Convert ( const Object &  obj)
inline

Converts from a CRN object to double.

Exceptions
ExceptionInvalidArgumentimpossible to convert
Parameters
[in]objan object to convert
Returns
the converted value

Definition at line 118 of file CRNData.h.

template<>
String crn::Data::Convert ( const Object &  obj)
inline

Converts from a CRN object to String.

Parameters
[in]objan object to convert
Returns
the converted value

Definition at line 138 of file CRNData.h.

template<>
StringUTF8 crn::Data::Convert ( const Object &  obj)
inline

Converts from a CRN object to StringUTF8.

Parameters
[in]objan object to convert
Returns
the converted value

Definition at line 158 of file CRNData.h.

template<>
Path crn::Data::Convert ( const Object &  obj)
inline

Converts from a CRN object to Path.

Parameters
[in]objan object to convert
Returns
the converted value

Definition at line 178 of file CRNData.h.

template<>
Prop3 crn::Data::Convert ( const Object &  obj)
inline

Converts from a CRN object to Prop3.

Exceptions
ExceptionInvalidArgumentimpossible to convert
Parameters
[in]objan object to convert
Returns
the converted value

Definition at line 196 of file CRNData.h.

template<>
bool crn::Data::Convert ( const Object &  obj)
inline

Converts from a CRN object to bool.

Exceptions
ExceptionInvalidArgumentimpossible to convert
Parameters
[in]objan object to convert
Returns
the converted value

Definition at line 208 of file CRNData.h.

UInt crn::Data::ToCRN ( int  i)

Converts an int to CRN data.

Converts an int to CRN data

Parameters
[in]ian integer
Returns
a CRNInt that can be stored in crn::containers and serialized

Definition at line 33 of file CRNData.cpp.

UReal crn::Data::ToCRN ( double  d)

Converts a double to CRN data.

Converts a double to CRN data

Parameters
[in]da double
Returns
a CRNDouble that can be stored in crn::containers and serialized

Definition at line 43 of file CRNData.cpp.

UString crn::Data::ToCRN ( const String str)

Converts a String to CRN data.

Converts a String to CRN data

Parameters
[in]stra String
Returns
a SString that can be stored in crn::containers and serialized

Definition at line 53 of file CRNData.cpp.

UStringUTF8 crn::Data::ToCRN ( const StringUTF8 str)

Converts a StringUTF8 to CRN data.

Converts a StringUTF8 to CRN data

Parameters
[in]stra StringUTF8
Returns
a SStringUTF8 that can be stored in crn::containers and serialized

Definition at line 63 of file CRNData.cpp.

UPath crn::Data::ToCRN ( const Path str)

Converts a Path to CRN data.

Converts a Path to CRN data

Parameters
[in]stra Path
Returns
a Path that can be stored in crn::containers and serialized

Definition at line 73 of file CRNData.cpp.

UProp3 crn::Data::ToCRN ( const Prop3 val)

Converts a Prop3 to CRN data.

Converts a Prop3 to CRN data

Parameters
[in]vala Prop3
Returns
a Prop3 that can be stored in crn::containers and serialized

Definition at line 83 of file CRNData.cpp.

template<typename T >
SObject crn::Data::ToCRN ( std::shared_ptr< T >  ptr)
inline

Converts a shared pointer to CRN data.

Definition at line 56 of file CRNData.h.

template<typename T >
UObject crn::Data::ToCRN ( const T *  ptr)
inline

Converts a pointer to CRN data (fails in not a Clonable object)

Definition at line 65 of file CRNData.h.

template<typename T >
UObject crn::Data::ToCRN ( const T &  obj)
inline

Converts an object to CRN data (fails in not a Clonable object)

Definition at line 71 of file CRNData.h.