#include <NameList.h>
Public Member Functions | |
| NameList () | |
| Create an empty NameList, then use add() to fill it. | |
| NameList (vector< std::string > &names) | |
| Create a NameList, and then fill it from the passed vector. | |
| NameList (NameList &nl) | |
| Create a clone of the passed NameList. | |
| NameList (const char *fname) | |
| Create a NameList, and fill it from whitespace-separated strings in the passed file. | |
| NameList (string &list) | |
| Create a NameList, and fill it by parsing the passed string, breaking at whitespace. | |
| void | load (const char *fname) |
| Fills the NameList from whitespace-separated strings in the passed file. | |
| int | size () |
| Returns the number of stored names. | |
| void | add (const string &name) |
| Adds a string to the set. | |
| const string & | at (int i) |
| Returns the string stored at position i. | |
| bool | operator== (NameList &a) |
| Returns true if the lists are the same length and each entry is the same. | |
| bool | operator!= (NameList &a) |
| The converse of the '==' operator. | |
| int | getIndex (const string &name) |
| If the passed string is identical to one of the stored entries, returns the entry's index. | |
| int | maxNameLen () |
| Returns the length of the longest stored string. | |
Friends | |
| ostream & | operator<< (ostream &s, NameList &nl) |
| Prints the entries in the NameList, separated by spaces, preceded by "[ ", and with the suffix "] ". | |
| istream & | operator>> (istream &s, NameList &nl) |
| Reads a NameList from the passed istream. | |
|
|
Create an empty NameList, then use add() to fill it.
|
|
|
Create a NameList, and then fill it from the passed vector.
|
|
|
Create a clone of the passed NameList.
|
|
|
Create a NameList, and fill it from whitespace-separated strings in the passed file.
|
|
|
Create a NameList, and fill it by parsing the passed string, breaking at whitespace.
|
|
|
Adds a string to the set.
|
|
|
Returns the string stored at position i.
|
|
|
If the passed string is identical to one of the stored entries, returns the entry's index.
|
|
|
Fills the NameList from whitespace-separated strings in the passed file.
|
|
|
Returns the length of the longest stored string.
|
|
|
The converse of the '==' operator.
|
|
|
Returns true if the lists are the same length and each entry is the same.
|
|
|
Returns the number of stored names.
|
|
||||||||||||
|
Prints the entries in the NameList, separated by spaces, preceded by "[ ", and with the suffix "] ".
|
|
||||||||||||
|
Reads a NameList from the passed istream. The "[" and "]" are optional |
1.4.3