本文整理汇总了C++中FileName函数的典型用法代码示例。如果您正苦于以下问题:C++ FileName函数的具体用法?C++ FileName怎么用?C++ FileName使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了FileName函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: bufFlush
int FileMcIDAS::Close(int channel){
if (Bin[channel]) {
bufFlush(channel);
if(GlobalComment)
write(Doc[channel],GlobalComment,strlen(GlobalComment));
if(ChannelComment[channel])
write(Doc[channel],ChannelComment[channel],strlen(ChannelComment[channel]));
close(Bin[channel]);
close(Doc[channel]);
rename(tmpName(FileName(channel)), FileName(channel));
if(linkLatest()) MakeLink(channel);
}
return(0);
}
示例2: GenerateBabySteps
static
void GenerateBabySteps(ZZ_pEX& h1, const ZZ_pEX& f, const ZZ_pEX& h, long k,
long verbose)
{
double t;
if (verbose) {
cerr << "generating baby steps...";
t = GetTime();
}
ZZ_pEXModulus F;
build(F, f);
ZZ_pEXArgument H;
#if 0
double n2 = sqrt(double(F.n));
double n4 = sqrt(n2);
double n34 = n2*n4;
long sz = long(ceil(n34/sqrt(sqrt(2.0))));
#else
long sz = 2*SqrRoot(F.n);
#endif
build(H, h, F, sz);
h1 = h;
long i;
if (!use_files) {
BabyStepFile.kill();
BabyStepFile.SetLength(k-1);
}
for (i = 1; i <= k-1; i++) {
if (use_files) {
ofstream s;
OpenWrite(s, FileName(ZZ_pEX_stem, "baby", i));
s << h1 << "\n";
s.close();
}
else
BabyStepFile(i) = h1;
CompMod(h1, h1, H, F);
if (verbose) cerr << "+";
}
if (verbose)
cerr << (GetTime()-t) << "\n";
}
示例3: FileName
void Errors::Warning(const std::string &msg)
{
if (showWarnings)
{
warningCount++;
std::cout << "Warning ";
FileName();
std::cout << msg.c_str() << std::endl;
}
}
示例4: wxString
std::pair<bool, FileName> Application::ParseCommandLineMap()
{
if(argc == 2) {
FileName f = wxString(argv[1]);
if(f.GetExt() == "otbm" || f.GetExt() == "otgz") {
return std::make_pair(true, f);
}
}
return std::make_pair(false, FileName());
}
示例5: postParseCommandLine
void postParseCommandLine()
{
/* load default scene if none specified */
if (scene->size() == 0 && sceneFilename.ext() == "") {
FileName file = FileName::executableFolder() + FileName("models/cornell_box.ecs");
parseCommandLine(new ParseStream(new LineCommentFilter(file, "#")), file.path());
}
g_instancing_mode = instancing_mode;
}
示例6: main
/* main function in embree namespace */
int main(int argc, char** argv)
{
/* create stream for parsing */
Ref<ParseStream> stream = new ParseStream(new CommandLineStream(argc, argv));
/* parse command line */
parseCommandLine(stream, FileName());
return 0;
}
示例7: GetFullNameAndPath
void CHlpFileEntry::GetFullNameAndPath(TDes& aName) const
{
TChar driveLetter = '?';
RFs::DriveToChar(Drive(), driveLetter);
aName.Zero();
aName.Append(driveLetter);
aName.Append(':');
aName.Append(KHlpFileSearchPath);
aName.Append(FileName());
}
示例8: _
bool LyXVC::registrer()
{
FileName const filename = owner_->fileName();
// there must be a file to save
if (!filename.isReadableFile()) {
Alert::error(_("Document not saved"),
_("You must save the document "
"before it can be registered."));
return false;
}
// it is very likely here that the vcs is not created yet...
if (!vcs) {
//check in the root directory of the document
FileName const cvs_entries(onlyPath(filename.absFileName()) + "/CVS/Entries");
FileName const svn_entries(onlyPath(filename.absFileName()) + "/.svn/entries");
FileName const git_index(onlyPath(filename.absFileName()) + "/.git/index");
if (git_index.isReadableFile()) {
LYXERR(Debug::LYXVC, "LyXVC: registering "
<< to_utf8(filename.displayName()) << " with GIT");
vcs.reset(new GIT(git_index, owner_));
} else if (svn_entries.isReadableFile()) {
LYXERR(Debug::LYXVC, "LyXVC: registering "
<< to_utf8(filename.displayName()) << " with SVN");
vcs.reset(new SVN(svn_entries, owner_));
} else if (cvs_entries.isReadableFile()) {
LYXERR(Debug::LYXVC, "LyXVC: registering "
<< to_utf8(filename.displayName()) << " with CVS");
vcs.reset(new CVS(cvs_entries, owner_));
} else {
LYXERR(Debug::LYXVC, "LyXVC: registering "
<< to_utf8(filename.displayName()) << " with RCS");
vcs.reset(new RCS(FileName(), owner_));
}
}
LYXERR(Debug::LYXVC, "LyXVC: registrer");
docstring response;
bool ok = Alert::askForText(response, _("LyX VC: Initial description"),
_("(no initial description)"));
if (!ok) {
LYXERR(Debug::LYXVC, "LyXVC: user cancelled");
vcs.reset(0);
return false;
}
if (response.empty())
response = _("(no initial description)");
vcs->registrer(to_utf8(response));
return true;
}
示例9: ErrorBox
//通过匿名管道连接引擎引擎
bool CEngine::LinkEngineWithUnnamed()
{
status = 0;//引擎连接未就绪
SECURITY_ATTRIBUTES sa;
sa.nLength=sizeof(SECURITY_ATTRIBUTES);
sa.lpSecurityDescriptor=NULL;//Default security attributes
sa.bInheritHandle= TRUE;//handle can be inherited
if(!CreatePipe(&pde.engine_read,&pde.platform_write,&sa,BUFSIZE) ||!CreatePipe(&pde.platform_read,&pde.engine_write,&sa,BUFSIZE))//创建两个平台与引擎之间互相通信的匿名管道
{
ErrorBox("CreatePipe failed");
return false;
}
char Filter[]="(exe files)|*.exe|(all files)|*.*||";//文件滤镜
CFileDialog FileName(true,NULL,NULL,Filter,NULL,gameSet.EngineInitDir);//定义文件对话框类实例
if(FileName.DoModal()==IDOK)
{
path=FileName.GetFilePath();
LPCTSTR folder=FileName.GetFolderPath(path);
char EngineDir[MAX_PATH]={0};
strcpy(EngineDir,folder);
STARTUPINFO si;
PROCESS_INFORMATION pi;
ZeroMemory(&si,sizeof(si));
si.cb=sizeof(si);
si.dwFlags=STARTF_USESHOWWINDOW |STARTF_USESTDHANDLES;
si.wShowWindow=SW_HIDE;
si.hStdInput=pde.engine_read;
si.hStdOutput=pde.engine_write;
si.hStdError=pde.engine_write;
if(!CreateProcess(path,"",NULL,NULL,true,0,NULL,EngineDir,&si,&pi))//打开引擎进程
{
ErrorBox("CreateProcess failed");
status = -1;
return false;
}
CloseHandle(pde.engine_read);
CloseHandle(pde.engine_write);
WaitForInputIdle(pi.hProcess,INFINITE);
pde.hEProcess = pi.hProcess;
CloseHandle(pi.hThread);
SetCurrentDirectory(gameSet.CurDir);//恢复当前主应用程序的进程
CreateEngineInfoBoard();
}
else
{
status = -1;
return false;
}
return true;
}
示例10: FileId
string FileId(SourceLocation const& l, SourceManager const& sm) {
string fn = FileName(l, sm);
for(size_t i = 0; i < fn.length(); ++i)
switch(fn[i]) {
case '/':
case '\\':
case '>':
case '.': fn[i] = '_';
}
return fn;
}
示例11: _T
/** @brief Load all Application settings in one shot from the XML file.
* @remarks CoInitialize() or CoInitializeEx() must have been called before using this method.
* @param _sFileName the full path name of an existing file
*/
bool MenuCommandSetCfg::_LoadFile(const std::string& _sFileName)
{
const _bstr_t XMLDOM_OBJECT= _T("Microsoft.XMLDOM");
const _bstr_t NODE_DART(_T("uicfg"));
const _bstr_t NODE_COMMANDS(_T("commands"));
const _bstr_t NODE_VERSION(_T("version"));
const _bstr_t NODE_COMMANDLIST(_T("commandlist"));
const _bstr_t NODE_MENULIST(_T("menulist"));
bool bResult= false;
try
{
MSXML::IXMLDOMDocumentPtr XMLDom;
HRESULT hResult = XMLDom.CreateInstance((LPCSTR)XMLDOM_OBJECT);
if(S_OK==hResult)
{
_ClearLists();
_bstr_t FileName(_sFileName.c_str());
if(XMLDom->load(FileName))
{
MSXML::IXMLDOMNodePtr Root= XMLDom->selectSingleNode(NODE_DART);
MSXML::IXMLDOMNodePtr XMLNode;
MSXML::IXMLDOMNodePtr XMLNode2;
if( Root != NULL )
{
//load the file version
XMLNode = Root->selectSingleNode(NODE_VERSION);
_LoadFileVersion(XMLNode);
//load the list of menu items
XMLNode = Root->selectSingleNode(NODE_COMMANDS);
if(XMLNode){
XMLNode2= XMLNode->selectSingleNode(NODE_COMMANDLIST);
_LoadMenuItemList(XMLNode2);
XMLNode2= XMLNode->selectSingleNode(NODE_MENULIST);
_LoadMenuList(XMLNode2);
}
bResult= true;
}
}
}
else{
TRACE(_T("Failed to load XMLDom (%x)\n"), hResult);
}
}
catch(...){
TRACE(_T("Exception while loading config file\n"));
}
return bResult;
}
示例12: FileName
void SPics::SavePixThread( QString dir )
{
QString fullpath = dir + FileName();
QFile f( fullpath );
if ( f.open( QIODevice::WriteOnly ) )
{
f.write ( qUncompress( data ) );
f.close();
}
}
示例13: FileSetInfo
/**
* Set file information
*
* @v This File handle
* @v Type Type of information
* @v Len Buffer size
* @v Data Buffer
* @ret Status EFI status code
*/
static EFI_STATUS EFIAPI
FileSetInfo(EFI_FILE_HANDLE This, EFI_GUID *Type, UINTN Len, VOID *Data)
{
EFI_GRUB_FILE *File = _CR(This, EFI_GRUB_FILE, EfiFile);
CHAR16 GuidString[36];
GuidToString(GuidString, Type);
PrintError(L"Cannot set information of type %s for file '%s'\n",
GuidString, FileName(File));
return EFI_WRITE_PROTECTED;
}
示例14: TRAPD
CObexBufObject* CBtListenBase::PutRequestIndication(void)
{
if(iCurrObject) DeleteObject();
TRAPD(err,iCurrObject=CObexBufObject::NewL(NULL));
if(err==KErrNone)
{
TRAPD(err,iCurrObject->SetDataBufL(FileName()));
if(err!=KErrNone) DeleteObject();
}
return iCurrObject;
}
示例15: DoOneLib
static void DoOneLib( char *lib )
/*******************************/
// process a single library
{
DoOptions( lib );
/* If anything is left, add it to the list of object files. */
if( *lib != '\0' ) {
AddCommand( FileName( lib, LIBRARY_SLOT, false ), LIBRARY_SLOT, false );
}
}