Exemplo n.º 1
0
ConfigNode
ConfigNode::lookup(
  const ConfigNode &value)
  const
{
  if (value.IsDefined() && value.IsScalar() && IsDefined() && IsMap()) {
    ConfigNode v = (*this)[value.Scalar()];
    if (v) {
      return v;
    }
  }
  return value;
}
Exemplo n.º 2
0
std::string
ConfigException::build_what(
  const ConfigNode  &node,
  const std::string &msg)
{
  std::stringstream o;
  if (node.IsScalar()) {
    o << msg << ": '" << node.path() << "': '" << node.Scalar()
      << "' from source '" << node.source() << "'";
  } else {
    o << msg << ": '" << node.path() << "' from source '"
      << node.source() << "'";
  }
  return o.str();
}