예제 #1
0
파일: ASE.cpp 프로젝트: 50p/multitheftauto
bool ASE::RemoveRuleValue ( const char* szKey )
{
    list < CASERule* > ::iterator iter = m_Rules.begin ();
    for ( ; iter != m_Rules.end () ; iter++ )
    {
        CASERule* pRule = *iter;
        if ( strcmp ( pRule->GetKey (), szKey ) == 0 )
        {
            delete pRule;
            m_Rules.erase ( iter );
            return true;
        }
    }
    return false;
}
예제 #2
0
bool ASE::RemoveRuleValue ( const char* szKey )
{
    // Limit szKey length
    SString strKeyTemp;
    if ( szKey && strlen ( szKey ) > MAX_RULE_KEY_LENGTH )
    {
        strKeyTemp = SStringX ( szKey ).Left ( MAX_RULE_KEY_LENGTH );
        szKey = *strKeyTemp;
    }

    list < CASERule* > ::iterator iter = m_Rules.begin ();
    for ( ; iter != m_Rules.end () ; iter++ )
    {
        CASERule* pRule = *iter;
        if ( strcmp ( pRule->GetKey (), szKey ) == 0 )
        {
            delete pRule;
            m_Rules.erase ( iter );
            return true;
        }
    }
    return false;
}