• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ Clear函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中Clear函数的典型用法代码示例。如果您正苦于以下问题:C++ Clear函数的具体用法?C++ Clear怎么用?C++ Clear使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: Clear

DBManagerThreadData::DBManagerThreadData(void)
{
	Clear();
}
开发者ID:vdrive,项目名称:TrapperKeeper,代码行数:4,代码来源:DBManagerThreadData.cpp


示例2: Clear

CodeBook::~CodeBook()
{
    Clear();
}
开发者ID:jieshen-sjtu,项目名称:EYE,代码行数:4,代码来源:eye_codebook.cpp


示例3: Clear

void ToDoListView::Parse()
{
//    wxBusyCursor busy;
    // based on user prefs, parse files for todo items
    if (m_Ignore || (m_pPanel && !m_pPanel->IsShownOnScreen()) )
        return; // Reentrancy

    Clear();
    m_ItemsMap.clear();
    m_Items.Clear();

    switch (m_pSource->GetSelection())
    {
        case 0: // current file only
        {
            // this is the easiest selection ;)
            cbEditor* ed = Manager::Get()->GetEditorManager()->GetBuiltinEditor(Manager::Get()->GetEditorManager()->GetActiveEditor());
            ParseEditor(ed);
            break;
        }
        case 1: // open files
        {
            // easy too; parse all open editor files...
            for (int i = 0; i < Manager::Get()->GetEditorManager()->GetEditorsCount(); ++i)
            {
                cbEditor* ed = Manager::Get()->GetEditorManager()->GetBuiltinEditor(Manager::Get()->GetEditorManager()->GetEditor(i));
                ParseEditor(ed);
            }
            break;
        }
        case 2: // active target files
        {
            // loop all project files
            // but be aware: if a file is opened, use the open file because
            // it might not be the same on the disk...
            cbProject* prj = Manager::Get()->GetProjectManager()->GetActiveProject();
            if (!prj)
                return;
            ProjectBuildTarget *target = prj->GetBuildTarget(prj->GetActiveBuildTarget());
            if (!target)
                return;
            wxProgressDialog pd(_T("Todo Plugin: Processing all files in the active target.."),
                                _T("Processing a target of a big project may take large amount of time.\n\n"
                                   "Please be patient!\n"),
                                target->GetFilesCount(),
                                Manager::Get()->GetAppWindow(),
                                wxPD_AUTO_HIDE | wxPD_APP_MODAL | wxPD_CAN_ABORT);
            int i = 0;
            for (FilesList::iterator it = target->GetFilesList().begin();
                 it != target->GetFilesList().end();
                 ++it)
            {
                ProjectFile* pf = *it;
                wxString filename = pf->file.GetFullPath();
                cbEditor* ed = Manager::Get()->GetEditorManager()->IsBuiltinOpen(filename);
                if (ed)
                    ParseEditor(ed);
                else
                    ParseFile(filename);
                if (!pd.Update(i++))
                {
                    break;
                }
            }
            break;
        }
        case 3: // all project files
        {
            // loop all project files
            // but be aware: if a file is opened, use the open file because
            // it might not be the same on the disk...
            cbProject* prj = Manager::Get()->GetProjectManager()->GetActiveProject();
            if (!prj)
                return;
            wxProgressDialog pd(_T("Todo Plugin: Processing all files.."),
                                _T("Processing a big project may take large amount of time.\n\n"
                                   "Please be patient!\n"),
                                prj->GetFilesCount(),
                                Manager::Get()->GetAppWindow(),
                                wxPD_AUTO_HIDE | wxPD_APP_MODAL | wxPD_CAN_ABORT);
            int i = 0;
            for (FilesList::iterator it = prj->GetFilesList().begin(); it != prj->GetFilesList().end(); ++it)
            {
                ProjectFile* pf = *it;
                wxString filename = pf->file.GetFullPath();
                cbEditor* ed = Manager::Get()->GetEditorManager()->IsBuiltinOpen(filename);
                if (ed)
                    ParseEditor(ed);
                else
                    ParseFile(filename);
                if (!pd.Update(i++))
                {
                    break;
                }
            }
            break;
        }
        default:
            break;
    }
//.........这里部分代码省略.........
开发者ID:simple-codeblocks,项目名称:Codeblocks,代码行数:101,代码来源:todolistview.cpp


示例4: Clear

plFontCache::~plFontCache()
{
    Clear();
    fInstance = nil;
}
开发者ID:MareinK,项目名称:Plasma,代码行数:5,代码来源:plFontCache.cpp


示例5: DebugMessage


//.........这里部分代码省略.........
    EGL_display = eglGetDisplay((EGLNativeDisplayType) EGL_device);
    if (EGL_display == EGL_NO_DISPLAY){
        printf( "EGL Display Get failed: %s \n", EGLErrorString());
        return FALSE;
    }

    if (!eglInitialize(EGL_display, &EGL_version_major, &EGL_version_minor)){
        printf( "EGL Display Initialize failed: %s \n", EGLErrorString());
        return FALSE;
    }

    if (!eglChooseConfig(EGL_display, ConfigAttribs, &EGL_config, 1, &nConfigs)){
        printf( "EGL Configuration failed: %s \n", EGLErrorString());
        return FALSE;
    } else if (nConfigs != 1){
        printf( "EGL Configuration failed: nconfig %i, %s \n", nConfigs, EGLErrorString());
        return FALSE;
    }

    EGL_surface = eglCreateWindowSurface(EGL_display, EGL_config, EGL_handle, NULL);
    if (EGL_surface == EGL_NO_SURFACE){
		printf("EGL Surface Creation failed: %s will attempt without window... \n", EGLErrorString());
        EGL_surface = eglCreateWindowSurface(EGL_display, EGL_config, NULL, NULL);
        if (EGL_surface == EGL_NO_SURFACE){
            printf( "EGL Surface Creation failed: %s \n", EGLErrorString());
            return FALSE;
        }
    }
    eglBindAPI(EGL_OPENGL_ES_API);

    EGL_context = eglCreateContext(EGL_display, EGL_config, EGL_NO_CONTEXT, ContextAttribs);
    if (EGL_context == EGL_NO_CONTEXT){
        printf( "EGL Context Creation failed: %s \n", EGLErrorString());
        return FALSE;
    }

    if (!eglMakeCurrent(EGL_display, EGL_surface, EGL_surface, EGL_context)){
        printf( "EGL Make Current failed: %s \n", EGLErrorString());
        return FALSE;
    };
    eglSwapInterval(EGL_display, 1);
*/

#ifdef USE_SDL
//// paulscode, added for switching between RGBA8888 and RGB565
// (part of the color banding fix)
int bitsPP;
if( Android_JNI_UseRGBA8888() )
    bitsPP = 32;
else
    bitsPP = 16;
    /* Set the video mode */
    SDL_Surface* hScreen;
    printf( "Setting video mode %dx%d...\n", windowSetting.uDisplayWidth, windowSetting.uDisplayHeight );
// TODO: I should actually check what the pixelformat is, rather than assuming 16 bpp (RGB_565) or 32 bpp (RGBA_8888):
//    if (!(hScreen = SDL_SetVideoMode( windowSetting.uDisplayWidth, windowSetting.uDisplayHeight, 16, SDL_HWSURFACE )))
    if (!(hScreen = SDL_SetVideoMode( windowSetting.uDisplayWidth, windowSetting.uDisplayHeight, bitsPP, SDL_HWSURFACE )))
    {
        printf( "Problem setting videomode %dx%d: %s\n", windowSetting.uDisplayWidth, windowSetting.uDisplayHeight, SDL_GetError() );
        SDL_QuitSubSystem( SDL_INIT_VIDEO );
        return false;
    }
#endif

	
    InitState();
    InitOGLExtension();
    sprintf(m_strDeviceStats, "%.60s - %.128s : %.60s", m_pVendorStr, m_pRenderStr, m_pVersionStr);
    TRACE0(m_strDeviceStats);
    DebugMessage(M64MSG_INFO, "Using OpenGL: %s", m_strDeviceStats);

    GLint precision,range;

    glGetShaderPrecisionFormat(GL_VERTEX_SHADER,GL_LOW_FLOAT,&precision,&range);
    DebugMessage(M64MSG_INFO,"GLSL Vertex Shader lowp precision:%i range:%i",precision,range);
    glGetShaderPrecisionFormat(GL_VERTEX_SHADER,GL_MEDIUM_FLOAT,&precision,&range);
    DebugMessage(M64MSG_INFO,"GLSL Vertex Shader mediump precision:%i range:%i",precision,range);
    glGetShaderPrecisionFormat(GL_VERTEX_SHADER,GL_HIGH_FLOAT,&precision,&range);
    DebugMessage(M64MSG_INFO,"GLSL Vertex Shader highp precision:%i range:%i",precision,range);

    glGetShaderPrecisionFormat(GL_FRAGMENT_SHADER ,GL_LOW_FLOAT,&precision,&range);
    DebugMessage(M64MSG_INFO,"GLSL Fragment Shader lowp precision:%i range:%i",precision,range);
    glGetShaderPrecisionFormat(GL_FRAGMENT_SHADER,GL_MEDIUM_FLOAT,&precision,&range);
    DebugMessage(M64MSG_INFO,"GLSL Fragment Shader mediump precision:%i range:%i",precision,range);
    glGetShaderPrecisionFormat(GL_FRAGMENT_SHADER,GL_HIGH_FLOAT,&precision,&range);
    DebugMessage(M64MSG_INFO,"GLSL Fragment Shader highp precision:%i range:%i",precision,range);


    Unlock();

    Clear(CLEAR_COLOR_AND_DEPTH_BUFFER);    // Clear buffers
    UpdateFrame();
    Clear(CLEAR_COLOR_AND_DEPTH_BUFFER);
    UpdateFrame();
    
    m_bReady = true;
    status.isVertexShaderEnabled = false;

    return true;
}
开发者ID:mattm23,项目名称:N64-Player--Mupen64plus-,代码行数:101,代码来源:OGLGraphicsContext.cpp


