예제 #1
0
static AwaError ClientSetOperation_AddValues(AwaClientSetOperation * operation, const char * path, const AwaArray * array, AwaResourceType type)
{
    AwaError result = AwaError_Unspecified;

    AwaArrayIterator * iterator = ArrayIterator_New(array);

    if (iterator)
    {
        while(ArrayIterator_Next(iterator))
        {
            AwaArrayIndex index = ArrayIterator_GetIndex(iterator);
            void * value = ArrayIterator_GetValue(iterator);
            size_t length = ArrayIterator_GetValueLength(iterator);

            if (type == AwaResourceType_OpaqueArray)
            {
                AwaOpaque * opaque = value;
                value = opaque->Data;
                length = opaque->Size;
            }

            LogDebug("Adding value %p", value);

            if (value)
            {
                result = ClientSetOperation_AddValue(operation, path, index, value, length, type, SetArrayMode_Replace);
                if (result != AwaError_Success)
                {
                    LogError("Unable to add array resource Instance");
                    break;
                }
            }
            else
            {
                result = LogErrorWithEnum(AwaError_Internal , "Problem with array");
                break;
            }
        }

        ArrayIterator_Free(&iterator);
    }
    else
    {
        result = LogErrorWithEnum(AwaError_OperationInvalid, "Operation is NULL");
    }

    return result;
}
예제 #2
0
AwaArrayIndex AwaCStringArrayIterator_GetIndex(const AwaCStringArrayIterator * iterator)
{
    return ArrayIterator_GetIndex((const AwaArrayIterator *)iterator);
}
예제 #3
0
AwaArrayIndex AwaObjectLinkArrayIterator_GetIndex(const AwaObjectLinkArrayIterator * iterator)
{
    return ArrayIterator_GetIndex((const AwaArrayIterator *)iterator);
}
예제 #4
0
AwaArrayIndex AwaFloatArrayIterator_GetIndex(const AwaFloatArrayIterator * iterator)
{
    return ArrayIterator_GetIndex((AwaArrayIterator *)iterator);
}