PARP Research Group Universidad de Murcia


QVIndexedStringList Class Reference

String List with a current string index. More...

#include <QVIndexedStringList>

List of all members.

Public Member Functions

 QVIndexedStringList ()
 Constructs a void QVIndexedStringList. Its index must be -1.
 QVIndexedStringList (const QVIndexedStringList &l)
 Copy constructor from a QVIndexedStringList.
 QVIndexedStringList (const QStringList &l)
 Copy constructor from a QStringList. Its index must be 0 or -1 if is empty.
 QVIndexedStringList (const QString &i)
 Copy constructor from a QString. Creates a new QVIndexedStringList that contains the gives string an its index is 0 (the first item of the list).
int getIndex () const
 Return the index.
QString getCurrent () const
 Return the current string, marked by the index.
bool setIndex (int i)
 Sets the index to i.
bool incIndex ()
 Increment the index. if (i >= list size -1), do nothing and return false.
bool decIndex ()
 Decrement the index. if (i < 0), do nothing and return false.
void append (const QString &str)
 Inserts a string as the last element of the list. if there are no elements in the list, i becomes 0.

Detailed Description

String List with a current string index.

This class represents a string list with an index, the index marks the current string in the list. The index values are: -1, there are no items in the list. 0 ... n-1, the strings of the list.

Definition at line 41 of file qvindexedstringlist.h.


Constructor & Destructor Documentation

QVIndexedStringList::QVIndexedStringList (  )  [inline]

Constructs a void QVIndexedStringList. Its index must be -1.

Definition at line 50 of file qvindexedstringlist.h.

QVIndexedStringList::QVIndexedStringList ( const QVIndexedStringList l  )  [inline]

Copy constructor from a QVIndexedStringList.

Definition at line 54 of file qvindexedstringlist.h.

QVIndexedStringList::QVIndexedStringList ( const QStringList &  l  )  [inline]

Copy constructor from a QStringList. Its index must be 0 or -1 if is empty.

Definition at line 59 of file qvindexedstringlist.h.

QVIndexedStringList::QVIndexedStringList ( const QString &  i  )  [inline]

Copy constructor from a QString. Creates a new QVIndexedStringList that contains the gives string an its index is 0 (the first item of the list).

Definition at line 64 of file qvindexedstringlist.h.


Member Function Documentation

int QVIndexedStringList::getIndex (  )  const [inline]

Return the index.

Definition at line 79 of file qvindexedstringlist.h.

Referenced by decIndex(), and incIndex().

QString QVIndexedStringList::getCurrent (  )  const

Return the current string, marked by the index.

Definition at line 67 of file qvindexedstringlist.cpp.

bool QVIndexedStringList::setIndex ( int  i  ) 

Sets the index to i.

Parameters:
i the new index.

if (i < -1) or (i >= list size), do nothing and return false.

Returns:
if the change has been done.

Definition at line 73 of file qvindexedstringlist.cpp.

Referenced by decIndex(), and incIndex().

bool QVIndexedStringList::incIndex (  ) 

Increment the index. if (i >= list size -1), do nothing and return false.

Returns:
if the change has been done.

Definition at line 83 of file qvindexedstringlist.cpp.

bool QVIndexedStringList::decIndex (  ) 

Decrement the index. if (i < 0), do nothing and return false.

Returns:
if the change has been done.

Definition at line 87 of file qvindexedstringlist.cpp.

void QVIndexedStringList::append ( const QString &  str  ) 

Inserts a string as the last element of the list. if there are no elements in the list, i becomes 0.

Definition at line 59 of file qvindexedstringlist.cpp.

Referenced by QVIndexedStringList().


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



QVision framework. PARP research group. Copyright © 2007, 2008, 2009, 2010, 2011.