示例6: Clear

void ShaderManagerVulkan::ClearShaders() {
	Clear();
	DirtyShader();
	gstate_c.Dirty(DIRTY_ALL_UNIFORMS | DIRTY_VERTEXSHADER_STATE | DIRTY_FRAGMENTSHADER_STATE);
}
开发者ID:AmesianX,项目名称:ppsspp,代码行数:5,代码来源:ShaderManagerVulkan.cpp


示例7: Clear

/**
 * name:	MAnnivDate
 * class:	MAnnivDate
 * desc:	default constructor
 * param:	none
 * return:	nothing
 **/
MAnnivDate::MAnnivDate()
{
	Clear();
}
开发者ID:Seldom,项目名称:miranda-ng,代码行数:11,代码来源:classMAnnivDate.cpp


示例8: Clear

TextEventDispatcher::PendingComposition::PendingComposition()
{
  Clear();
}
开发者ID:Nazi-Nigger,项目名称:gecko-dev,代码行数:4,代码来源:TextEventDispatcher.cpp


示例9: Clear

TiXmlComment& TiXmlComment::operator=( const TiXmlComment& base )
{
	Clear();
	base.CopyTo( this );
	return *this;
}
开发者ID:sue602,项目名称:st-nvs,代码行数:6,代码来源:tinyxml.cpp


