Datatypes¶
Integer identifiers for datatypes, and utility functions to access their properties.
-
EXESS_MAX_DATATYPE¶
26U
The unsigned value of the largest
ExessDatatypeenumerator.
-
enum ExessDatatype¶
A supported datatype, or zero.
-
enumerator EXESS_NOTHING¶
Sentinel for unknown datatypes or errors.
-
enumerator EXESS_ULONG¶
-
enumerator EXESS_UINT¶
-
enumerator EXESS_USHORT¶
-
enumerator EXESS_UBYTE¶
-
enumerator EXESS_NON_POSITIVE_INTEGER¶
integer<= 0
-
enumerator EXESS_NEGATIVE_INTEGER¶
integer< 0
-
enumerator EXESS_NON_NEGATIVE_INTEGER¶
integer>= 0
-
enumerator EXESS_POSITIVE_INTEGER¶
integer> 0
-
enumerator EXESS_BASE64¶
-
enumerator EXESS_NOTHING¶
-
ExessDatatype exess_datatype_from_name(const char *name)¶
Return the datatype tag for a datatype name.
- Parameters:
name – The camel-case name of a supported datatype (its URI fragment), like “unsignedLong” or “dateTime”.
- Returns:
A datatype tag, or
ExessDatatype.EXESS_NOTHINGif no such datatype is known.
-
ExessDatatype exess_datatype_from_uri(const char *uri)¶
Return the datatype tag for a datatype URI.
- Parameters:
uri – Absolute URI for a supported datatype, like “http://www.w3.org/2001/XMLSchema#unsignedLong” or “http://www.w3.org/2001/XMLSchema#dateTime”.
- Returns:
A datatype tag, or
ExessDatatype.EXESS_NOTHINGif no such datatype is known.
-
const char *exess_datatype_name(ExessDatatype datatype)¶
Return the name of a datatype, or null.
This returns the suffix of the URI that would be returned by
exess_datatype_uri().- Parameters:
datatype – Datatype tag.
- Returns:
The name of the datatype, or null for
ExessDatatype.EXESS_NOTHING.
-
const char *exess_datatype_uri(ExessDatatype datatype)¶
Return the URI for a datatype, or null.
This only returns URIs that start with “http://www.w3.org/2001/XMLSchema#”.
- Parameters:
datatype – Datatype tag.
- Returns:
The URI of the datatype, or null for
ExessDatatype.EXESS_NOTHING.
-
uint8_t exess_max_lengths[EXESS_MAX_DATATYPE + 1U]¶
Array of maximum string lengths, indexed by datatype.
Each entry is the maximum length of a string with the indexed datatype, or zero if the datatype is unknown or unbounded. For example:
unsigned four_bytes = exess_max_lengths[EXESS_BYTE];
The unbounded types are
ExessDatatype.EXESS_DECIMAL,ExessDatatype.EXESS_INTEGERand its half-bounded subtypesExessDatatype.EXESS_NON_POSITIVE_INTEGER,ExessDatatype.EXESS_NEGATIVE_INTEGER,ExessDatatype.EXESS_NON_NEGATIVE_INTEGER, andExessDatatype.EXESS_POSITIVE_INTEGER, and the binary typesExessDatatype.EXESS_HEXandExessDatatype.EXESS_BASE64.
-
uint8_t exess_value_sizes[EXESS_MAX_DATATYPE + 1U]¶
Array of binary value sizes, indexed by datatype.
Each entry is the size of the binary representation of the indexed datatype (not a string length), or zero for values that can be arbitrarily large.