Class representing an array of string values. More...
#include <StringArray.hpp>
Public Member Functions | |
virtual DataValue * | clone () |
Clone method. This clones the array. | |
unsigned int | getSize () |
Gives the size of the array. | |
DataType | getType () |
bool | isDynamic () |
Tests if the array is dynamic or not. | |
virtual | operator std::string () const |
String cast operation. Converts the string array into its string representation. | |
shared_ptr< String > & | operator[] (const int index) |
Getter. Returns a pointer to the object at a specific position in the array. | |
void | pushBack (shared_ptr< String > value) |
Operation that adds a data element at the end of the array. This operation is only valid in dynamic arrays. | |
void | pushBack (std::string s) |
Operation that appends a string value to the end of the array. This is only valid in dynamic arrays. | |
StringArray (int size) | |
Constructor. This initializes the array as static, with the given size. | |
StringArray () | |
Default constructor. This initializes the array as dynamic. | |
Protected Member Functions | |
void | copyFrom (const DataValue &otherValue) |
Protected Attributes | |
std::vector< shared_ptr< String > > | array_ |
bool | isDynamic_ |
DataType | type_ |
Class representing an array of string values.
Definition at line 47 of file StringArray.hpp.
StringArray::StringArray | ( | ) |
Default constructor. This initializes the array as dynamic.
Definition at line 40 of file StringArray.cpp.
StringArray::StringArray | ( | int | size | ) |
Constructor. This initializes the array as static, with the given size.
size | Size of the static string array. |
Definition at line 45 of file StringArray.cpp.
DataValue * StringArray::clone | ( | ) | [virtual] |
Clone method. This clones the array.
Implements mermaid::support::data::DataValue.
Definition at line 55 of file StringArray.cpp.
unsigned int mermaid::support::data::DataArray< String >::getSize | ( | ) | [inline, inherited] |
Gives the size of the array.
Definition at line 99 of file DataArray.hpp.
bool mermaid::support::data::DataArray< String >::isDynamic | ( | ) | [inline, inherited] |
Tests if the array is dynamic or not.
Definition at line 91 of file DataArray.hpp.
StringArray::operator std::string | ( | ) | const [virtual] |
String cast operation. Converts the string array into its string representation.
Implements mermaid::support::data::DataValue.
Definition at line 60 of file StringArray.cpp.
shared_ptr<String >& mermaid::support::data::DataArray< String >::operator[] | ( | const int | index | ) | [inline, inherited] |
Getter. Returns a pointer to the object at a specific position in the array.
index | Position of the array to be accessed. |
Definition at line 71 of file DataArray.hpp.
void mermaid::support::data::DataArray< String >::pushBack | ( | shared_ptr< String > | value | ) | [inline, inherited] |
Operation that adds a data element at the end of the array. This operation is only valid in dynamic arrays.
value | Value to be added at the end of the array. |
Definition at line 79 of file DataArray.hpp.
void StringArray::pushBack | ( | std::string | s | ) |
Operation that appends a string value to the end of the array. This is only valid in dynamic arrays.
s | String value to be appended. |
Definition at line 81 of file StringArray.cpp.