当前位置: 首页>>代码示例>>C++>>正文


C++ LList::EmptyAndDelete方法代码示例

本文整理汇总了C++中LList::EmptyAndDelete方法的典型用法代码示例。如果您正苦于以下问题:C++ LList::EmptyAndDelete方法的具体用法?C++ LList::EmptyAndDelete怎么用?C++ LList::EmptyAndDelete使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在LList的用法示例。


在下文中一共展示了LList::EmptyAndDelete方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: LoadLanguages

void LanguageTable::LoadLanguages()
{
    //
    // Clear out all known languages

    m_languages.EmptyAndDelete();


    //
    // Explore the data/language directory, looking for languages

    LList<char *> *files = g_fileSystem->ListArchive( "data/language/", "*.txt", false );

    for( int i = 0; i < files->Size(); ++i )
    {
        char *thisFile = files->GetData(i);

        Language *lang = new Language();

		snprintf( lang->m_name, sizeof(lang->m_name), thisFile );
		lang->m_name[ sizeof(lang->m_name) - 1 ] = '\0';
		for( char *curName = lang->m_name; *curName; curName++ )
		{
			if( *curName == '.' )
			{
				*curName = '\0';
				break;
			}
		}
		strcpy( lang->m_caption, lang->m_name );

        snprintf( lang->m_path, sizeof(lang->m_path), "data/language/%s", thisFile );
		lang->m_path[ sizeof(lang->m_path) - 1 ] = '\0';

        LoadLanguageCaption( lang );

		if( m_onlyDefaultLanguageSelectable && stricmp( m_defaultLanguage, lang->m_name ) != 0 )
		{
			lang->m_selectable = false;
		}
		else
		{
			lang->m_selectable = true;
		}

        m_languages.PutData( lang );

        AppDebugOut( "Found language '%s' with caption '%s' in '%s'\n", 
                     lang->m_name, 
                     lang->m_caption, 
                     lang->m_path );
    }

    files->EmptyAndDelete();
    delete files;
}
开发者ID:gene9,项目名称:Darwinia-and-Multiwinia-Source-Code,代码行数:56,代码来源:language_table.cpp

示例2: ParseArchives

void FileSystem::ParseArchives( const char *_dir, const char *_filter )
{
    LList<char *> *results = ListDirectory( _dir, _filter, false );
    for( int i = 0; i < results->Size(); ++i )
    {
        char fullFilename[512];
        snprintf( fullFilename, sizeof(fullFilename), "%s%s", _dir, results->GetData( i ) );
        fullFilename[ sizeof(fullFilename) - 1 ] = '\0';
        ParseArchive( fullFilename );
    }
    results->EmptyAndDelete();
    delete results;
}
开发者ID:cahocachi,项目名称:DEFCON,代码行数:13,代码来源:file_system.cpp

示例3: AppAssert

const char *FindCaseInsensitive( char *_fullPath )
{
    AppAssert(strlen(_fullPath) < PATH_MAX);
    
    static char pathSoFar[PATH_MAX];
    pathSoFar[0] = '\0';
    
    while (true) {
        char *delimiter;
        
        // Skip to the next / or end-of-string
        for (delimiter = (char *)_fullPath; *delimiter && *delimiter != '/'; delimiter++);
        
        char component[PATH_MAX];
        AppAssert ( strlen(_fullPath) < PATH_MAX );
        strcpy( component, _fullPath );
        component[delimiter - _fullPath] = '\0';
    
        // Search for a match
        LList<char *> *matches = ListDirectory( pathSoFar, component, true );
        bool found = false;
    
        if (matches->Size() > 0) {
            strcpy(pathSoFar, matches->GetData( 0 ));
            found = true;
        }
    
        matches->EmptyAndDelete();
    
        // Failed to find a match, just return the original
        if (!found)
            return _fullPath;
        
        // Got to the end of the path, return it
        if (!*delimiter) 
            return pathSoFar;
        
        _fullPath = delimiter + 1;
    }
}
开发者ID:cahocachi,项目名称:DEFCON,代码行数:40,代码来源:filesys_utils.cpp

示例4: EclShutdown

void EclShutdown ()
{
    windows.EmptyAndDelete();
}
开发者ID:cahocachi,项目名称:DEFCON,代码行数:4,代码来源:eclipse.cpp

