Overview     Modules     Class Hierarchy     Classes     Members  

tlp::StringCollection Struct Reference

#include <StringCollection.h>

List of all members.

Public Member Functions


Detailed Description

This class represents a list of selectable string entries that can be used as plugin parameter. The list will appear as a combo box in the Plugin Parameter Dialog from the Tulip GUI.


Constructor & Destructor Documentation

tlp::StringCollection::StringCollection (  ) 

Initializes an empty string collection.

tlp::StringCollection::StringCollection ( const std::vector< std::string > &  vectorParam  )  [explicit]

Initializes a string collection with strings stored in a vector.

Parameters:
vectorParam a vector of strings entries for the string collection
tlp::StringCollection::StringCollection ( const std::string  param  ) 

Initializes a string collection from a semicolon separated values string.

Parameters:
param a semicolon separated values string ("entry1;...;entryN"). If an entry need to contain a semicolon, you have to escape it the following way : \; .
tlp::StringCollection::StringCollection ( const std::vector< std::string > &  vectorParam,
int  currentParam 
)

Initializes a string collection with strings stored in a vector.

Parameters:
vectorParam a vector of strings entries for the string collection
currentParam the index of the current selected string in the vector
tlp::StringCollection::StringCollection ( const std::vector< std::string > &  vectorParam,
std::string  currentString 
)

Initializes a string collection with strings stored in a vector.

Parameters:
vectorParam a vector of strings entries for the string collection
currentString the current selected string value from the vector

Member Function Documentation

std::string tlp::StringCollection::at ( size_t  index  )  [inline]

Returns the string element at a certain index in the collection.

Parameters:
index a valid index in the collection
bool tlp::StringCollection::empty (  )  [inline]

Returns true if the collection is empty.

int tlp::StringCollection::getCurrent (  ) 

Returns the index of the current selected string.

std::string tlp::StringCollection::getCurrentString (  ) 

Returns the current selected string value.

std::string& tlp::StringCollection::operator[] ( const unsigned int  i  )  [inline]
std::string tlp::StringCollection::operator[] ( const unsigned int  i  )  const [inline]
void tlp::StringCollection::push_back ( const std::string &  element  )  [inline]

Adds a string value to this string collection.

Parameters:
element the string to add to the collection
bool tlp::StringCollection::setCurrent ( std::string  param  ) 

Sets the current selected string value. Returns true if the string value exists in the collection.

Parameters:
param a string value from the collection
bool tlp::StringCollection::setCurrent ( unsigned int  param  ) 

Sets the current selected string index. Returns true if the provided index is valid.

Parameters:
param a valid index in the string collection
size_t tlp::StringCollection::size (  )  [inline]

Returns the number of strings in the collection.



Tulip Software by LaBRI Visualization Team    2001 - 2012