Ejemplo n.º 1
0
static inline bool readDef(
	const std::string &str,
	Attr toAttribute(const std::string &str), Attr a_unknown,
	std::vector<Attr> &attrs)
{
	std::istringstream ss(str);
	std::string attr;

	/*
	 * Okay, so there is a attribute name first and then optional type.
	 * Therefore we chop this stream by commas, and then we read first
	 * non-whitespace string out of it.
	 */
	while(std::getline(ss, attr, ',')) {
		std::istringstream attrss(attr);
		std::string name;
		attrss >> name;

		Attr attr = toAttribute(name);
		if(attr == a_unknown) {
			GraphIO::logger.lout(Logger::LL_MINOR) << "attribute \"" << name << "\"" << " not supported. Ignoring." << endl;
		}
		attrs.push_back(attr);
	}

	return true;

}
Ejemplo n.º 2
0
 AttributePtr Node::toAttributeChecked() const throw(Exceptions::CheckFailed)
 {
   AttributePtr result = toAttribute();
   ZS_THROW_CUSTOM_IF(Exceptions::CheckFailed, !result)
   return result;
 }