当前位置: 首页>>代码示例>>C++>>正文


C++ ResponsePtr::result方法代码示例

本文整理汇总了C++中llhttpnode::ResponsePtr::result方法的典型用法代码示例。如果您正苦于以下问题:C++ ResponsePtr::result方法的具体用法?C++ ResponsePtr::result怎么用?C++ ResponsePtr::result使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在llhttpnode::ResponsePtr的用法示例。


在下文中一共展示了ResponsePtr::result方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: get

	virtual void get(
		LLHTTPNode::ResponsePtr response,
		const LLSD& context) const
	{
		std::string name = context["request"]["wildcard"]["option-name"];
		response->result(LLApp::instance()->getOption(name));
	}
开发者ID:mmorciegov,项目名称:emeraldviewer,代码行数:7,代码来源:llsdappservices.cpp

示例2: makeRequest

		std::string makeRequest(
			const std::string& name,
			const std::string& httpRequest,
			bool timeout = false)
		{
			LLPipeStringInjector* injector = new LLPipeStringInjector(httpRequest);
			LLPipeStringExtractor* extractor = new LLPipeStringExtractor();
			
			apr_pool_t* pool;
			apr_pool_create(&pool, NULL);

			LLPumpIO* pump;
			pump = new LLPumpIO(pool);

			LLPumpIO::chain_t chain;
			LLSD context;

			chain.push_back(LLIOPipe::ptr_t(injector));
			LLIOHTTPServer::createPipe(chain, mRoot, LLSD());
			chain.push_back(LLIOPipe::ptr_t(extractor));

			pump->addChain(chain, DEFAULT_CHAIN_EXPIRY_SECS);

			pumpPipe(pump, 10);
			if(mResponse.notNull() && (! timeout)) 
			{
				mResponse->result(mResult);
				mResponse = NULL;
			}
			pumpPipe(pump, 10);
			
			std::string httpResult = extractor->string();

			chain.clear();
			delete pump;
			apr_pool_destroy(pool);

			if(mResponse.notNull() && timeout)
			{
				mResponse->result(mResult);
				mResponse = NULL;
			}
			
			return httpResult;
		}
开发者ID:Belxjander,项目名称:Kirito,代码行数:45,代码来源:lliohttpserver_tut.cpp

示例3: post

// virtual
void LLHTTPNode::post(LLHTTPNode::ResponsePtr response, const LLSD& context, const LLSD& input) const
{
	try
	{
		response->result(simplePost(input));
	}
	catch (NotImplemented)
	{
		response->methodNotAllowed();
	}
}
开发者ID:9skunks,项目名称:imprudence,代码行数:12,代码来源:llhttpnode.cpp

示例4: get

// virtual
void LLHTTPNode::get(LLHTTPNode::ResponsePtr response, const LLSD& context) const
{
	try
	{
		response->result(simpleGet());
	}
	catch (NotImplemented)
	{
		response->methodNotAllowed();
	}
}
开发者ID:9skunks,项目名称:imprudence,代码行数:12,代码来源:llhttpnode.cpp

示例5: post

	virtual void post(
		LLHTTPNode::ResponsePtr response,
		const LLSD& context,
		const LLSD& input) const
	{
		LLSD result = LLApp::instance()->getOptionData(
			LLApp::PRIORITY_RUNTIME_OVERRIDE);
		LLSD::map_const_iterator iter = input.beginMap();
		LLSD::map_const_iterator end = input.endMap();
		for(; iter != end; ++iter)
		{
			result[(*iter).first] = (*iter).second;
		}
		LLApp::instance()->setOptionData(
			LLApp::PRIORITY_RUNTIME_OVERRIDE,
			result);
		response->result(result);
	}
开发者ID:mmorciegov,项目名称:emeraldviewer,代码行数:18,代码来源:llsdappservices.cpp


注:本文中的llhttpnode::ResponsePtr::result方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。