String_List
[String]

String Lists. More...

Data Structures

class  string_list_ty

Functions

int string_list_member (const string_list_ty *slp, string_ty *s)
string_tywl2str (const string_list_ty *slp, int start, int finish, const char *sep)
void str2wl (string_list_ty *slp, string_ty *arg, const char *sep, int white)
void string_list_prepend (string_list_ty *lhs, string_ty *rhs)
void string_list_prepend_list (string_list_ty *lhs, const string_list_ty *rhs)
void string_list_append (string_list_ty *lhs, string_ty *rhs)
void string_list_append_list (string_list_ty *lhs, const string_list_ty *rhs)
void string_list_append_unique (string_list_ty *lhs, string_ty *rhs)
void string_list_append_list_unique (string_list_ty *lhs, const string_list_ty *rhs)
void string_list_copy (string_list_ty *lhs, const string_list_ty *rhs)
void string_list_remove (string_list_ty *slp, string_ty *s)
void string_list_remove_list (string_list_ty *lhs, const string_list_ty *rhs)
void string_list_destructor (string_list_ty *slp)
void string_list_constructor (string_list_ty *slp)
bool operator== (const string_list_ty &lhs, const string_list_ty &rhs)
bool operator!= (const string_list_ty &lhs, const string_list_ty &rhs)
int string_list_subset (const string_list_ty *lhs, const string_list_ty *rhs)
void string_list_sort (string_list_ty *slp)
void string_list_quote_shell (string_list_ty *lhs, const string_list_ty *rhs)
void operator+= (string_list_ty &lhs, const string_list_ty &rhs)
string_list_ty operator+ (const string_list_ty &lhs, const string_list_ty &rhs)
void operator-= (string_list_ty &lhs, const string_list_ty &rhs)
string_list_ty operator- (const string_list_ty &lhs, const string_list_ty &rhs)
void operator*= (string_list_ty &lhs, const string_list_ty &rhs)
string_list_ty operator* (const string_list_ty &lhs, const string_list_ty &rhs)

Detailed Description

String Lists.


Function Documentation

bool operator!= ( const string_list_ty lhs,
const string_list_ty rhs 
) [inline]

The inquality (!=) operator is used to determine if two string lists do not contain the same strings. The _ordering_ of the strings is not considered. This is an O(n**2) operation.

Returns:
Returns true if the two sets of strings are different, false if they are the same.

Definition at line 577 of file str_list.h.

string_list_ty operator* ( const string_list_ty lhs,
const string_list_ty rhs 
) [inline]

The multiply operator is used to calculate the set intersection of the left and right. Duplicates are omitted.

Definition at line 684 of file str_list.h.

void operator*= ( string_list_ty lhs,
const string_list_ty rhs 
) [inline]

The in situ multiply operator is used to keep only those strings on the left which also appear on the right. Duplicates are omitted.

Definition at line 674 of file str_list.h.

string_list_ty operator+ ( const string_list_ty lhs,
const string_list_ty rhs 
) [inline]

The addition operator is used to union two sets of strings. Duplicates will be omitted.

Definition at line 638 of file str_list.h.

void operator+= ( string_list_ty lhs,
const string_list_ty rhs 
) [inline]

The in situ addition operator is used to union values into a set of strings. Duplicates on the right will be omitted.

Definition at line 628 of file str_list.h.

string_list_ty operator- ( const string_list_ty lhs,
const string_list_ty rhs 
) [inline]

The subtract operator is used to create a new set of strings by removing strings from the left which appear in the right.

Definition at line 661 of file str_list.h.

void operator-= ( string_list_ty lhs,
const string_list_ty rhs 
) [inline]

The in situ subtract operator is used to difference two sets of strings by removing strings from the left which appear in the right.

Definition at line 651 of file str_list.h.

bool operator== ( const string_list_ty lhs,
const string_list_ty rhs 
) [inline]

The quality (==) operator is used to determine if two string lists contain the same strings. The _ordering_ of the strings is not considered. This is an O(n**2) operation.

Returns:
Returns true if the two sets of strings are the same, false if they are not.

Definition at line 561 of file str_list.h.

void str2wl ( string_list_ty slp,
string_ty arg,
const char *  sep,
int  white 
) [inline]

The str2wl function is used to break a string up into several strings at a given separatopr character.

Parameters:
slp The place to put the resulting list of strings. They are in the same order as they appeared in the input string (arg).
arg The input string to be split into component strings.
sep This is the set of separator characters. Supostrings will be extracted if *any* of the characters in this strings are seen (like $IFS in the shell). If NULL, white space will be used.
white If true (non-zero) leading ans trailing white space will be removed from the result strings. If false (zero) white space will be retained.

Definition at line 389 of file str_list.h.

void string_list_append ( string_list_ty lhs,
string_ty rhs 
) [inline]

