Cupt
|
Namespaces | |
cache | |
download | |
system | |
Classes | |
class | Cache |
the source of package and version information More... | |
class | Config |
stores library's configuration variables More... | |
class | Exception |
general library exception class More... | |
class | HashSums |
hash sums More... | |
struct | Range |
struct | StringRange |
Functions | |
const char * | __ (const char *message) |
localizes message More... | |
void | consumePackageName (const char *begin, const char *end, const char *&resultEnd) |
reads package name in range More... | |
bool | checkPackageName (StringRange packageName, bool throwOnError=true) |
checks package name for correctness More... | |
bool | checkVersionString (const string &versionString, bool throwOnError=true) |
checks version string for correctness More... | |
int | compareVersionStrings (const string &left, const string &right) |
compares two version strings More... | |
StringRange | getOriginalVersionString (const StringRange &versionString) |
gets the original part of possibly Cupt-modified version string More... | |
Variables | |
const char *const | libraryVersion |
the version of Cupt library | |
int | messageFd |
message file descriptor More... | |
const char* cupt::__ | ( | const char * | message | ) |
localizes message
message | input string |
bool cupt::checkPackageName | ( | StringRange | packageName, |
bool | throwOnError = true |
||
) |
checks package name for correctness
packageName | package name |
throwOnError | if set to true , function will throw exception if packageName is not correct |
true
if the packageName is correct, false
if packageName is not correct and throwOnError is false
bool cupt::checkVersionString | ( | const string & | versionString, |
bool | throwOnError = true |
||
) |
checks version string for correctness
Equal to checkPackageName, only checks version string instead of package name
int cupt::compareVersionStrings | ( | const string & | left, |
const string & | right | ||
) |
compares two version strings
left | left version string |
right | right version string |
-1
, if left <
right, 0
if left ==
right, 1
if left >
right void cupt::consumePackageName | ( | const char * | begin, |
const char * | end, | ||
const char *& | resultEnd | ||
) |
reads package name in range
Tries to read as more characters as possible from the begin, which form a valid package name, until end.
begin | range begin iterator | |
end | range end iterator | |
[in,out] | resultEnd | consumed range end iterator |
"zzuf"
will be printed StringRange cupt::getOriginalVersionString | ( | const StringRange & | versionString | ) |
gets the original part of possibly Cupt-modified version string
Cupt may apply Cupt-specific id suffixes to original version strings for its own use, mainly for distinguishing version which declare same version strings in the metadata but (possibly) having different content.
This function tells the version string as it was seen in the metadata.
versionString |
int cupt::messageFd |
message file descriptor
All library error, warning, debug and simulate messages will be pointed here. If messageFd ==
-1
, messages will be suppressed. Defaults to -1
.