SEIntList represents a list of integers. More...
#include <skype-int-list.h>
Public Member Functions | |
| SEIntList () | |
| SEIntList (const SEIntList &sl) | |
| ~SEIntList () | |
| SEIntList & | append (const int i) |
| void | push_back (const int &i) |
| int | peek () |
| size_t | size () const |
| int & | operator[] (unsigned int index) |
| int & | operator[] (unsigned int index) const |
| SEIntList & | operator= (const SEIntList &sl) |
| bool | contains (const int val) |
| bool | remove_val (const int val) |
| bool | remove_pos (const unsigned int pos) |
| int | find_pos (const int val) |
| void | resize (const unsigned int new_size) |
| void | clear () |
Static Public Member Functions | |
| static SEIntList | split (const SEString &str, char sep, char esc= '\\') |
SEIntList represents a list of integers.
The operator [] is supported, which can be used to go through the list.
tutorial_2.cpp, and tutorial_3.cpp.
Definition at line 13 of file skype-int-list.h.
| SEIntList::SEIntList | ( | ) |
Creates an empty list of integers.
Definition at line 34 of file skype-int-list.cpp.
| SEIntList::SEIntList | ( | const SEIntList & | sl | ) |
Constructs an implicitly shared copy of sl.
Definition at line 40 of file skype-int-list.cpp.
| SEIntList::~SEIntList | ( | ) |
Destroys the list and frees the data if this is the last reference to the list.
Definition at line 46 of file skype-int-list.cpp.
| SEIntList & SEIntList::append | ( | const int | i | ) |
Appends an integer at the end of the list.
Definition at line 66 of file skype-int-list.cpp.
| void SEIntList::clear | ( | ) |
Definition at line 450 of file skype-int-list.cpp.
References size().
| bool SEIntList::contains | ( | const int | val | ) |
Definition at line 363 of file skype-int-list.cpp.
References find_pos().
| int SEIntList::find_pos | ( | const int | val | ) |
Definition at line 351 of file skype-int-list.cpp.
References size().
Assigns a shallow copy of sl to this list and returns a reference to it. This is very fast because the list isn't actually copied.
Definition at line 188 of file skype-int-list.cpp.
| int & SEIntList::operator[] | ( | unsigned int | index | ) |
Returns the integer specified by its index.
Definition at line 174 of file skype-int-list.cpp.
| int& SEIntList::operator[] | ( | unsigned int | index | ) | const [inline] |
Definition at line 43 of file skype-int-list.h.
| int SEIntList::peek | ( | ) |
Removes the first element from the list and returns it.
Definition at line 111 of file skype-int-list.cpp.
| void SEIntList::push_back | ( | const int & | i | ) | [inline] |
Definition at line 33 of file skype-int-list.h.
References append().
| bool SEIntList::remove_pos | ( | const unsigned int | pos | ) |
Definition at line 376 of file skype-int-list.cpp.
References size().
| bool SEIntList::remove_val | ( | const int | val | ) |
Definition at line 368 of file skype-int-list.cpp.
References find_pos(), and remove_pos().
| void SEIntList::resize | ( | const unsigned int | new_size | ) |
Definition at line 408 of file skype-int-list.cpp.
| size_t SEIntList::size | ( | ) | const |
Returns the size of the list.
Definition at line 136 of file skype-int-list.cpp.
Splits a string in a list of integer using the separaror sep.
Definition at line 295 of file skype-int-list.cpp.
References append(), SEString::length(), SEString::substr(), and SEString::toInt().
(c) Skype Technologies S.A. Confidential/Proprietary
Last updated: Fri Mar 16 2012