Example #1
0
	void populateContentTypes(const x0::FlowValue& from)
	{
		switch (from.type()) {
			case x0::FlowValue::STRING:
				contentTypes_.push_back(from.toString());
				break;
			case x0::FlowValue::ARRAY:
				for (auto p: from.toArray())
					populateContentTypes(p);
				break;
			default:
				;
		}
	}
Example #2
0
	void registerHost(const x0::FlowValue& arg)
	{
		if (arg.type() == x0::FlowValue::ARRAY) {
			const x0::FlowArray& args = arg.toArray();
			if (args.size() != 2)
				return;

			const x0::FlowValue& fqdn = args[0];
			const x0::FlowValue& proc = args[1];

			if (!fqdn.isString())
				return;

			if (!proc.isFunction())
				return;

			registerHost(fqdn.toString(), proc.toFunction());
		}
	}