示例10: Clear

	virtual ~Grid_Array (void)              { Clear (); }
开发者ID:kravitz,项目名称:transims4,代码行数:1,代码来源:Grid_Data.hpp


示例11: Clear

cPrefabPiecePool::~cPrefabPiecePool()
{
	Clear();
}
开发者ID:changyongGuo,项目名称:cuberite,代码行数:4,代码来源:PrefabPiecePool.cpp


示例12: Clear

CLevel::~CLevel( )
{
	Clear( );
}
开发者ID:jmazzola,项目名称:Damage-Control-FinalProject,代码行数:4,代码来源:Level.cpp


示例13: Clear

void CInsideSocket::Reset()
{
	m_nSocketAttr = enmSocketAttr_Inside;

	Clear();
}
开发者ID:brianserv,项目名称:lightframe,代码行数:6,代码来源:frame_insidesocket.cpp


示例14: LOGWARNING

bool cBlockArea::Read(cWorld * a_World, int a_MinBlockX, int a_MaxBlockX, int a_MinBlockY, int a_MaxBlockY, int a_MinBlockZ, int a_MaxBlockZ, int a_DataTypes)
{
	// Normalize the coords:
	if (a_MinBlockX > a_MaxBlockX)
	{
		std::swap(a_MinBlockX, a_MaxBlockX);
	}
	if (a_MinBlockY > a_MaxBlockY)
	{
		std::swap(a_MinBlockY, a_MaxBlockY);
	}
	if (a_MinBlockZ > a_MaxBlockZ)
	{
		std::swap(a_MinBlockZ, a_MaxBlockZ);
	}
	
	// Include the Max coords:
	a_MaxBlockX += 1;
	a_MaxBlockY += 1;
	a_MaxBlockZ += 1;
	
	// Check coords validity:
	if (a_MinBlockY < 0)
	{
		LOGWARNING("%s: MinBlockY less than zero, adjusting to zero", __FUNCTION__);
		a_MinBlockY = 0;
	}
	else if (a_MinBlockY >= cChunkDef::Height)
	{
		LOGWARNING("%s: MinBlockY more than chunk height, adjusting to chunk height", __FUNCTION__);
		a_MinBlockY = cChunkDef::Height - 1;
	}
	if (a_MaxBlockY < 0)
	{
		LOGWARNING("%s: MaxBlockY less than zero, adjusting to zero", __FUNCTION__);
		a_MaxBlockY = 0;
	}
	else if (a_MaxBlockY >= cChunkDef::Height)
	{
		LOGWARNING("%s: MaxBlockY more than chunk height, adjusting to chunk height", __FUNCTION__);
		a_MaxBlockY = cChunkDef::Height - 1;
	}
	
	// Allocate the needed memory:
	Clear();
	if (!SetSize(a_MaxBlockX - a_MinBlockX, a_MaxBlockY - a_MinBlockY, a_MaxBlockZ - a_MinBlockZ, a_DataTypes))
	{
		return false;
	}
	m_OriginX = a_MinBlockX;
	m_OriginY = a_MinBlockY;
	m_OriginZ = a_MinBlockZ;
	cChunkReader Reader(*this);
	
	// Convert block coords to chunks coords:
	int MinChunkX, MaxChunkX;
	int MinChunkZ, MaxChunkZ;
	cChunkDef::AbsoluteToRelative(a_MinBlockX, a_MinBlockY, a_MinBlockZ, MinChunkX, MinChunkZ);
	cChunkDef::AbsoluteToRelative(a_MaxBlockX, a_MaxBlockY, a_MaxBlockZ, MaxChunkX, MaxChunkZ);
	
	// Query block data:
	if (!a_World->ForEachChunkInRect(MinChunkX, MaxChunkX, MinChunkZ, MaxChunkZ, Reader))
	{
		Clear();
		return false;
	}
	
	return true;
}
开发者ID:JoeClacks,项目名称:MCServer,代码行数:69,代码来源:BlockArea.cpp


