コード例 #1
0
ファイル: NGS_String.c プロジェクト: ncbi/ncbi-vdb
/* Whack
 */
static
void NGS_StringWhack ( NGS_String * self, ctx_t ctx )
{
    if ( self -> orig != NULL )
        NGS_StringRelease ( self -> orig, ctx );
    if ( self -> owned != NULL )
        free ( self -> owned );
}
コード例 #2
0
static
void SRA_DB_ReadCollectionWhack ( SRA_DB_ReadCollection * self, ctx_t ctx )
{
    NGS_CursorRelease ( self -> curs, ctx );
    SRA_ReadGroupInfoRelease ( self -> group_info, ctx );
    VDatabaseRelease ( self -> db );
    NGS_StringRelease ( self -> run_name, ctx );
}
コード例 #3
0
ファイル: NGS_String.c プロジェクト: ncbi/ncbi-vdb
/* Invalidate
 */
void NGS_StringInvalidate ( NGS_String * self, ctx_t ctx )
{
    if ( self != NULL )
    {
        NGS_String * orig = self -> orig;
        self -> size = 0;
        self -> str = "";
        if ( orig != NULL )
        {
            self -> orig = NULL;
            NGS_StringRelease ( orig, ctx );
        }
    }
}
コード例 #4
0
ファイル: SRA_Statistics.c プロジェクト: ncbi/ncbi-vdb
static void DictionaryEntryWhack ( BSTNode *n, void *data )
{
    ctx_t ctx = ( ctx_t ) data;
    FUNC_ENTRY ( ctx, rcSRA, rcDatabase, rcDestroying );
    
    DictionaryEntry* entry = ( DictionaryEntry * ) n;
    
    if ( entry -> type == NGS_StatisticValueType_String )
    {
        NGS_StringRelease ( entry -> value . str, ctx );
    }
    
    free ( n );
}
コード例 #5
0
ファイル: ngs_c_fixture.hpp プロジェクト: binlu1981/ncbi-vdb
std :: string
toString ( const NGS_String* str, ctx_t ctx, bool release_source = false )
{
    if ( str == 0 )
    {
        throw std :: logic_error ( "toString ( NULL ) called" );
    }
    std :: string ret = std::string ( NGS_StringData ( str, ctx ), NGS_StringSize ( str, ctx ) );
    if ( release_source )
    {
        NGS_StringRelease ( str, ctx );
    }
    return ret;
}