Aegis  4.25.D505
Public Member Functions | Private Attributes
nstring_list Class Reference

#include <list.h>

Public Member Functions

 ~nstring_list ()
 nstring_list ()
 nstring_list (const nstring_list &arg)
 nstring_list (const string_list_ty &arg)
nstring_listoperator= (const nstring_list &)
void push_front (const nstring &arg)
void push_front (const nstring_list &arg)
void push_back (const nstring &arg)
void push_back (const nstring_list &arg)
void push_back_unique (const nstring &arg)
void push_back_unique (const nstring_list &arg)
void pop_back (void)
const nstring back (void) const
void pop_front (void)
nstring front (void) const
size_t size (void) const
bool empty (void) const
void clear (void)
nstring get (int n) const
nstring operator[] (int n) const
void split (const nstring &str, const char *sep=0, bool ewhite=false)
nstring unsplit (const char *separator=0) const
nstring unsplit (size_t begin, size_t length, const char *separator=0) const
bool member (const nstring &arg) const
void sort (void)
void sort_version (void)
void sort_nocase (void)
int gmatch_pattern (const nstring &pattern) const
int gmatch_candidate (const nstring &candidate) const
void remove (const nstring &arg)
void operator+= (const nstring_list &rhs)
nstring_list operator+ (const nstring_list &rhs) const
void operator-= (const nstring_list &rhs)
nstring_list operator- (const nstring_list &rhs) const
void operator*= (const nstring_list &rhs)
nstring_list operator* (const nstring_list &rhs) const
bool operator!= (const nstring_list &rhs) const
bool operator== (const nstring_list &rhs) const

Private Attributes

string_list_ty content

Detailed Description

The nstring_list class is used to represent a dynamically sized list of nstrings.

Definition at line 29 of file list.h.


Constructor & Destructor Documentation

The destructor.

This class is not to be derived from because the destructor is not virtual.

Definition at line 38 of file list.h.

The default constructor.

Definition at line 45 of file list.h.

nstring_list::nstring_list ( const nstring_list arg) [inline]

The copy constructor.

Definition at line 52 of file list.h.

nstring_list::nstring_list ( const string_list_ty arg) [inline]

The backwards compatible copy constructor.

Definition at line 60 of file list.h.


Member Function Documentation

const nstring nstring_list::back ( void  ) const [inline]

The back method is used to obtain the value of the last element of a string list.

Definition at line 147 of file list.h.

void nstring_list::clear ( void  )

The clear method is used to discard all elemets of a string list.

bool nstring_list::empty ( void  ) const [inline]

The empty method is used to determine whether the string list is empty (no elements) or not.

Definition at line 190 of file list.h.

nstring nstring_list::front ( void  ) const [inline]

The front method is used to obtain the value of the first element of a string list.

Definition at line 166 of file list.h.

nstring nstring_list::get ( int  n) const

The get method is used to obtain the value of the nth element of a string list.

int nstring_list::gmatch_candidate ( const nstring candidate) const

The gmatch_candidate method is used to determine if there is at least one member of the string list which matches the given pattern.

Parameters:
candidateThis is the candidate string to be matched against each pattern in the string list.
Returns:
int; 1 for a match, 0 for no match, -1 for invalid pattern.
int nstring_list::gmatch_pattern ( const nstring pattern) const

The gmatch_pattern method is used to determine if there is at least one member of the string list which matches the given pattern.

Parameters:
patternThis is a file globbing pattern, such as used by the shell for expanding file names. See glob(3) for a definition of the patterns.
Returns:
int; 1 for a match, 0 for no match, -1 for invalid pattern.
bool nstring_list::member ( const nstring arg) const

The member method is used to test whether the given narrow string is present in the narrow string list,

Parameters:
argThe narrow string to look for.
Returns:
bool; false if not present, true if present at least once.
bool nstring_list::operator!= ( const nstring_list rhs) const

The inequality operator is used to determine whether or not this string set is the same as another string set.

Parameters:
rhsThe right hand side of the comparison
Returns:
bool; true if not equal (at least one string not in common), false if equal (all strings in common)
nstring_list nstring_list::operator* ( const nstring_list rhs) const

The multiply operator is used to perform a set intersection of this string list with another string list.

