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


C++ AString::Clear方法代码示例

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


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

示例1: GetFolderPath

// GetFolderPath
//------------------------------------------------------------------------------
void VSProjectGenerator::GetFolderPath( const AString & fileName, AString & folder ) const
{
	const AString * const bEnd = m_BasePaths.End();
	for ( const AString * bIt = m_BasePaths.Begin(); bIt != bEnd; ++bIt )
	{
		const AString & basePath = *bIt;
		const char * begin = fileName.Get();
		const char * end = fileName.GetEnd();

		if ( fileName.BeginsWithI( basePath ) )
		{
			begin = fileName.Get() + basePath.GetLength();
			const char * lastSlash = fileName.FindLast( BACK_SLASH );
			end = ( lastSlash ) ? lastSlash : end;
			if ( begin < end )
			{
				folder.Assign( begin, end );
				return;
			}
		}
	}

	// no matching base path (use root)
	folder.Clear();
}
开发者ID:jujis008,项目名称:fastbuild,代码行数:27,代码来源:VSProjectGenerator.cpp

示例2: GetRemoteFilePath

// GetRemoteFilePath
//------------------------------------------------------------------------------
void ToolManifest::GetRemoteFilePath( uint32_t fileId, AString & exe, bool fullPath ) const
{
	// we'll store in the sub dir
	if ( fullPath )
	{
		GetRemotePath( exe );
	}
	else
	{
		exe.Clear();
	}

	// determine primary root
	const File & primaryFile = m_Files[ 0 ];
	AStackString<> primaryPath( primaryFile.m_Name.Get(), primaryFile.m_Name.FindLast( NATIVE_SLASH ) + 1 ); // include backslash

	const File & f = m_Files[ fileId ];
	if ( f.m_Name.BeginsWithI( primaryPath ) )
	{
		// file is in sub dir on master machine, so store with same relative location
		exe += ( f.m_Name.Get() + primaryPath.GetLength() );
	}
	else
	{
		// file is in some completely other directory, so put in same place as exe
		const char * lastSlash = f.m_Name.FindLast( NATIVE_SLASH );
		lastSlash = lastSlash ? lastSlash + 1 : f.m_Name.Get();
		exe += AStackString<>( lastSlash, f.m_Name.GetEnd() );
	}
}
开发者ID:zhangf911,项目名称:fastbuild,代码行数:32,代码来源:ToolManifest.cpp

示例3: substringConstruction

//---------------------------------------------------------------------------------------------------------
//--- Test Substring
//---------------------------------------------------------------------------------------------------------
void substringConstruction( const char* inputString, AString& res, bool trim )
{
    Substring subs( inputString );
    if (trim)
        subs.Trim();
    res.Clear()._(subs);
}
开发者ID:winsmith,项目名称:ALox-Logging-Library,代码行数:10,代码来源:ut_alib_strings_substring.cpp

示例4: GetStatus

// GetStatus
//------------------------------------------------------------------------------
void WorkerThreadRemote::GetStatus( AString & hostName, AString & status, bool & isIdle ) const
{
	isIdle = false;

	MutexHolder mh( m_CurrentJobMutex );
	if ( m_CurrentJob )
	{
		Server::GetHostForJob( m_CurrentJob, hostName );
		if ( IsEnabled() == false )
		{
			status = "(Finishing) ";
		}
		status += m_CurrentJob->GetRemoteName();
	}
	else
	{
		hostName.Clear();

		if ( IsEnabled() == false )
		{
			status = "(Disabled)";
		}
		else
		{
			status = "Idle";
			isIdle = true;
		}
	}
}
开发者ID:Samana,项目名称:fastbuild,代码行数:31,代码来源:WorkerThreadRemote.cpp

示例5:

// GetHostForJob
//------------------------------------------------------------------------------
/*static*/ void Server::GetHostForJob( const Job * job, AString & hostName )
{
    const ClientState * cs = (const ClientState *)job->GetUserData();
    if ( cs )
    {
        hostName = cs->m_HostName;
    }
    else
    {
        hostName.Clear();
    }
}
开发者ID:Manuzor,项目名称:fastbuild,代码行数:14,代码来源:Server.cpp

示例6:

// Generate
//------------------------------------------------------------------------------
/*static*/ void Args::StripQuotes( const char * start, const char * end, AString & out )
{
	ASSERT( start );
	ASSERT( end );

	// handle empty inputs
	if ( start == end )
	{
		out.Clear();
		return;
	}

	// strip first quote if there is one
	const char firstChar = *start;
	if ( ( firstChar == '"' ) || ( firstChar == '\'' ) )
	{
		++start;
	}

	// strip first quote if there is one
	const char lastChar = *( end - 1 );
	if ( ( lastChar == '"' ) || ( lastChar == '\'' ) )
	{
		--end;
	}

	// handle invalid strings (i.e. just one quote)
	if ( end < start )
	{
		out.Clear();
		return;
	}

	// assign unquoted string (could be empty, and that's ok)
	out.Assign( start, end );
}
开发者ID:JeremieA,项目名称:fastbuild,代码行数:38,代码来源:Args.cpp

示例7: GetRemoteFilePath

// GetRemoteFilePath
//------------------------------------------------------------------------------
void ToolManifest::GetRemoteFilePath( uint32_t fileId, AString & exe, bool fullPath ) const
{
	// we'll store in the sub dir
	if ( fullPath )
	{
		GetRemotePath( exe );
	}
	else
	{
		exe.Clear();
	}

	// determine primary root
	const File & primaryFile = m_Files[ 0 ];
	const File & f = m_Files[ fileId ];

	GetRelativePath( primaryFile.m_Name, f.m_Name, exe );
}
开发者ID:ClxS,项目名称:fastbuild,代码行数:20,代码来源:ToolManifest.cpp

示例8: tokenizerTest

//---------------------------------------------------------------------------------------------------------
//--- Tokenizer
//---------------------------------------------------------------------------------------------------------
void tokenizerTest( const char* inputString, AString& res, char delim, char newDelim,
                    Whitespaces trim, int inpStart= -1, int inpEnd= -1  )
{
    Substring inp( inputString );
    if ( inpStart < 0 )  inpStart= 0;
    if ( inpEnd   < 0 )  inpEnd=   inp.Length() - 1;
    inp.Set( inp, inpStart, inpEnd-inpStart +1 );

    res.Clear();

    Tokenizer tok( inp, delim );

    while( tok.HasNext() )
    {
        res._( tok.Next(trim) );
        res._( newDelim );
    }

}
开发者ID:winsmith,项目名称:ALox-Logging-Library,代码行数:22,代码来源:ut_alib_strings_tokenizer.cpp


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