示例15: Clear

defList::defList()
{
	Clear() ;
}
开发者ID:dreamsxin,项目名称:ultimatepp,代码行数:4,代码来源:cfg.cpp


示例16: SetError

bool TiXmlDocument::LoadFile( FILE* file, TiXmlEncoding encoding )
{
	if ( !file ) 
	{
		SetError( TIXML_ERROR_OPENING_FILE, 0, 0, TIXML_ENCODING_UNKNOWN );
		return false;
	}

	// Delete the existing data:
	Clear();
	location.Clear();

	// Get the file size, so we can pre-allocate the string. HUGE speed impact.
	long length = 0;
	fseek( file, 0, SEEK_END );
	length = ftell( file );
	fseek( file, 0, SEEK_SET );

	// Strange case, but good to handle up front.
	if ( length <= 0 )
	{
		SetError( TIXML_ERROR_DOCUMENT_EMPTY, 0, 0, TIXML_ENCODING_UNKNOWN );
		return false;
	}

	// Subtle bug here. TinyXml did use fgets. But from the XML spec:
	// 2.11 End-of-Line Handling
	// <snip>
	// <quote>
	// ...the XML processor MUST behave as if it normalized all line breaks in external 
	// parsed entities (including the document entity) on input, before parsing, by translating 
	// both the two-character sequence #xD #xA and any #xD that is not followed by #xA to 
	// a single #xA character.
	// </quote>
	//
	// It is not clear fgets does that, and certainly isn't clear it works cross platform. 
	// Generally, you expect fgets to translate from the convention of the OS to the c/unix
	// convention, and not work generally.

	/*
	while( fgets( buf, sizeof(buf), file ) )
	{
		data += buf;
	}
	*/

	char* buf = new char[ length+1 ];
	buf[0] = 0;

	if ( fread( buf, length, 1, file ) != 1 ) {
		delete [] buf;
		SetError( TIXML_ERROR_OPENING_FILE, 0, 0, TIXML_ENCODING_UNKNOWN );
		return false;
	}

	// Process the buffer in place to normalize new lines. (See comment above.)
	// Copies from the 'p' to 'q' pointer, where p can advance faster if
	// a newline-carriage return is hit.
	//
	// Wikipedia:
	// Systems based on ASCII or a compatible character set use either LF  (Line feed, '\n', 0x0A, 10 in decimal) or 
	// CR (Carriage return, '\r', 0x0D, 13 in decimal) individually, or CR followed by LF (CR+LF, 0x0D 0x0A)...
	//		* LF:    Multics, Unix and Unix-like systems (GNU/Linux, AIX, Xenix, Mac OS X, FreeBSD, etc.), BeOS, Amiga, RISC OS, and others
    //		* CR+LF: DEC RT-11 and most other early non-Unix, non-IBM OSes, CP/M, MP/M, DOS, OS/2, Microsoft Windows, Symbian OS
    //		* CR:    Commodore 8-bit machines, Apple II family, Mac OS up to version 9 and OS-9

	const char* p = buf;	// the read head
	char* q = buf;			// the write head
	const char CR = 0x0d;
	const char LF = 0x0a;

	buf[length] = 0;
	while( *p ) {
		assert( p < (buf+length) );
		assert( q <= (buf+length) );
		assert( q <= p );

		if ( *p == CR ) {
			*q++ = LF;
			p++;
			if ( *p == LF ) {		// check for CR+LF (and skip LF)
				p++;
			}
		}
		else {
			*q++ = *p++;
		}
	}
	assert( q <= (buf+length) );
	*q = 0;

	Parse( buf, 0, encoding );

	delete [] buf;
	return !Error();
}
开发者ID:sue602,项目名称:st-nvs,代码行数:96,代码来源:tinyxml.cpp


示例17: Clear

CLineInput::CLineInput()
{
	Clear();
}
开发者ID:Berzzzebub,项目名称:teeworlds,代码行数:4,代码来源:lineinput.cpp


示例18: Clear

PathSolver::~PathSolver()
{
    Clear();
}
开发者ID:TomStanczyk,项目名称:vstboard,代码行数:4,代码来源:pathsolver.cpp


示例19: Clear

//_____________________________________________________________________________________________
void SAMCEvent::Init(){
	Clear();
}
开发者ID:whit2333,项目名称:SAMC,代码行数:4,代码来源:SAMCEvent.C


示例20: Clear

	inline Mesh::~Mesh(void) {
		Clear();
	}
开发者ID:nathanfaucett,项目名称:Odin.cpp,代码行数:3,代码来源:mesh.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ ClearAll函数代码示例发布时间:2022-05-30
下一篇:
C++ CleanUp函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap