#include <pmstring.h>
Public Member Functions | |
PMString () | |
Inherits from std::string. | |
PMString (const char *ptr) | |
Inherits from std::string. | |
PMString (const std::string &s) | |
Inherits from std::string. | |
PMString (size_type length, const char &ch) | |
Inherits from std::string. | |
PMString (const char *str, size_type length) | |
Inherits from std::string. | |
PMString (const std::string &str, size_type index, size_type length) | |
Inherits from std::string. | |
std::vector< PMString > | Split (char const *delims=" \t\r\n") |
Split the string around delims and return a vector of the split. Delims defaults to whitespace. | |
std::vector< PMString > | ProcessUseFlags (std::vector< PMString > useFlags) |
Removes atoms not associated with useflags provided. | |
PMString | GetName () |
Returns the name when string is in cat/name-version format. | |
PMString | GetCategory () |
Returns the category when string is in cat/name-version format. | |
PMString | GetVersion () |
Returns the version when string is in cat/name-version format. | |
PMString | GetFileName () |
Returns the filename if string is in the form dir/dir/filename. | |
void | TrimWhitespace () |
Remove the whitespace from either end of the string. | |
void | FormatSize (int size) |
Format the string as a size - should only be called if the string only contains numbers. | |
int | VersionCompare (PMString secondVersion) |
Compare this string with secondVersion string. | |
bool | StartsWith (PMString secondString) |
True if this starts with secondString. | |
Protected Member Functions | |
std::vector< PMString >::iterator | _BypassBrackets (std::vector< PMString >::iterator currentLocation, std::vector< PMString >::iterator endLocation) |
Go out of scope of the current bracket. |
|
Goes out of scope of the brackets pointed to by currentLocation.
|
|
Take an integer and format the string as the integer treated as a filesize. Adds Kb to the end of the string.
|
|
Takes in a PMString of the form category/name-version and returns the category of the package.
|
|
Returns the filename from a string. i.e. substring from the last /.
|
|
Takes in a PMString of the form category/name-version and returns the name of the package. It assumes that name is the only present quantity if the format is not met.
|
|
Takes in a PMString of the form category/name-version and returns the version of the package.
|
|
Removes all useflags not contained in useFlags. Removes the atoms associated with it too. For use in dependency strings.
|
|
Splits the string around the delims and returns a vector of the resultant strings. delims has a default value of whitespace.
|
|
Returns true if this starts with secondString.
|
|
Remove whitespace from the start and end of the string. |
|
Compare a string with this one. Assumes they are both versions and does the comparison as such. Examines the string from the start and as soon as it sees a difference it returns. This really should be as quick as possible as it is called all the time Returns 1 if secondVersion is newer, -1 if this is newer and 0 if they are the same.
|