Parameters:
rhsThe right has side of the string set intersection.
Returns:
string set intersection
void nstring_list::operator*= ( const nstring_list rhs)

The multiply-in-situ operator is used to perform an in-situ set intersection of this string list with another string list.

Parameters:
rhsThe right has side of the string set intersection.
nstring_list nstring_list::operator+ ( const nstring_list rhs) const

The add operator is used to perform a set union of this string list with another string list.

Parameters:
rhsThe right has side of the string set union.
Returns:
string set union
void nstring_list::operator+= ( const nstring_list rhs)

The add-in-situ operator is used to perform an in-situ set union of this string list with another string list.

Parameters:
rhsThe right has side of the string set union.
nstring_list nstring_list::operator- ( const nstring_list rhs) const

The subtract operator is used to perform a set difference of this string list with another string list.

Parameters:
rhsThe right has side of the string set difference.
Returns:
string set difference
void nstring_list::operator-= ( const nstring_list rhs)

The subtract-in-situ operator is used to perform an in-situ set difference of this string list with another string list.

Parameters:
rhsThe right has side of the string set difference.
nstring_list& nstring_list::operator= ( const nstring_list )

The assignment operator.

bool nstring_list::operator== ( const nstring_list rhs) const

The equality operator is used to determine whether or not this string set is the same as another string set.

Parameters:
rhsThe right hand side of the comparison
Returns:
bool; true if equal (all strings in common), false if not equal (at least one string not in common).
nstring nstring_list::operator[] ( int  n) const [inline]

The [] operator is used to obtain the value of the nth element of a string list.

Definition at line 212 of file list.h.

void nstring_list::pop_back ( void  ) [inline]

The pop_back method is used to discard the last value in the list. This has O(1) behaviour.

Definition at line 137 of file list.h.

void nstring_list::pop_front ( void  )

The pop_front method is used to discard the first value in the list. This has O(n) behaviour.

void nstring_list::push_back ( const nstring arg) [inline]

The push_back method is used to add a string to the end of a string list.

Definition at line 101 of file list.h.

void nstring_list::push_back ( const nstring_list arg)

The push_back method is used to append an nstring list onto the end of this list.

Parameters:
argThe strings to push
void nstring_list::push_back_unique ( const nstring arg) [inline]

The push_back_unique method is used to add a string to the end of a string list, provided it isn't already in the list.

Definition at line 120 of file list.h.

The push_back_unique method is used to add a list of strings to the end of a string list, provided it they aren't already in the list.

void nstring_list::push_front ( const nstring arg) [inline]

The push_front method is used to add a string to the front of a string list.

Parameters:
argThe list of strings to be prepended.

Definition at line 78 of file list.h.

void nstring_list::push_front ( const nstring_list arg) [inline]

The push_front method is used to add a string list to the front of a string list.

Parameters:
argThe list of strings to be prepended.

Definition at line 91 of file list.h.

void nstring_list::remove ( const nstring 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.

Parameters:
argThe string value to be removed.
size_t nstring_list::size ( void  ) const [inline]

The size method is used to obtain the size of the list (the number of string in the list).

Definition at line 179 of file list.h.

void nstring_list::sort ( void  )

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 nstring_list::sort_nocase ( void  )

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 nstring_list::sort_version ( void  )

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.

void nstring_list::split ( const nstring str,
const char *  sep = 0,
bool  ewhite = false 
)

The split method is used to replace the contents of the list with a new list, formed by splitting "str" into several pieces, separated by any pf the characters in "sep".

Parameters:
strThe string to be split.
sepThe separators between each field.
ewhiteIf true, get rid of extra white space at the beginning and end of each field. Default to false.
nstring nstring_list::unsplit ( const char *  separator = 0) const

The unsplit method is used to form a single string by glueing all of the string list members together.

Parameters:
separatorThe string to place bewteen each list emlement
nstring nstring_list::unsplit ( size_t  begin,
size_t  length,
const char *  separator = 0 
) const

The unsplit method is used to form a single string by glueing all of the string list members together.

Parameters:
beginThe index of the first element to be joined
lengthThe number of elements to join together.
separatorThe string to place bewteen each list element.

Field Documentation

The content instance variable is used to remember the contents of the string list.

Definition at line 413 of file list.h.


The documentation for this class was generated from the following file: