#include <str_list.h>
Public Member Functions | |
~string_list_ty () | |
string_list_ty () | |
string_list_ty (const string_list_ty &) | |
string_list_ty & | operator= (const string_list_ty &) |
bool | member (string_ty *arg) const |
bool | member_nocase (string_ty *arg) const |
size_t | size () const |
bool | empty () const |
string_ty * | operator[] (size_t n) const |
string_ty * | unsplit (size_t start, size_t finish, const char *sep) const |
string_ty * | unsplit (const char *sep=0) const |
void | push_front (string_ty *arg) |
void | push_front (const string_list_ty &arg) |
void | push_back (string_ty *arg) |
void | push_back_unique (string_ty *arg) |
void | push_back (const string_list_ty &arg) |
void | push_back_unique (const string_list_ty &arg) |
void | split (string_ty *arg, const char *sep=0, bool white=false) |
void | remove (string_ty *arg) |
void | remove (const string_list_ty &arg) |
void | clear () |
string_ty * | front () |
string_ty * | back () |
void | pop_front () |
void | pop_back () |
bool | equal (const string_list_ty &arg) const |
bool | subset (const string_list_ty &arg) const |
void | sort () |
void | sort_nocase () |
void | sort_version () |
string_list_ty | quote_shell () const |
bool | validate () const |
string_list_ty | intersection (const string_list_ty &rhs) const |
Data Fields | |
size_t | nstrings |
size_t | nstrings_max |
string_ty ** | string |
Definition at line 35 of file str_list.h.
string_list_ty::~string_list_ty | ( | ) |
The destructor.
string_list_ty::string_list_ty | ( | ) |
The default constructor. This list will be initialised as being empty.
string_list_ty::string_list_ty | ( | const string_list_ty & | ) |
The copy constructor.
string_list_ty& string_list_ty::operator= | ( | const string_list_ty & | ) |
The assignment operator.
bool string_list_ty::member | ( | string_ty * | arg | ) | const |
The member method is used to test whether a given string value is a member of the string list.
arg | The string value to search for. |
bool string_list_ty::member_nocase | ( | string_ty * | arg | ) | const |
The member_nocase method is used to test whether a given string value is a member of the string list. The conparison is performed in a case-INsensitive way.
arg | The string value to search for. |
size_t string_list_ty::size | ( | ) | const [inline] |
The size method is used to obtain the number of string in the list.
Definition at line 86 of file str_list.h.
bool string_list_ty::empty | ( | ) | const [inline] |
The empty method i used to determine if the list is empty (contains no strings) or not.
Definition at line 96 of file str_list.h.
string_ty* string_list_ty::operator[] | ( | size_t | n | ) | const [inline] |
The [] operator may be used to extract a list member. It may only be used as an r-value.
Definition at line 102 of file str_list.h.
string_ty* string_list_ty::unsplit | ( | size_t | start, | |
size_t | finish, | |||
const char * | sep | |||
) | const |
The unsplit method is used to form a string from a word list.
start | The first string in the list to start from. | |
finish | One past the last string in the list be be used. | |
sep | The seapator string between words. If yoy give NULL, it will use a single space. |
string_ty* string_list_ty::unsplit | ( | const char * | sep = 0 |
) | const |
The unsplit method is used to form a string from a word list.
sep | The seapator string between words. If yoy give NULL, it will use a single space. |
void string_list_ty::push_front | ( | string_ty * | arg | ) |
The push_front method is used to prepend a string to the list.
arg | The string to be appended. |
void string_list_ty::push_front | ( | const string_list_ty & | arg | ) |
The push_front method is used to prepend a string to the list.
arg | The list of string to be appended. |
void string_list_ty::push_back | ( | string_ty * | arg | ) |
The push_back method is used to append a string to the list. This has O(1) insert times.
arg | The string to be appended. |
void string_list_ty::push_back_unique | ( | string_ty * | arg | ) |
The push_back method is used to append a string to the list, but only if it isn't already in the list. This has O(n) insert times.
arg | The string to be appended. |
void string_list_ty::push_back | ( | const string_list_ty & | arg | ) |
The push_back method is used to append all the strings string in one list to the end of this list. This has O(1) insert times.
arg | The strings to be appended. |
void string_list_ty::push_back_unique | ( | const string_list_ty & | arg | ) |
The push_back method is used to append all the strings string in one list to the end of this list. This has O(n*m) insert times.
arg | The strings to be appended. |
void string_list_ty::split | ( | string_ty * | arg, | |
const char * | sep = 0 , |
|||
bool | white = false | |||
) |
The split method is used to convert a string to a word list. The string list is cleared()ed before the string is split into it.
arg | The string to be split into pieces. | |
sep | Separator characters; sequences of noe or more of these characters seaprate each part. Defaults to " " if NULL is given. | |
white | if true, supress extra white space around separators |
void string_list_ty::remove | ( | string_ty * | arg | ) |
The remove method is used to remove a string. It is not an error if the string is not present. This has O(n) behaviour.
arg | The string value to be removed. |
void string_list_ty::remove | ( | const string_list_ty & | arg | ) |
The remove method is used to remove a set of string. It is not an error if one or more of the strings are not present. This has O(n*m) behaviour.
arg | The string values to be removed. |
void string_list_ty::clear | ( | ) |
The clear method is used to remove all list elements. This has O(n) behaviour. Afterwards, the list is once again empty.
string_ty* string_list_ty::front | ( | ) | [inline] |
The front method is used to obtain the first string value in the list.
Definition at line 245 of file str_list.h.
string_ty* string_list_ty::back | ( | ) | [inline] |
The back method is used to obtain the last string value in the list.
Definition at line 251 of file str_list.h.
void string_list_ty::pop_front | ( | ) |
The pop_front method is used to discard the first value in the list. This has O(n) behaviour.
void string_list_ty::pop_back | ( | ) |
The pop_back method is used to discard the last value in the list. This has O(1) behaviour.
bool string_list_ty::equal | ( | const string_list_ty & | arg | ) | const |
The equal method is used to determine if this string list is equal to another string list. Two lists are considered equal if they both contains the same strings, regardless of order.
bool string_list_ty::subset | ( | const string_list_ty & | arg | ) | const |
The subset method is used to determine if this string list is a subset of another string list, regardless of order.
arg | strings list to test against, i.e. that is (*this is-a-subset-of arg). |
void string_list_ty::sort | ( | ) |
The sort method is used to perform an in situ sort the string list values in a string list. The comparison function used is strcmp.
void string_list_ty::sort_nocase | ( | ) |
The sort method is used to perform an in situ sort the string list values in a string list. The comparison function used is strcasecmp.
void string_list_ty::sort_version | ( | ) |
The sort method is used to perform an in situ sort the string list values in a string list. The comparison function used is strverscmp.
string_list_ty string_list_ty::quote_shell | ( | ) | const |
The quote_shell method is used to produce a new string list by quoting the strings of this string list.
bool string_list_ty::validate | ( | ) | const |
The validate method is used to validate a string list. Usually used for debugging, usually with assert.
string_list_ty string_list_ty::intersection | ( | const string_list_ty & | rhs | ) | const |
The intersection method is used to calculate the set intersection between this set of strings and the rhs set of strings.
size_t string_list_ty::nstrings |
Definition at line 334 of file str_list.h.
size_t string_list_ty::nstrings_max |
Definition at line 335 of file str_list.h.
Definition at line 336 of file str_list.h.