示例#1
0
static void
set_slot_from_value (slot_info_t* pInfo, KvpValue* pValue)
{
    g_return_if_fail (pInfo != NULL);
    g_return_if_fail (pValue != NULL);

    switch (pInfo->context)
    {
    case FRAME:
    {
        auto key = get_key_from_path (pInfo->path);
        pInfo->pKvpFrame->set (key.c_str(), pValue);
        break;
    }
    case LIST:
    {
        pInfo->pList = g_list_append (pInfo->pList, pValue);
        break;
    }
    case NONE:
    default:
    {
        auto key = get_key_from_path (pInfo->path);
        auto path = get_path_from_path (pInfo->path);
        auto frame = pInfo->pKvpFrame;
        if (!path.empty())
        {
            frame->set_path ({path.c_str(), key.c_str()}, pValue);
        }
        else
            frame->set (key.c_str(), pValue);
        break;
    }
    }
}
示例#2
0
static void
set_slot_from_value( slot_info_t *pInfo, KvpValue *pValue)
{
    g_return_if_fail( pInfo != NULL );
    g_return_if_fail( pValue != NULL );

    switch ( pInfo->context)
    {
    case FRAME:
    {
        gchar *key = get_key_from_path( pInfo->path );
        pInfo->pKvpFrame->set(key, pValue);
        g_free( key );
        break;
    }
    case LIST:
    {
        pInfo->pList = g_list_append(pInfo->pList, pValue);
        break;
    }
    case NONE:
    default:
    {
        gchar *key = get_key_from_path( pInfo->path );
        gchar *path = get_path_from_path( pInfo->path );
        auto frame = pInfo->pKvpFrame;
        if ( path )
        {
            frame->set_path({path, key}, pValue);
            g_free( path );
        }
        else
            frame->set(key, pValue);
        g_free( key );
        break;
    }
    }
}
示例#3
0
static void
set_slot_from_value( slot_info_t *pInfo, KvpValue *pValue)
{
    g_return_if_fail( pInfo != NULL );
    g_return_if_fail( pValue != NULL );

    switch ( pInfo->context)
    {
    case FRAME:
    {
        gchar *key = get_key_from_path( pInfo->path );
        kvp_frame_set_value_nc( pInfo->pKvpFrame, key, pValue );
        g_free( key );
        break;
    }
    case LIST:
    {
        pInfo->pList = g_list_append(pInfo->pList, pValue);
        break;
    }
    case NONE:
    default:
    {
        gchar *key = get_key_from_path( pInfo->path );
        gchar *path = get_path_from_path( pInfo->path );
        KvpFrame* frame = pInfo->pKvpFrame;
        if ( path )
        {
            frame = kvp_frame_get_frame_slash( frame, path );
            g_free( path );
        }
        kvp_frame_set_value_nc( frame, key, pValue );
        g_free( key );
        break;
    }
    }
}