![]() |
BSB Developer Docs
|
Semantic version (SemVer) utility library. More...
#include <core/string.h>Go to the source code of this file.
Data Structures | |
| struct | SemVer |
| Structure representing the semantic version values. More... | |
Enumerations | |
| enum | SemVerOrdering { SemVerOrderingEqual , SemVerOrderingNewer , SemVerOrderingOlder } |
| Enumeration of semantic version orderings. More... | |
Functions | |
| bool | semver_parse (SemVer *instance, const char *source) |
| Parse semantic version from a string. | |
| SemVerOrdering | semver_compare (const SemVer *instance, const SemVer *other) |
| Compare two semantic versions. | |
| void | semver_to_string (const SemVer *instance, FuriString *out_string) |
| Convert a SemVer instance to string representation. | |
Semantic version (SemVer) utility library.
This implementation follows the x.y.z format. No additional fields are allowed.
| enum SemVerOrdering |
| SemVerOrdering semver_compare | ( | const SemVer * | instance, |
| const SemVer * | other ) |
Compare two semantic versions.
| [in] | instance | pointer to the instance to be compared |
| [in] | other | pointer to the other instance to compare with |
instance is newer than other instance is older than other | bool semver_parse | ( | SemVer * | instance, |
| const char * | source ) |
Parse semantic version from a string.
If the instance pointer is NULL, the source string will still be parsed normally. This can be useful if the calling code only needs to validate the source string.
| [in,out] | instance | pointer to the instance to contain the parsed data (can be NULL) |
| [in] | source | pointer to a zero-terminated version string in x.y.z format |
true if the source string could be parsed, false otherwise | void semver_to_string | ( | const SemVer * | instance, |
| FuriString * | out_string ) |
Convert a SemVer instance to string representation.
| [in] | instance | pointer to the instance to be converted |
| [out] | out_string | pointer to a FuriString to hold the string value (must be allocated) |