Public Member Functions
CICEAttributeDataArrayString Class Reference

Detailed Description

This class is a specialization of CICEAttributeDataArray which allows access to the ICEAttribute data as a 1D array of type siICENodeDataString. CICEAttributeDataArrayString objects are read-only and can be filled with the methods supplied with the ICEAttribute class.

See also:
ICEAttribute::GetDataArray, ICEAttribute::GetDataArrayChunk, CICEAttributeDataArray2DString, Type Definitions for CICEAttributeDataArray
Since:
9.0 (2011)
Example:
This example demonstrates how to iterate over the siICENodeDataString attributes on a geometry. For a more detailed example, check out the ICEAttribute/netview_ICEAttribute Inspect ICE Attributes example.
        using namespace XSI;

        Application app;
        X3DObject x3dObj = app.GetSelection().GetItem(0);
        ICEAttribute attr = x3dObj.GetActivePrimitive().GetGeometry().GetICEAttributeFromName( L"MyStringAttribute" );

        // Log the data pointer address and size of data.
        CICEAttributeDataArrayString strData;
        attr.GetDataArray( strData );

        for( ULONG i=0; i<strData.GetCount( ); i++ )
        {
            ULONG nCount;
            const CICEAttributeDataArrayString::TData* pStr;
            strData.GetData( i, &pStr, nCount );

            app.LogMessage( CString( pStr, nCount ) + L":" + CString( nCount ) );
        }

#include <xsi_iceattributedataarray.h>

Inheritance diagram for CICEAttributeDataArrayString:
Inheritance graph
[legend]

List of all members.

Public Member Functions

SICPPSDK_INLINE  CICEAttributeDataArrayString ()
SICPPSDK_INLINE  ~CICEAttributeDataArrayString ()
SICPPSDK_INLINE CStatus  GetData (ULONG in_nIndex, const TData **out_ppStr, ULONG &out_nCount) const
SICPPSDK_INLINE CStatus  GetData (ULONG in_nIndex, CString &out_str) const
SICPPSDK_INLINE CString  operator[] (ULONG in_nIndex) const

Constructor & Destructor Documentation

SICPPSDK_INLINE CICEAttributeDataArrayString ( ) [inline]

Default Constructor.

SICPPSDK_INLINE ~CICEAttributeDataArrayString ( ) [inline]

Destructor.


Member Function Documentation

CStatus GetData ( ULONG  in_nIndex,
const TData **  out_ppStr,
ULONG &  out_nCount 
) const

Returns a pointer to the string stored at a specific index. The data is read-only and cannot be modified.

Note:
The memory allocated for the data returned by CICEAttributeDataArrayString::GetData is only available within the scope of this CICEAttributeDataArrayString instance. Make sure to make a copy of the data if you need to access it outside the scope of CICEAttributeDataArrayString.
Note:
The string returned in out_ppStr is not null-terminated, the caller must make sure to take the number of characters in account when manipulating the string.
Parameters:
in_nIndex Array index of the user data to retrieve. The size is 0 if no data is stored at this index.
Return values:
out_ppStr Read-only pointer to the data.
out_nCount Number of characters in the string.
Returns:
Success/failure
SICPPSDK_INLINE CStatus GetData ( ULONG  in_nIndex,
CString out_str 
) const

Returns a CString object set with a copy of the string stored at a specific index.

Parameters:
in_nIndex Array index of the string to retrieve. The object is empty if no string is stored at this index.
Return values:
out_str Copy of the string.
Returns:
Success/failure
SICPPSDK_INLINE CString operator[] ( ULONG  in_nIndex ) const

Returns a CString stored at in_nIndex. The CString object will contain a copy of the string.

Parameters:
in_nIndex Index in the array. The index must be smaller than the number of elements in the array, otherwise the object returned is empty.
Returns:
Copy of the CString.

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