示例5: Render


//.........这里部分代码省略.........

    bool timeFlashEffect = (fmodf( GetHighResTime() * 2, 1.0f ) > 0.55f);

    UnicodeString caption;
    RGBAColour captionColour(255,255,255,255);

    if( GetHighResTime() - m_damageTimer < 10.0f && 
        rocket->m_state != EscapeRocket::StateExploding )
    {
        char damage[256];
        sprintf( damage, "%d%%", int(rocket->m_damage) );
        caption = LANGUAGEPHRASE("multiwinia_rr_status_c");
        caption.ReplaceStringFlag( L'T', damage );

        captionColour.Set(255,0,0,255);  
        if( timeFlashEffect ) captionColour.a *= 0.5f;
    }
    else if( rocket->m_state == EscapeRocket::StateCountdown )
    {        
        char captionC[256];
        sprintf( captionC, "%d", (int)rocket->m_countdown + 1 );
        caption = captionC;
        mainCaptionH *= 4;
    }
    else if( rocket->m_state == EscapeRocket::StateFlight )
    {
        caption = LANGUAGEPHRASE("multiwinia_rr_status_d" );
        mainCaptionH *= 1.5f;
        if( timeFlashEffect ) captionColour.a *= 0.25f;
    }
    else if( rocket->m_state == EscapeRocket::StateExploding )
    {
        caption = LANGUAGEPHRASE("multiwinia_rr_status_e" );
        if( timeFlashEffect ) captionColour.a *= 0.25f;
    }
    else if( fuelPercent >= 1.0f && darwiniansInside < 5 )
    {
        caption = LANGUAGEPHRASE("multiwinia_rr_status_b");
        if( timeFlashEffect ) captionColour.a *= 0.25f;
    } 
    else if( rocket->m_refuelRate < 0.05f && fuelPercent < 0.01f )
    {
        caption = LANGUAGEPHRASE("multiwinia_rr_status_a");        
        if( timeFlashEffect ) captionColour.a *= 0.25f;
    }
    else if( fuelPercent < 1.0f )
    {
        char captionC[256];
        sprintf( captionC, "%2.1f%%", fuelPercent * 100 );
        
        caption = LANGUAGEPHRASE("multiwinia_rr_status_f");
        caption.ReplaceStringFlag( L'T', captionC );

        captionColour.a *= 0.75f;
    }
       


    //
    // Render our caption

    if( caption.Length() )
    {
        LList<UnicodeString *> *wrapped = WordWrapText( caption, 1000, mainCaptionH, false, false );

        for( int i = 0; i < wrapped->Size(); ++i )
        {
            UnicodeString *thisString = wrapped->GetData(i);

            glColor4ub( captionColour.a, captionColour.a, captionColour.a, 0 );
            g_titleFont.SetRenderOutline(true);
            g_titleFont.DrawText2DCentre( m_x + m_w/2, mainCaptionY, mainCaptionH, *thisString );

            glColor4ubv( captionColour.GetData() );
            g_titleFont.SetRenderOutline(false);
            g_titleFont.DrawText2DCentre( m_x + m_w/2, mainCaptionY, mainCaptionH, *thisString );

            mainCaptionY += mainCaptionH;
            mainCaptionY += mainCaptionG;
        }

        wrapped->EmptyAndDelete();
        delete wrapped;
    }


    //
    // White border

    glColor4f( 1.0f, 1.0f, 1.0f, 0.2f );

    glBegin( GL_LINE_LOOP );
        glVertex2f( m_x, m_y );
        glVertex2f( m_x + m_w, m_y );
        glVertex2f( m_x + m_w, m_y + h );
        glVertex2f( m_x, m_y + h );
    glEnd();

    glShadeModel( GL_FLAT );
}
开发者ID:gene9,项目名称:Darwinia-and-Multiwinia-Source-Code,代码行数:101,代码来源:rocket_status_panel.cpp

示例6: EclShutdown

void EclShutdown ()
{
    windows.EmptyAndDelete();
    dirtyrects.EmptyAndDelete();
}
开发者ID:gene9,项目名称:Darwinia-and-Multiwinia-Source-Code,代码行数:5,代码来源:eclipse.cpp


注:本文中的LList::EmptyAndDelete方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。