示例#1
0
文件: compress.cpp 项目: hiwang123/x0
	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:
				;
		}
	}
示例#2
0
文件: vhost.cpp 项目: illdefined/x0
	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());
		}
	}