The string_list_append function is used to add another string to the end of a string list.

Parameters:
lhs The string list to be added to.
rhs The string to be added to the end of lhs.

Definition at line 434 of file str_list.h.

void string_list_append_list ( string_list_ty lhs,
const string_list_ty rhs 
) [inline]

The string_list_append_list function is used to add all the strings of another string list to the end of a string list.

Parameters:
lhs The string list to be added to.
rhs The string list to be added to the end of lhs.

Definition at line 449 of file str_list.h.

void string_list_append_list_unique ( string_list_ty lhs,
const string_list_ty rhs 
) [inline]

The string_list_append_list_unique function is used to add all the strings of another string list to the end of a string list, provided they are not already present. This is an O(n**2) operation.

Parameters:
lhs The string list to be added to.
rhs The string list to be added to the end of lhs.

Definition at line 481 of file str_list.h.

void string_list_append_unique ( string_list_ty lhs,
string_ty rhs 
) [inline]

The string_list_append_unique function is used to add another string to the end of a string list, provided it is not already present. This is an O(n) operation.

Parameters:
lhs The string list to be added to.
rhs The string to be added to the end of lhs.

Definition at line 465 of file str_list.h.

void string_list_constructor ( string_list_ty slp  )  [inline]

The string_list_constructor function is used to prepare a string list for use. (Note: strings lists which are global variables do NOT need this function called before use).

Definition at line 544 of file str_list.h.

void string_list_copy ( string_list_ty lhs,
const string_list_ty rhs 
) [inline]

The string_list_copy function is sued to replace the contents of one string list with another. This is more like a copy constructor than an assignment operator. The previous contents will be discarded NOT free()ed.

Definition at line 493 of file str_list.h.

void string_list_destructor ( string_list_ty slp  )  [inline]

The string_list_destructor function is used to release all resources held by a string list. This function shall be called when you are finished with a string list.

Definition at line 531 of file str_list.h.

int string_list_member ( const string_list_ty slp,
string_ty s 
) [inline]

The string_list_member function is used to test for the existence of a string in a string list. (This is an O(n) search.)

Definition at line 344 of file str_list.h.

void string_list_prepend ( string_list_ty lhs,
string_ty rhs 
) [inline]

The string_list_prepend function is used to add another string to the start of a string list.

Parameters:
lhs The string list to be added to.
rhs The string to be added to the front of lhs.

Definition at line 404 of file str_list.h.

void string_list_prepend_list ( string_list_ty lhs,
const string_list_ty rhs 
) [inline]

The string_list_prepend_list function is used to add all the strings of another string list to the start of a string list.

Parameters:
lhs The string list to be added to.
rhs The string list to be added to the front of lhs.

Definition at line 419 of file str_list.h.

void string_list_quote_shell ( string_list_ty lhs,
const string_list_ty rhs 
) [inline]

The string_list_quote_shell function is used to shell quote each string in a list of strings. The quoting is done by using the str_quote_shell() function.

Parameters:
lhs The place to put this list of quoted strings.
rhs The unquoted input strings.

Definition at line 618 of file str_list.h.

void string_list_remove ( string_list_ty slp,
string_ty s 
) [inline]

The string_list_remove function is used to remove a speific valued string from a string list. If there are no occurrences, it is not an error. If there is more than one occurrece, only the first will be removed. This is an O(n) operation.

Definition at line 505 of file str_list.h.

void string_list_remove_list ( string_list_ty lhs,
const string_list_ty rhs 
) [inline]

The string_list_remove_list function is used to remove all instances of one string list (rhs) from another string list (lhs).

Parameters:
lhs The string list to have element removed.
rhs The list of values to be removed from lhs.

Definition at line 520 of file str_list.h.

void string_list_sort ( string_list_ty slp  )  [inline]

The string_list_sort function is used to sort a list of strings. The comparison function is strcmp(3). This is an O(n log n) operation.

Definition at line 602 of file str_list.h.

int string_list_subset ( const string_list_ty lhs,
const string_list_ty rhs 
) [inline]

The string_list_subset function is used to determine if lhs is an (improper) subset of rhs.

Returns:
Returns true (non-zero) if the two sets of strings are the same, false (zero) if they are not.

Definition at line 591 of file str_list.h.

string_ty* wl2str ( const string_list_ty slp,
int  start,
int  finish,
const char *  sep 
) [inline]

The wl2str function is used to convert a list of strings into a single string, separated by the given separator.

Parameters:
slp The string list to be joined.
start The index of the first string in the list to be joined (counting from zero).
finish The index of the last string in the list to be joined (counting from one, or one past the end, counting from zero).
sep The separator characters. Defaults to spaces if NULL.

Definition at line 365 of file str_list.h.


Generated on Wed Mar 12 23:37:38 2008 for Aegis by  doxygen 1.5.5