예제 #1
0
QString Parameters::value(const QString &pName)
{
  MetricMap::iterator it = _values.find(pName);
  if (it == _values.end())
    return QString::null;
  else
    return it.data();
}
예제 #2
0
QString Parameters::parent(const QString &pValue)
{
  for (MetricMap::iterator it = _values.begin(); it != _values.end(); it++)
    if (it.data() == pValue)
      return it.key();

  return QString::null;
}
예제 #3
0
void Parameters::set(const QString &pName, int pValue)
{
  MetricMap::iterator it = _values.find(pName);
  if ( (it != _values.end()) && (it.data().toInt() == pValue) )
    return;

  _set(pName, pValue);
}
예제 #4
0
void Parameters::set(const QString &pName, bool pValue)
{
  MetricMap::iterator it = _values.find(pName);
  if ( (it != _values.end()) && (it.data() == ((pValue) ? "t" : "f")) )
    return;

  _set(pName, ((pValue) ? QString("t") : QString("f")));
}
예제 #5
0
bool Parameters::boolean(const QString &pName)
{
  MetricMap::iterator it = _values.find(pName);
  if (it == _values.end())
    return FALSE;
  else if (it.data() == "t")
    return TRUE;

  return FALSE;
}
예제 #6
0
void Parameters::set(const QString &pName, const QString &pValue)
{
  MetricMap::iterator it = _values.find(pName);
  if (it != _values.end())
  {
    if (it.data() == pValue)
      return;
    else
      _values.replace(pName, pValue);
  }
  else
    _values[pName] = pValue;

  _set(pName, pValue);
}