vlc_linux/vlc-3.0.16/modules/gui/skins2/src/theme_loader.cpp
// FIXME: could become a skins2 OS factory function or a vlc core function
could become a skins2 OS factory function or a vlc core function
could become a skins2 OS factory function or a vlc core function
std::string ThemeLoader::getTmpDir( )
{
#if defined( _WIN32 )
    wchar_t *tmpdir = _wtempnam( NULL, L"vlt" );
    if( tmpdir == NULL )
        return "";
    char* utf8 = FromWide( tmpdir );
    free( tmpdir );
    std::string tempPath( utf8 ? utf8 : "" );
    free( utf8 );
    return tempPath;
#elif defined( __OS2__ )
    char *tmpdir = tempnam( NULL, "vlt" );
    if( tmpdir == NULL )
        return "";
    std::string tempPath( sFromLocale( tmpdir ));
    free( tmpdir );
    return tempPath;
#else
    char templ[] = "/tmp/vltXXXXXX";
    char *tmpdir = mkdtemp( templ );
    return std::string( tmpdir ? tmpdir : "");
#endif
}
std :: string ThemeLoader :: getTmpDir ( ) { #if defined ( _WIN32 ) wchar_t * tmpdir = _wtempnam ( NULL , L" " ) ; if ( tmpdir == NULL ) return " " ; char * utf8 = FromWide ( tmpdir ) ; free ( tmpdir ) ; std :: string tempPath ( utf8 ? utf8 : " " ) ; free ( utf8 ) ; return tempPath ; #elif defined ( __OS2__ ) char * tmpdir = tempnam ( NULL , " " ) ; if ( tmpdir == NULL ) return " " ; std :: string tempPath ( sFromLocale ( tmpdir ) ) ; free ( tmpdir ) ; return tempPath ; #else char templ [ ] = " " ; char * tmpdir = mkdtemp ( templ ) ; return std :: string ( tmpdir ? tmpdir : " " ) ; #endif }
FIXME: could become a skins2 OS factory function or a vlc core function
FIXME : could become a skins2 OS factory function or a vlc core function