Exemplo n.º 1
0
SubstItem::SubstItem( const SubstItem & rhs )
    : LinkedObj(), m_type( rhs.m_type )
{
    if ( rhs.m_value.m_pStr )
    {
        switch( rhs.m_type )
        {
        case REF_STRING:
        case REF_ENV:
            m_value.m_pStr = new AutoStr2( *rhs.m_value.m_pStr );
            break;
        case REF_FORMAT_STR:
            m_value.m_pAny = new SubstFormat( *rhs.getFormatStr() );
        default:
            m_value.m_index = rhs.m_value.m_index;
            break;
        }
    }
    else
        m_value.m_index = 0;
    
}