本文整理汇总了C++中FileName::SetFileName_NoExpansion方法的典型用法代码示例。如果您正苦于以下问题:C++ FileName::SetFileName_NoExpansion方法的具体用法?C++ FileName::SetFileName_NoExpansion怎么用?C++ FileName::SetFileName_NoExpansion使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileName
的用法示例。
在下文中一共展示了FileName::SetFileName_NoExpansion方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: integerToString
/** \return Replica file name for given offset from lowest replica number. */
FileName File::RepName::RepFilename(int offset) const {
FileName trajFilename;
trajFilename.SetFileName_NoExpansion( Prefix_ + extChar_ +
integerToString(lowestRepnum_ + offset, ExtWidth_) +
CompressExt_ );
return trajFilename;
}
示例2: ExpandToFilenames
// -----------------------------------------------------------------------------
File::NameArray File::ExpandToFilenames(std::string const& fnameArg) {
NameArray fnames;
#ifdef _WIN32
fnames.push_back( fnameArg );
#else
if (fnameArg.empty()) return fnames;
wordexp_t expanded;
int err = wordexp( fnameArg.c_str(), &expanded, WRDE_NOCMD );
WexpErr( err );
if ( err == 0 ) {
for (unsigned int i = 0; i != expanded.we_wordc; i++) {
if (expanded.we_wordv[i] == 0)
mprinterr("Internal Error: Bad expansion at %i\n", i);
else {
FileName fn;
fn.SetFileName_NoExpansion( expanded.we_wordv[i] );
fnames.push_back( fn );
}
}
wordfree( &expanded );
}
#endif /* _WIN32 */
return fnames;
}
示例3: PrependFileName
//TODO make this more efficient by just modifying full and base names
FileName FileName::PrependFileName( std::string const& prefix ) const {
FileName out;
out.SetFileName_NoExpansion(dirPrefix_ + prefix + baseName_);
return out;
}