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


C++ FileName函数代码示例

本文整理汇总了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);
}
开发者ID:pablo-benito,项目名称:gvar,代码行数:18,代码来源:fileMcIDAS.C

示例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";

}
开发者ID:drrezeau,项目名称:School-Projects,代码行数:56,代码来源:ZZ_pEXFactoring.cpp

示例3: FileName

void Errors::Warning(const std::string &msg)
{
    if (showWarnings)
    {
        warningCount++;
        std::cout << "Warning ";
        FileName();
        std::cout << msg.c_str() << std::endl;
    }
}
开发者ID:bencz,项目名称:OrangeC,代码行数:10,代码来源:Errors.cpp

示例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());
}
开发者ID:Rydda,项目名称:rme,代码行数:10,代码来源:application.cpp

示例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;
 }
开发者ID:ElrosMorlin,项目名称:embree,代码行数:10,代码来源:pathtracer.cpp

示例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;
  }
开发者ID:horzelski,项目名称:embree,代码行数:11,代码来源:convert.cpp

示例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());
	}
开发者ID:cdaffara,项目名称:symbiandump-ossapps,代码行数:10,代码来源:TLoader.cpp

示例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;
}
开发者ID:cburschka,项目名称:lyx,代码行数:55,代码来源:LyXVC.cpp

示例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;
}
开发者ID:ifplusor,项目名称:SAUGamePlatform,代码行数:56,代码来源:CEngine.cpp

示例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;
	}
开发者ID:zmanchun,项目名称:insieme,代码行数:11,代码来源:source_locations.cpp

示例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;
}
开发者ID:xiaoyugm,项目名称:chtproject,代码行数:58,代码来源:menucommandsetcfg.cpp

示例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();          
        }
        
}
开发者ID:SorinS,项目名称:fop-miniscribus,代码行数:11,代码来源:_Image_Page_Struct.cpp

示例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;
}
开发者ID:tribals,项目名称:efifs,代码行数:20,代码来源:file.c

示例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;
}
开发者ID:flaithbheartaigh,项目名称:almalert,代码行数:11,代码来源:btobexserver.cpp

示例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 );
    }
}
开发者ID:Azarien,项目名称:open-watcom-v2,代码行数:11,代码来源:parsems.c


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