本文整理汇总了C++中CCgiContext::GetConfig方法的典型用法代码示例。如果您正苦于以下问题:C++ CCgiContext::GetConfig方法的具体用法?C++ CCgiContext::GetConfig怎么用?C++ CCgiContext::GetConfig使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCgiContext
的用法示例。
在下文中一共展示了CCgiContext::GetConfig方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Execute
void CSeqBasicCommand::Execute( CCgiContext& ctx )
{
const CNcbiRegistry& reg = ctx.GetConfig();
/* load in the html template file */
string baseFile = reg.Get( "filesystem", "HtmlBaseFile" );
auto_ptr<CHTMLPage> page( new CHTMLPage( NcbiEmptyString, baseFile ) );
/* set up to replace <@[email protected]> in template file with html returned
from CreateView */
page->AddTagMap( "QUICKSEARCH", CreateQuickSearch(ctx) );
page->AddTagMap( "VIEW", CreateView( ctx ) );
/* actual page output */
ctx.GetResponse().WriteHeader();
page->Print(ctx.GetResponse().out(), CNCBINode::eHTML );
}
示例2: Execute
void CHelloCommand::Execute( CCgiContext& ctx )
{
const CNcbiRegistry& reg = ctx.GetConfig();
// load in the html template file
string baseFile = reg.Get( "filesystem", "HtmlBaseFile" );
auto_ptr<CHTMLPage> page( new CHTMLPage( NcbiEmptyString, baseFile ) );
// set up to replace <@[email protected]> in template file with html returned
// from CreateView
page->AddTagMap( "VIEW", CreateView( ctx ) );
// actual page output
ctx.GetResponse().WriteHeader();
page->Print(ctx.GetResponse().out(), CNCBINode::eHTML );
}
示例3: x_GetSeqAnnot
void CBlastHitMatrixCGIApplication::x_GetSeqAnnot(CCgiContext& ctx)
{
const CNcbiRegistry & reg = ctx.GetConfig();
string blastURL = reg.Get("NetParams", "BlastURL");
string url = (string)blastURL + "?CMD=Get&RID=" + m_RID + "&FORMAT_TYPE=ASN.1&FORMAT_OBJECT=Alignment";
SConnNetInfo* net_info = ConnNetInfo_Create(NULL);
// create HTTP connection
CConn_HttpStream inHttp(url,net_info);
try {
m_Annot.Reset(new CSeq_annot);
auto_ptr<CObjectIStream> is
(CObjectIStream::Open(eSerial_AsnText, inHttp));
*is >> *m_Annot;
}
catch (CException& e) {
m_Annot.Reset();
NCBI_THROW(CBlastHitMatrixCGIException, eInvalidSeqAnnot, "Exception reading SeqAnnot via url " + url + ", exception message: " + e.GetMsg());
}
}