libSBML C++ API  5.18.0
UnitKind.c File Reference

SBML UnitKind enumeration. More...

Include dependency graph for UnitKind.c:

Functions

int UnitKind_equals (UnitKind_t uk1, UnitKind_t uk2)
 Tests for logical equality between two given UNIT_KIND_ code values. More...
 
UnitKind_t UnitKind_forName (const char *name)
 Converts a text string naming a kind of unit to its corresponding libSBML UNIT_KIND_ constant/enumeration value. More...
 
int UnitKind_isValidUnitKindString (const char *str, unsigned int level, unsigned int version)
 Predicate for testing whether a given string corresponds to a predefined libSBML unit code. More...
 
const char * UnitKind_toString (UnitKind_t uk)
 Converts a unit code to a text string equivalent. More...
 

Variables

const char * UNIT_KIND_STRINGS []
 

Detailed Description

SBML UnitKind enumeration.

Author
Ben Bornstein

Function Documentation

int UnitKind_equals ( UnitKind_t  uk1,
UnitKind_t  uk2 
)

Tests for logical equality between two given UNIT_KIND_ code values.

This function behaves exactly like C's == operator, except for the following two cases:

In the two cases above, C equality comparison would yield 0 (false) (because each of the above is a distinct enumeration value), but this function returns true.

Parameters
uk1a UNIT_KIND_ value.
uk2a second UNIT_KIND_ value to compare to uk1.
Returns
1 (true) if uk1 is logically equivalent to uk2, 0 (false) otherwise.
Note
For more information about the libSBML unit codes, please refer to the class documentation for Unit.
UnitKind_t UnitKind_forName ( const char *  name)

Converts a text string naming a kind of unit to its corresponding libSBML UNIT_KIND_ constant/enumeration value.

Parameters
namea string, the name of a predefined base unit in SBML.
Returns
a value from UnitKind_t corresponding to the given string name (determined in a case-insensitive manner).
Note
For more information about the libSBML unit codes, please refer to the class documentation for Unit.
int UnitKind_isValidUnitKindString ( const char *  str,
unsigned int  level,
unsigned int  version 
)

Predicate for testing whether a given string corresponds to a predefined libSBML unit code.

Parameters
stra text string naming a base unit defined by SBML.
levelthe Level of SBML.
versionthe Version within the Level of SBML.
Returns
1 (true) if string is the name of a valid UNIT_KIND_ value, 0 (false) otherwise.
Note
For more information about the libSBML unit codes, please refer to the class documentation for Unit.
const char* UnitKind_toString ( UnitKind_t  uk)

Converts a unit code to a text string equivalent.

Parameters
uka value from the UnitKind_t enumeration
Returns
the name corresponding to the given unit code.
Note
For more information about the libSBML unit codes, please refer to the class documentation for Unit.
Warning
The string returned is a static data value. The caller does not own the returned string and is therefore not allowed to modify it.

Variable Documentation

const char* UNIT_KIND_STRINGS[]