本文整理汇总了C++中AString::EndsWithI方法的典型用法代码示例。如果您正苦于以下问题:C++ AString::EndsWithI方法的具体用法?C++ AString::EndsWithI怎么用?C++ AString::EndsWithI使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AString
的用法示例。
在下文中一共展示了AString::EndsWithI方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: EndsWithI
// EndsWithI
//------------------------------------------------------------------------------
void TestAString::EndsWithI() const
{
// empty string is handled
{
AString empty;
TEST_ASSERT( empty.EndsWithI( AString( "hello" ) ) == false );
TEST_ASSERT( empty.EndsWithI( "hello" ) == false );
}
// empty compare string is handled
{
AString empty;
TEST_ASSERT( empty.EndsWithI( AString::GetEmpty() ) == true );
TEST_ASSERT( empty.EndsWithI( "" ) == true );
}
// compare with longer string is handled
{
AString shortString( "short" );
TEST_ASSERT( shortString.EndsWithI( AString( "Does not end with this" ) ) == false );
TEST_ASSERT( shortString.EndsWithI( "Does not end with this" ) == false );
}
// compare with shorter string is handled
{
AString str( "this is a string ending with Chicken" );
TEST_ASSERT( str.EndsWithI( "Chicken" ) == true );
TEST_ASSERT( str.EndsWithI( "chicken" ) == true );
TEST_ASSERT( str.EndsWithI( "ICKEN" ) == true );
TEST_ASSERT( str.EndsWithI( "Chicken " ) == false );
TEST_ASSERT( str.EndsWithI( "Turkey" ) == false );
}
}
示例2: if
// DetermineFlags
//------------------------------------------------------------------------------
/*static*/ uint32_t LibraryNode::DetermineFlags( const AString & librarianName )
{
uint32_t flags = 0;
if ( librarianName.EndsWithI("lib.exe") ||
librarianName.EndsWithI("lib") ||
librarianName.EndsWithI("link.exe") ||
librarianName.EndsWithI("link"))
{
flags |= LIB_FLAG_LIB;
}
else if ( librarianName.EndsWithI("ar.exe") ||
librarianName.EndsWithI("ar") )
{
if ( librarianName.FindI( "orbis-ar" ) )
{
flags |= LIB_FLAG_ORBIS_AR;
}
else
{
flags |= LIB_FLAG_AR;
}
}
else if ( librarianName.EndsWithI( "\\ax.exe" ) ||
librarianName.EndsWithI( "\\ax" ) )
{
flags |= LIB_FLAG_GREENHILLS_AX;
}
return flags;
}
示例3: AddFile
// AddFile
//------------------------------------------------------------------------------
void VSProjectGenerator::AddFile( const AString & file, bool filterByExtension )
{
// ensure slash consistency which we rely on later
AStackString<> fileCopy( file );
fileCopy.Replace( FORWARD_SLASH, BACK_SLASH );
// filtering by extension?
size_t numAllowedFileExtensions = m_AllowedFileExtensions.GetSize();
if ( filterByExtension && numAllowedFileExtensions )
{
bool keep = false;
for ( size_t i=0; i<numAllowedFileExtensions; ++i )
{
if ( file.EndsWithI( m_AllowedFileExtensions[ i ] ) )
{
keep = true;
break;
}
}
if ( !keep )
{
return;
}
}
ASSERT( !m_Files.Find( fileCopy ) );
m_Files.Append( fileCopy );
}
示例4: ASSERT
// IsLinkerArg_MSVC
//------------------------------------------------------------------------------
/*static*/ bool LinkerNode::IsLinkerArg_MSVC( const AString & token, const char * arg )
{
ASSERT( token.IsEmpty() == false );
// MSVC Linker args can start with - or /
if ( ( token[0] != '/' ) && ( token[0] != '-' ) )
{
return false;
}
// Length check to early out
const size_t argLen = AString::StrLen( arg );
if ( ( token.GetLength() - 1 ) != argLen )
{
return false; // token is too short or too long
}
// MSVC Linker args are case-insensitive
return token.EndsWithI( arg );
}
示例5: if
// DetermineLinkerTypeFlags
//------------------------------------------------------------------------------
/*static*/ uint32_t LinkerNode::DetermineLinkerTypeFlags(const AString & linkerType, const AString & linkerName)
{
uint32_t flags = 0;
if ( linkerType.IsEmpty() || ( linkerType == "auto" ))
{
// Detect based upon linker executable name
if ( ( linkerName.EndsWithI( "link.exe" ) ) ||
( linkerName.EndsWithI( "link" ) ) )
{
flags |= LinkerNode::LINK_FLAG_MSVC;
}
else if ( ( linkerName.EndsWithI( "gcc.exe" ) ) ||
( linkerName.EndsWithI( "gcc" ) ) )
{
flags |= LinkerNode::LINK_FLAG_GCC;
}
else if ( ( linkerName.EndsWithI( "ps3ppuld.exe" ) ) ||
( linkerName.EndsWithI( "ps3ppuld" ) ) )
{
flags |= LinkerNode::LINK_FLAG_SNC;
}
else if ( ( linkerName.EndsWithI( "orbis-ld.exe" ) ) ||
( linkerName.EndsWithI( "orbis-ld" ) ) )
{
flags |= LinkerNode::LINK_FLAG_ORBIS_LD;
}
else if ( ( linkerName.EndsWithI( "elxr.exe" ) ) ||
( linkerName.EndsWithI( "elxr" ) ) )
{
flags |= LinkerNode::LINK_FLAG_GREENHILLS_ELXR;
}
else if ( ( linkerName.EndsWithI( "mwldeppc.exe" ) ) ||
( linkerName.EndsWithI( "mwldeppc." ) ) )
{
flags |= LinkerNode::LINK_FLAG_CODEWARRIOR_LD;
}
}
else
{
if ( linkerType == "msvc" )
{
flags |= LinkerNode::LINK_FLAG_MSVC;
}
else if ( linkerType == "gcc" )
{
flags |= LinkerNode::LINK_FLAG_GCC;
}
else if ( linkerType == "snc-ps3" )
{
flags |= LinkerNode::LINK_FLAG_SNC;
}
else if ( linkerType == "clang-orbis" )
{
flags |= LinkerNode::LINK_FLAG_ORBIS_LD;
}
else if ( linkerType == "greenhills-exlr" )
{
flags |= LinkerNode::LINK_FLAG_GREENHILLS_ELXR;
}
else if ( linkerType == "codewarrior-ld" )
{
flags |= LinkerNode::LINK_FLAG_CODEWARRIOR_LD;
}
}
return flags;
}