HDK
|
#include <cmath>
#include <cstddef>
#include <iostream>
#include <limits>
#include <OpenImageIO/dassert.h>
#include <OpenImageIO/export.h>
#include <OpenImageIO/oiioversion.h>
#include <OpenImageIO/string_view.h>
#include <OpenImageIO/strutil.h>
Go to the source code of this file.
Macros | |
#define | OIIO_TYPEDESC_VECTOR2 1 |
Functions | |
OIIO_UTIL_API std::string | tostring (TypeDesc type, const void *data, const char *float_fmt, const char *string_fmt="%s", const char aggregate_delim[2]="()", const char *aggregate_sep=",", const char array_delim[2]="{}", const char *array_sep=",") |
OIIO_UTIL_API std::string | tostring (TypeDesc type, const void *data, const tostring_formatting &fmt={}) |
OIIO_UTIL_API bool | convert_type (TypeDesc srctype, const void *src, TypeDesc dsttype, void *dst, int n=1) |
The TypeDesc class is used to describe simple data types.
Definition in file typedesc.h.
#define OIIO_TYPEDESC_VECTOR2 1 |
Definition at line 33 of file typedesc.h.
OIIO_UTIL_API bool convert_type | ( | TypeDesc | srctype, |
const void * | src, | ||
TypeDesc | dsttype, | ||
void * | dst, | ||
int | n = 1 |
||
) |
Given data pointed to by src and described by srctype, copy it to the memory pointed to by dst and described by dsttype, and return true if a conversion is possible, false if it is not. If the types are equivalent, this is a straightforward memory copy. If the types differ, there are several non-equivalent type conversions that will nonetheless succeed:
char*
): it will always succeed, producing a string akin to calling tostring()
.OIIO_UTIL_API std::string tostring | ( | TypeDesc | type, |
const void * | data, | ||
const char * | float_fmt, | ||
const char * | string_fmt = "%s" , |
||
const char | aggregate_delim[2] = "()" , |
||
const char * | aggregate_sep = "," , |
||
const char | array_delim[2] = "{}" , |
||
const char * | array_sep = "," |
||
) |
OIIO_UTIL_API std::string tostring | ( | TypeDesc | type, |
const void * | data, | ||
const tostring_formatting & | fmt = {} |
||
) |
Return a string containing the data values formatted according to the type and the optional formatting control arguments. Will be deprecated someday as printf formatting falls out of favor.