コード例 #1
0
std::string 
ConversionProperties::getValue(std::string key) const
{
  ConversionOption *option = getOption(key);
  if (option != NULL) return option->getValue();
  return "";
}
コード例 #2
0
const std::string& 
ConversionProperties::getValue(const std::string& key) const
{
  ConversionOption *option = getOption(key);
  if (option != NULL) return option->getValue();
	static std::string empty = "";

	return empty;
}
コード例 #3
0
END_TEST

START_TEST (test_conversion_options_clone)
{
  ConversionOption option("key", 1.1, "some description");
  fail_unless(option.getDoubleValue() == 1.1);
  fail_unless(option.getType() == CNV_TYPE_DOUBLE);

  ConversionOption *clone = option.clone();

  fail_unless(option.getKey() == clone->getKey());
  fail_unless(option.getType() == clone->getType());
  fail_unless(option.getValue() == clone->getValue());
  fail_unless(option.getDescription() == clone->getDescription());

  delete clone;
}