本文整理汇总了C++中CDir::GetPath方法的典型用法代码示例。如果您正苦于以下问题:C++ CDir::GetPath方法的具体用法?C++ CDir::GetPath怎么用?C++ CDir::GetPath使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CDir
的用法示例。
在下文中一共展示了CDir::GetPath方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: sUpdateCase
void sUpdateCase(CDir& test_cases_dir, const string& test_name)
{
string input = CDir::ConcatPath( test_cases_dir.GetPath(), test_name + "." + extInput);
string output = CDir::ConcatPath( test_cases_dir.GetPath(), test_name + "." + extOutput);
string errors = CDir::ConcatPath( test_cases_dir.GetPath(), test_name + "." + extErrors);
if (!CFile(input).Exists()) {
BOOST_FAIL("input file " << input << " does not exist.");
}
cerr << "Creating new test case from " << input << " ..." << endl;
CErrorLogger logger(errors);
CGvfReader reader(0);
CNcbiIfstream ifstr(input.c_str());
typedef CGff2Reader::TAnnotList ANNOTS;
ANNOTS annots;
try {
reader.ReadSeqAnnots(annots, ifstr, &logger);
}
catch (...) {
ifstr.close();
BOOST_FAIL("Error: " << input << " failed during conversion.");
}
ifstr.close();
cerr << " Produced new error listing " << output << "." << endl;
CNcbiOfstream ofstr(output.c_str());
for (ANNOTS::iterator cit = annots.begin(); cit != annots.end(); ++cit){
ofstr << MSerial_AsnText << **cit;
ofstr.flush();
}
ofstr.close();
cerr << " Produced new ASN1 file " << output << "." << endl;
cerr << " ... Done." << endl;
}
示例2: sUpdateCase
void sUpdateCase(CDir& test_cases_dir, const string& test_name)
{
string input = CDir::ConcatPath( test_cases_dir.GetPath(), test_name + "." + extInput);
string output = CDir::ConcatPath( test_cases_dir.GetPath(), test_name + "." + extOutput);
string errors = CDir::ConcatPath( test_cases_dir.GetPath(), test_name + "." + extErrors);
if (!CFile(input).Exists()) {
BOOST_FAIL("input file " << input << " does not exist.");
}
string test_base, test_type;
NStr::SplitInTwo(test_name, ".", test_base, test_type);
cerr << "Creating new test case from " << input << " ..." << endl;
CErrorLogger logger(errors);
//get a scope
CRef<CObjectManager> pObjMngr = CObjectManager::GetInstance();
CGBDataLoader::RegisterInObjectManager(*pObjMngr);
CRef<CScope> pScope(new CScope(*pObjMngr));
pScope->AddDefaults();
//get a writer object
CNcbiIfstream ifstr(input.c_str(), ios::binary);
CObjectIStream* pI = CObjectIStream::Open(eSerial_AsnText, ifstr, eTakeOwnership);
CNcbiOfstream ofstr(output.c_str());
CBedGraphWriter* pWriter = sGetWriter(*pScope, ofstr);
if (test_type == "annot") {
CRef<CSeq_annot> pAnnot(new CSeq_annot);
*pI >> *pAnnot;
pWriter->WriteHeader();
pWriter->WriteAnnot(*pAnnot);
pWriter->WriteFooter();
delete pWriter;
ofstr.flush();
}