22 #ifndef CRNData_HEADER
23 #define CRNData_HEADER
45 UReal
ToCRN(
double d);
56 template<
typename T>
inline SObject
ToCRN(std::shared_ptr<T> ptr)
58 SObject obj(std::dynamic_pointer_cast<Object>(ptr));
65 template<
typename T>
inline UObject
ToCRN(
const T* ptr)
71 template<
typename T>
inline UObject
ToCRN(
const T &obj)
87 const Int *i =
dynamic_cast<const Int*
>(&obj);
120 const Int *i =
dynamic_cast<const Int*
>(&obj);
123 const Real *r =
dynamic_cast<const Real*
>(&obj);
140 const Int *i =
dynamic_cast<const Int*
>(&obj);
143 const Real *r =
dynamic_cast<const Real*
>(&obj);
160 const Int *i =
dynamic_cast<const Int*
>(&obj);
163 const Real *r =
dynamic_cast<const Real*
>(&obj);
180 const Int *i =
dynamic_cast<const Int*
>(&obj);
198 const Prop3 *p =
dynamic_cast<const Prop3*
>(&obj);
210 const Int *i =
dynamic_cast<const Int*
>(&obj);
213 const Prop3 *p =
dynamic_cast<const Prop3*
>(&obj);
232 const auto nelem = deco.size() /
sizeof(T);
233 if (nelem *
sizeof(T) != deco.size())
235 auto res = std::vector<T>(nelem);
236 std::copy(deco.begin(), deco.end(),
reinterpret_cast<uint8_t*
>(res.data()));
unsigned int ToUInt() const
Conversion to unsigned int.
const char * CStr() const
Conversion to UTF8 cstring.
double ToDouble() const
Conversion to double.
int ToInt() const
Conversion to int.
bool IsTrue() const noexcept
Is true?
A UTF32 character string class.
UInt ToCRN(int i)
Converts an int to CRN data.
Interface class for the metric real number class.
A convenience class for file paths.
int ToInt() const
Conversion to int.
double ToDouble() const
Conversion to double.
T Convert(const Object &obj)
Converts from a CRN object to another type.
unsigned int ToUInt() const
Conversion to unsigned int.
std::vector< uint8_t > ASCII85Decode(const crn::StringUTF8 &s)
Decodes an ASCII85 string to a vector of bytes.
Interface class for the metric real number class.
A character string class.
UObject Clone(const Object &obj)
Clones an object if possible.
crn::StringUTF8 ASCII85Encode(const uint8_t *const data, size_t len)
Encodes any data into a printable string.
Invalid argument error (e.g.: nullptr pointer)