예제 #1
0
CPLFileFinder CPLPopFileFinder()

{
    CPLFileFinder pfnReturn;

    CPLFinderInit();
#ifdef __WXOSX__
    if( nFileFinders == 0)
    {
        CPLFree( papfnFinders );
        papfnFinders = NULL;
        return NULL;
    }
    pfnReturn = papfnFinders[--nFileFinders];
#else
    if( nFileFinders == 0 )
        return NULL;

    pfnReturn = papfnFinders[--nFileFinders];

    if( nFileFinders == 0)
    {
        CPLFree( papfnFinders );
        papfnFinders = NULL;
    }
#endif
    return pfnReturn;
}
예제 #2
0
void CPLPushFinderLocation( const char *pszLocation )

{
    FindFileTLS* pTLSData = CPLFinderInit();

    pTLSData->papszFinderLocations  = CSLAddString( pTLSData->papszFinderLocations, 
                                          pszLocation );
}
예제 #3
0
void CPLPushFinderLocation( const char *pszLocation )

{
    CPLFinderInit();

    papszFinderLocations  = CSLAddString( papszFinderLocations,
                                          pszLocation );
}
예제 #4
0
void CPLPushFileFinder( CPLFileFinder pfnFinder )

{
    FindFileTLS* pTLSData = CPLFinderInit();

    pTLSData->papfnFinders = (CPLFileFinder *) 
        CPLRealloc(pTLSData->papfnFinders,  sizeof(void*) * ++pTLSData->nFileFinders);
    pTLSData->papfnFinders[pTLSData->nFileFinders-1] = pfnFinder;
}
예제 #5
0
void CPLPushFileFinder( CPLFileFinder pfnFinder )

{
    CPLFinderInit();

    papfnFinders = (CPLFileFinder *)
        CPLRealloc(papfnFinders,  sizeof(void*) * ++nFileFinders);
    papfnFinders[nFileFinders-1] = pfnFinder;
}
예제 #6
0
void CPLPushFinderLocation( const char *pszLocation )

{
    FindFileTLS* pTLSData = CPLFinderInit();
    if( pTLSData == NULL )
        return;
    pTLSData->papszFinderLocations
        = CSLAddStringMayFail( pTLSData->papszFinderLocations,
                                   pszLocation );
}
예제 #7
0
void CPLPushFileFinder( CPLFileFinder pfnFinder )

{
    FindFileTLS* pTLSData = CPLFinderInit();
    if (pTLSData == NULL )
        return;

    pTLSData->papfnFinders = static_cast<CPLFileFinder *>(
        CPLRealloc(pTLSData->papfnFinders,
            sizeof(CPLFileFinder) * ++pTLSData->nFileFinders) );
    pTLSData->papfnFinders[pTLSData->nFileFinders-1] = pfnFinder;
}
예제 #8
0
파일: cpl_findfile.cpp 프로젝트: OSGeo/gdal
/** CPLPushFinderLocation */
void CPLPushFinderLocation( const char *pszLocation )

{
    FindFileTLS* pTLSData = CPLFinderInit();
    if( pTLSData == nullptr )
        return;
    // Check if location already is in list.
    if( CSLFindStringCaseSensitive(pTLSData->papszFinderLocations,
                                   pszLocation) > -1 )
        return;
    pTLSData->papszFinderLocations =
        CSLAddStringMayFail( pTLSData->papszFinderLocations, pszLocation );
}
예제 #9
0
const char *CPLFindFile( const char *pszClass, const char *pszBasename )

{
    FindFileTLS* pTLSData = CPLFinderInit();
    if( pTLSData == NULL )
        return NULL;

    for( int i = pTLSData->nFileFinders-1; i >= 0; i-- )
    {
        const char * pszResult
            = (pTLSData->papfnFinders[i])( pszClass, pszBasename );
        if( pszResult != NULL )
            return pszResult;
    }

    return NULL;
}
예제 #10
0
const char *CPLFindFile( const char *pszClass, const char *pszBasename )

{
    int         i;

    CPLFinderInit();

    for( i = nFileFinders-1; i >= 0; i-- )
    {
        const char * pszResult;

        pszResult = (papfnFinders[i])( pszClass, pszBasename );
        if( pszResult != NULL )
            return pszResult;
    }

    return NULL;
}
예제 #11
0
void CPLPopFinderLocation()

{
    int      nCount;

    CPLFinderInit();

    nCount = CSLCount(papszFinderLocations);
    if( nCount == 0 )
        return;

    CPLFree( papszFinderLocations[nCount-1] );
    papszFinderLocations[nCount-1] = NULL;

    if( nCount == 1 )
    {
        CPLFree( papszFinderLocations );
        papszFinderLocations = NULL;
    }
}
예제 #12
0
CPLFileFinder CPLPopFileFinder()

{
    CPLFileFinder pfnReturn;

    CPLFinderInit();

    if( nFileFinders == 0 )
        return NULL;

    pfnReturn = papfnFinders[--nFileFinders];

    if( nFileFinders == 0)
    {
        CPLFree( papfnFinders );
        papfnFinders = NULL;
    }

    return pfnReturn;
}
예제 #13
0
CPLFileFinder CPLPopFileFinder()

{
    CPLFileFinder pfnReturn;

    FindFileTLS* pTLSData = CPLFinderInit();

    if( pTLSData->nFileFinders == 0 )
        return NULL;

    pfnReturn = pTLSData->papfnFinders[--pTLSData->nFileFinders];

    if( pTLSData->nFileFinders == 0)
    {
        CPLFree( pTLSData->papfnFinders );
        pTLSData->papfnFinders = NULL;
    }

    return pfnReturn;
}
예제 #14
0
void CPLPopFinderLocation()

{
    int      nCount;

    FindFileTLS* pTLSData = CPLFinderInit();

    if( pTLSData->papszFinderLocations == NULL )
        return;

    nCount = CSLCount(pTLSData->papszFinderLocations);
    if( nCount == 0 )
        return;

    CPLFree( pTLSData->papszFinderLocations[nCount-1] );
    pTLSData->papszFinderLocations[nCount-1] = NULL;

    if( nCount == 1 )
    {
        CPLFree( pTLSData->papszFinderLocations );
        pTLSData->papszFinderLocations = NULL;
    }
}
예제 #15
0
void CPLPopFinderLocation()
{
    CPLPopFinderLocationInternal(CPLFinderInit());
}
예제 #16
0
CPLFileFinder CPLPopFileFinder()

{
    return CPLPopFileFinderInternal(CPLFinderInit());
}