nstring_list Class Reference
#include <list.h>
Detailed Description
The
nstring_list class is used to represent a dynamically sized list of nstrings.
Definition at line 30 of file list.h.
Constructor & Destructor Documentation
nstring_list::~nstring_list |
( |
|
) |
[inline] |
The destructor.
This class is not to be derived from because the destructor is not virtual.
Definition at line 39 of file list.h.
nstring_list::nstring_list |
( |
|
) |
[inline] |
The default constructor.
Definition at line 46 of file list.h.
nstring_list::nstring_list |
( |
const nstring_list & |
arg |
) |
[inline] |
The copy constructor.
Definition at line 53 of file list.h.
The backwards compatible copy constructor.
Definition at line 61 of file list.h.
Member Function Documentation
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 76 of file list.h.
The push_back method is used to append an nstring list onto the end of this list.
- Parameters:
-
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 95 of file list.h.
void nstring_list::push_back_unique |
( |
const nstring_list & |
arg |
) |
|
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::pop_back |
( |
|
) |
[inline] |
The pop_back method is used to discard the last value in the list. This has O(1) behaviour.
Definition at line 112 of file list.h.
const nstring nstring_list::back |
( |
|
) |
const [inline] |
The back method is used to obtain the value of the last element of a string list.
Definition at line 122 of file list.h.
size_t nstring_list::size |
( |
|
) |
const [inline] |
The size method is used to obtain the size of the list (the number of string in the list).
Definition at line 135 of file list.h.
bool nstring_list::empty |
( |
|
) |
const [inline] |
The empty method is used to determine whether the string list is empty (no elements) or not.
Definition at line 146 of file list.h.
void nstring_list::clear |
( |
|
) |
|
The clear method is used to discard all elemets of a string list.
nstring nstring_list::get |
( |
int |
n |
) |
const |
The get method is used to obtain the value of the nth element of a string list.
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 168 of file list.h.
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:
-
| str | The string to be split. |
| sep | The separators between each field. |
| ewhite | If 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 gluing all of the string list members together.
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:
-
| arg | The narrow string to look for. |
- Returns:
- bool; false if not present, true if present at least once.
void nstring_list::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.
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:
-
| pattern | This 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.
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:
-
| candidate | This 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.
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:
-
| arg | The string value to be removed. |
Field Documentation
The content instance variable is used to remember the contents of the string list.
Definition at line 254 of file list.h.
The documentation for this class was generated from the following file: