|
ritsuko
Helper utilities for ArtifactDB C++ code
|
Helper functions for ArtifactDB parsing and validation. More...
Namespaces | |
| namespace | cvls |
| Utilities for reading and validating compressed VLS arrays. | |
| namespace | hdf5 |
| Utilities for reading and validating HDF5 files. | |
Classes | |
| struct | Version |
| Version number. More... | |
Functions | |
| bool | is_date_prefix (const char *ptr) |
| bool | is_date (const char *ptr, size_t len) |
| bool | is_rfc3339_suffix (const char *ptr, size_t len) |
| bool | is_rfc3339 (const char *ptr, size_t len) |
| Version | parse_version_string (const char *version_string, size_t size, bool skip_patch=false) |
Helper functions for ArtifactDB parsing and validation.
|
inline |
| [in] | ptr | Pointer to a C-style string. |
| len | Length of the string referenced by ptr, excluding the null terminator. |
ptr refers to a XXXX-YY-ZZ date, for approximately valid combinations of YY and ZZ (see is_date_prefix() for details).
|
inline |
Does a string start with a XXXX-YY-ZZ date, for approximately valid combinations of YY and ZZ? (This is only approximate as we do not check the exact correctness of the number of days for each month.)
| [in] | ptr | Pointer to a C-style string containing at least 10 characters. |
|
inline |
Does a string follow the RFC3339 format? This uses is_date_prefix() and is_rfc3339_suffix() to check the date and the rest of the timestamp, respectively.
| [in] | ptr | Pointer to a C-style string. |
| len | Length of the string in ptr. |
|
inline |
Does a string finish with an RFC3339-compliant timestamp, i.e., does the substring starting at T after the date follow the RFC3339 specification? Note that the timestamp validity checks are only approximate as the correctness of leap seconds are not currently considered. It is expected that the start of the string up to the T was already validated with is_date_prefix().
| [in] | ptr | Pointer to a character array containing at least 10 characters. This should start from the 10th position in the original string, i.e., T in the timestamp. |
| len | Length of the string in ptr. |
|
inline |
| [in] | version_string | Pointer to a version string. |
| size | Length of the version_string. | |
| skip_patch | Whether to skip the patch number. |
Version object containing the version number. If skip_patch = true, the patch number is always zero.