# CStringArray Class Reference

The CStringArray is an uni-dimensional array of CString objects. More...

`#include <xsi_string.h>`

List of all members.

## Public Member Functions
| CStringArray (LONG in_size=0)
| CStringArray (const CStringArray &in_array)
| ~CStringArray ()
CStringArray & | operator= (const CStringArray &in_array)
LONG | GetCount () const
CStatus | Add (const CString &in_item)
CStatus | Clear ()
CStatus | Resize (LONG in_size)
const CString & | operator[] (LONG in_index) const
CString & | operator[] (LONG in_index)
bool | operator== (const CStringArray &in_array) const
bool | operator!= (const CStringArray &in_array) const

## Detailed Description

The CStringArray is an uni-dimensional array of CString objects.

The array is zero-based, which means that the first item index is 0 and the largest index is one less than the number of elements contained in the array.

See also:
  CString, CRefArray::Filter, X3DObject::FindChild, X3DObject::FindChildren

## Constructor & Destructor Documentation

CStringArray | ( | LONG | in_size = `0` | ) |

Constructs a CStringArray and optionally initializes the array to a known size.

Parameters:

  | in_size | Initial size of array, defaults to 0. If you know the exact number of items you want to save in the array, it can be more efficient to specify the value using this argument, rather than calling CStringArray::Add() many times.

CStringArray | ( | const CStringArray & | in_array | ) |

Constructs a CStringArray object from another CStringArray object.

Parameters:

  | in_array | read-only CStringArray object.

~CStringArray | ( |  | ) |

Default destructor.

## Member Function Documentation

CStringArray& operator= | ( | const CStringArray & | in_array | ) |

Assignment operator. Current contents of this array are replaced by a copy of in_array's contents.

Parameters:

  | in_array | read-only class object.

Returns:
  A reference to this array.

LONG GetCount | ( |  | ) | const

Returns the number of items in this CStringArray

Returns:
  The number of items in the array.

CStatus Add | ( | const CString & | in_item | ) |

Adds a CString at the end of this array's. This increases the size of the Array. The CString is copied.

Parameters:

  | in_item | New item to be added at the end of the array.

Returns:
  CStatus::OK success

CStatus Clear | ( |  | ) |

Erases all elements contained in the array.

Returns:
  CStatus::OK success

CStatus Resize | ( | LONG | in_size | ) |

Reallocates memory for the array. Existing contents are preserved, except for items at the end of the array if the new size is smaller than the existing size.

Parameters:

  | in_size | New size of the array.

Returns:
  CStatus::OK success

  CStatus::InvalidArgument in_size < 0

const CString& operator[] | ( | LONG | in_index | ) | const

Accessor to elements at a given index. The returned value is read-only.

Parameters:

  | in_index | index in this zero-based array. The index must be greater or equal to zero and smaller than the number of elements in the array, otherwise the results are unpredictable.

Returns:
  A read-only reference to the indexed item.

CString& operator[] | ( | LONG | in_index | ) |

Accessor to elements at a given index.

Parameters:

  | in_index | index in this zero-based array. The index must be greater or equal to zero and smaller than the number of elements in the array, otherwise the results are unpredictable.

Returns:
  A reference to the indexed item.

bool operator== | ( | const CStringArray & | in_array | ) | const

Equality operator.

Parameters:

  | in_array | CStringArray to compare with.

Returns:
  true if in_array contains the same number of elements as this array and if all members of in_array are equal to the corresponding one contained in this array.

bool operator!= | ( | const CStringArray & | in_array | ) | const

Inequality operator.

Parameters:

  | in_array |

Returns:
  true if any member of in_array is different from the corresponding members in this array or if the arrays are not of the same size.

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

- xsi_string.h