#include "sbgVersion.h"
Go to the source code of this file.
Functions | |
SBG_COMMON_LIB_API int32_t | sbgVersionCompare (const SbgVersion *pVersionA, const SbgVersion *pVersionB, SbgVersionCmpThresold thresold) |
SBG_COMMON_LIB_API int32_t | sbgVersionCompareEncoded (uint32_t versionA, uint32_t versionB, SbgVersionCmpThresold thresold) |
SBG_COMMON_LIB_API void | sbgVersionDecode (uint32_t encodedVersion, SbgVersion *pVersionInfo) |
SBG_COMMON_LIB_API uint32_t | sbgVersionEncode (const SbgVersion *pVersionInfo) |
SBG_COMMON_LIB_API SbgErrorCode | sbgVersionFromString (const char *pVersionStr, SbgVersion *pVersionInfo) |
SBG_COMMON_LIB_API SbgErrorCode | sbgVersionFromStringEncoded (const char *pVersionStr, uint32_t *pVersion) |
SBG_COMMON_LIB_API int32_t | sbgVersionIsWithinRange (const SbgVersion *pLowerVersion, const SbgVersion *pHigherVersion, const SbgVersion *pVersion) |
SBG_COMMON_LIB_API int32_t | sbgVersionIsWithinRangeEncoded (uint32_t lowerVersion, uint32_t higherVersion, uint32_t version) |
SBG_COMMON_LIB_API SbgErrorCode | sbgVersionToString (const SbgVersion *pVersionInfo, char *pBuffer, uint32_t sizeOfBuffer) |
SBG_COMMON_LIB_API SbgErrorCode | sbgVersionToStringEncoded (uint32_t version, char *pBuffer, uint32_t sizeOfBuffer) |
SBG_COMMON_LIB_API int32_t sbgVersionCompare | ( | const SbgVersion * | pVersionA, |
const SbgVersion * | pVersionB, | ||
SbgVersionCmpThresold | thresold | ||
) |
Compare two version information structures and return if the version A is greater, less or equal than the version B. The computation is roughly result = version A - version B We can define how far we will check if the version A is greater than the version B. For example, we can only check the major or major and minor fields.
[in] | pVersionA | The first version to compare. |
[in] | pVersionB | The second version to compare. |
[in] | thresold | The comparaison thresold to know if we are checking the major, minor, revision, build, ... |
Definition at line 123 of file sbgVersion.c.
SBG_COMMON_LIB_API int32_t sbgVersionCompareEncoded | ( | uint32_t | versionA, |
uint32_t | versionB, | ||
SbgVersionCmpThresold | thresold | ||
) |
Compare two encoded versions and return if the version A is greater, less or equal than the version B. The computation is roughly result = version A - version B We can define how far we will check if the version A is greater than the version B. For example, we can only check the major or major and minor fields.
[in] | versionA | The first compiled version to compare. |
[in] | versionB | The second compiled version to compare. |
[in] | thresold | The comparaison thresold to know if we are checking the major, minor, revision, build, ... |
Definition at line 226 of file sbgVersion.c.
SBG_COMMON_LIB_API void sbgVersionDecode | ( | uint32_t | encodedVersion, |
SbgVersion * | pVersionInfo | ||
) |
Fill a SbgVersion structure based on an uint32_t that stores the 'compiled' version information.
[in] | encodedVersion | The version information stored within a uint32_t. |
[out] | pVersionInfo | Pointer on an allocated SbgVersion structure to fill. |
Definition at line 12 of file sbgVersion.c.
SBG_COMMON_LIB_API uint32_t sbgVersionEncode | ( | const SbgVersion * | pVersionInfo | ) |
Construct a uint32_t containing a version information based on a SbgVersion structure.
[in] | pVersionInfo | Pointer on a read only version structure to encode. |
Definition at line 69 of file sbgVersion.c.
SBG_COMMON_LIB_API SbgErrorCode sbgVersionFromString | ( | const char * | pVersionStr, |
SbgVersion * | pVersionInfo | ||
) |
Convert a human readable string to a version structure.
[in] | pVersionStr | The string containing the version to convert. |
[out] | pVersionInfo | Pointer to a version structure to store the parsed version info. |
Definition at line 439 of file sbgVersion.c.
SBG_COMMON_LIB_API SbgErrorCode sbgVersionFromStringEncoded | ( | const char * | pVersionStr, |
uint32_t * | pVersion | ||
) |
Convert an encoded version number to a human readable string.
[in] | pVersionStr | The string containing the version to convert. |
[out] | pVersion | Returned encoded version value parsed from the string. |
Definition at line 560 of file sbgVersion.c.
SBG_COMMON_LIB_API int32_t sbgVersionIsWithinRange | ( | const SbgVersion * | pLowerVersion, |
const SbgVersion * | pHigherVersion, | ||
const SbgVersion * | pVersion | ||
) |
Check if the provided version is between the provided version interval. All versions should have the same scheme.
[in] | pLowerVersion | The lower version bound of the interval. |
[in] | pHigherVersion | The hiver version bound of the interval. |
[in] | pVersion | The version to check. |
Definition at line 254 of file sbgVersion.c.
SBG_COMMON_LIB_API int32_t sbgVersionIsWithinRangeEncoded | ( | uint32_t | lowerVersion, |
uint32_t | higherVersion, | ||
uint32_t | version | ||
) |
Check if the provided encoded version is between the provided version interval. All versions should have the same scheme.
[in] | lowerVersion | The lower version bound of the interval. |
[in] | higherVersion | The hiver version bound of the interval. |
[in] | version | The version to check. |
Definition at line 277 of file sbgVersion.c.
SBG_COMMON_LIB_API SbgErrorCode sbgVersionToString | ( | const SbgVersion * | pVersionInfo, |
char * | pBuffer, | ||
uint32_t | sizeOfBuffer | ||
) |
Convert a version information to a human readable string.
[in] | pVersionInfo | Pointer on a read only version structure to convert to a human readable string. |
[out] | pBuffer | Buffer to store the version as a human readable null terminated string. |
[in] | sizeOfBuffer | Maximum buffer size including the null terminated char. |
Definition at line 317 of file sbgVersion.c.
SBG_COMMON_LIB_API SbgErrorCode sbgVersionToStringEncoded | ( | uint32_t | version, |
char * | pBuffer, | ||
uint32_t | sizeOfBuffer | ||
) |
Convert an encoded version number to a human readable string.
[in] | version | Encoded version value to to convert to a human readable string. |
[out] | pBuffer | Buffer to store the version as a human readable null terminated string. |
[in] | sizeOfBuffer | Maximum buffer size including the null terminated char. |
Definition at line 414 of file sbgVersion.c.