Ejemplo n.º 1
0
void
Config::DumpValues( std::initializer_list<Direct::String>  names,
                    Direct::String                        &out_str )
{
     D_DEBUG_AT( DirectFB_Graphics, "Graphics::Config::%s( %p )\n", __FUNCTION__, this );

     for (auto &name : names) {
          long value;

          if (GetOption( name, value ) == DFB_OK)
               out_str.PrintF( "%s%s:0x%lx", out_str.empty() ? "" : ",", *name, value );
     }
}
Ejemplo n.º 2
0
    const char *
    D_String_PrintTLS( const char *format, ... )
    {
        va_list        args;
        Direct::String str;

        D_ASSERT( format != NULL );

        va_start( args, format );
        str.PrintF( format, args );
        va_end( args );

        return str.CopyTLS();
    }
Ejemplo n.º 3
0
Strings
String::GetTokens( const Direct::String &delimiter ) const
{
    Strings tokens;

    char *buf = direct_strdup( buffer() );
    char *str = buf;
    char *save, *token;

    while ((token = strtok_r( str, delimiter.buffer(), &save ))) {
        str = NULL;

        tokens.push_back( Direct::String::F( "%s", token ) );
    }

    direct_free( buf );

    return tokens;
}