Example #1
0
inline string CIntArrayToString( const CIntArray &array )
{
	CString CRet;
	char buffer[10];
	for ( size_t i = 0; i < array.size(); i++ )
	{
		CRet += itoa( array.at( i ), buffer, 10 );
		if ( i != ( array.size() - 1 ) )
			CRet += ",";
	}
	string sRet = CRet.GetBuffer();
	return sRet;
}
Example #2
0
void CCriteria::Adjust(CIntArray& array) 
{
  switch (array.size()) 
  {
    case 1: 
    {
      array.Insert(array.at(0)); 
      break;
    }
    case 0: 
    {
      return; 
    }
    default:
    {
      break;
    }

  }

  if (!(isDefaultValue(array.at(0))) && !(isDefaultValue(array.at(1)))) 
  {
    if (array.at(0) > array.at(1))
    {
      int32_t tmp = array.at(0);
      array.ReplaceAt(array.begin(), array.at(1));
      array.ReplaceAt(array.begin() + 1, tmp);
    }
  } 
  else if ((isDefaultValue(array.at(0))) && !(isDefaultValue(array.at(1)))) 
  {
    array.ReplaceAt(array.begin(), array.at(1));
  } 
  else if (!(isDefaultValue(array.at(0))) && (isDefaultValue(array.at(1)))) 
  {
    array.ReplaceAt(array.begin() + 1 , array.at(0));
  }

}