您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ AddFile函数代码示例

51自学网 2021-06-01 19:40:57
  C++
这篇教程C++ AddFile函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中AddFile函数的典型用法代码示例。如果您正苦于以下问题:C++ AddFile函数的具体用法?C++ AddFile怎么用?C++ AddFile使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了AddFile函数的29个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: CrashCallback

BOOL WINAPI CrashCallback(LPVOID lpvState){  CString sLogFile = GetAppDir() + _T("//dummy.log");  CString sIniFile = GetAppDir() + _T("//dummy.ini");#ifdef TEST_DEPRECATED_FUNCS  AddFile(lpvState, sLogFile, _T("Dummy Log File"));  AddFile(lpvState, sLogFile, _T("Dummy INI File"));#else  lpvState;    int nResult = crAddFile2(sLogFile, NULL, _T("Dummy Log File"), CR_AF_MAKE_FILE_COPY);  ATLASSERT(nResult==0);  nResult = crAddFile(sIniFile, _T("Dummy INI File"));  ATLASSERT(nResult==0);  nResult = crAddScreenshot(CR_AS_MAIN_WINDOW);  ATLASSERT(nResult==0);  nResult = crAddProperty(_T("VideoCard"),_T("nVidia GeForce 9800"));  ATLASSERT(nResult==0);#endif  return TRUE;}
开发者ID:doo,项目名称:CrashRpt,代码行数:26,


示例2: CONS_Printf

// Pass a null terminated list of files to use.// All files are optional, but at least one file must be found.// The name searcher looks backwards, so a later file does override all earlier ones.// Also adds GWA files if they exist.bool FileCache::InitMultipleFiles(const char *const*filenames){  CONS_Printf("Loading resource files.../n");  bool result = true;  for ( ; *filenames != NULL; filenames++)    {      const char *curfile = *filenames;      if (AddFile(curfile) == -1)	result = false;      // try finding corresponding GWA file (GL-nodes data)      string gwafile(curfile);      // Try lower case.      gwafile.replace(gwafile.length()-3, 3, "gwa");      if (AddFile(gwafile.c_str(), true) == -1)	{	  // not found, try upper case	  gwafile.replace(gwafile.length()-3, 3, "GWA");	  if (AddFile(gwafile.c_str(), true) == -1)	    {	      // CONS_Printf(" No GL information for file %s./n", curfile);	      continue; // not found	    }	}      CONS_Printf(" Added GL information from file %s./n", gwafile.c_str());    }  if (vfiles.size() == 0)    I_Error("FileCache::InitMultipleFiles: no files found");  // result = false : at least one file was missing  return result;}
开发者ID:meiavy,项目名称:doom-legacy,代码行数:39,


示例3: ProjectExistingFile

void ProjectExistingFile(void){    PROJECTITEM *data = GetItemInfo(prjSelectedItem);    if (data && (data->type == PJ_PROJ || data->type == PJ_FOLDER))    {        OPENFILENAME ofn;        if (OpenFileDialog(&ofn, data->realName, hwndProject, FALSE, TRUE, szNewFileFilter,                               "Open existing file"))        {            char *path = ofn.lpstrFile;            if (path[strlen(path)+1]) // multiselect            {                char buf[MAX_PATH];                char *q = path + strlen(path) + 1;                while (*q)                {                    sprintf(buf, "%s//%s", path, q);                    AddFile(data, buf, TRUE);                    q += strlen(q) + 1;                }            }            else            {                AddFile(data, path, TRUE);            }			        }    }}
开发者ID:jossk,项目名称:OrangeC,代码行数:28,


示例4: Walk

void Walk(boost::filesystem::path p, unsigned short int top, std::string prefix, file_list& files){    boost::filesystem::directory_iterator end;    if(!boost::filesystem::exists(p))    {        std::cerr << "Could not open " << p.string() << std::endl;        return;    }    top = AddFile(p, top, prefix, files);    for(boost::filesystem::directory_iterator it(p); it != end; ++it)    {        if(!boost::filesystem::is_directory(it->status()))            AddFile(it->path(), top, prefix, files);        else        {            char* dirname;            dirname = new char[strlen(it->path().string().c_str())+2];            strcpy(dirname, it->path().string().c_str());            Walk(dirname, top, prefix, files);            delete[] dirname;        }    }}
开发者ID:thekidder,项目名称:taffy,代码行数:25,


示例5: msg

voidProjectWindow::AddNewFile(BString name, bool create_pair){	BMessage msg(M_ADD_FILES);		DPath projfile(fProject->GetPath().GetFolder());	projfile << name;		entry_ref ref = gFileFactory.CreateSourceFile(projfile.GetFolder(),												projfile.GetFileName(),												create_pair ? SOURCEFILE_PAIR : 0);	if (!ref.name || strlen(ref.name) == 0)		return;		AddFile(ref);		if (fSourceControl)		fSourceControl->AddToRepository(projfile.GetFullPath());		msg.AddRef("refs",&ref);		if (create_pair && fSourceControl)	{		entry_ref partnerRef = GetPartnerRef(ref);		DPath partnerPath(partnerRef);		fSourceControl->AddToRepository(projfile.GetFullPath());		msg.AddRef("refs",&partnerRef);				if (!gDontManageHeaders)			AddFile(partnerRef);		fSourceControl->AddToRepository(partnerPath.GetFullPath());	}		be_app->PostMessage(&msg);}
开发者ID:passick,项目名称:Paladin,代码行数:35,


示例6: dlg

void CPackagePage::OnAddFile() {	CFileDialog dlg( TRUE, NULL, NULL,		OFN_HIDEREADONLY|OFN_ALLOWMULTISELECT|OFN_ENABLESIZING,		_T("All Files|*.*||"), this );		const DWORD nFilesSize = 81920;	LPTSTR szFiles = new TCHAR [ nFilesSize ];	ZeroMemory( szFiles, nFilesSize * sizeof( TCHAR ) );	dlg.m_ofn.lpstrFile	= szFiles;	dlg.m_ofn.nMaxFile	= nFilesSize;		if ( dlg.DoModal() == IDOK )	{			CWaitCursor wc;		CString strFolder	= szFiles;		LPCTSTR pszFile		= szFiles + strFolder.GetLength() + 1;			if ( *pszFile )		{			for ( strFolder += '//' ; *pszFile ; )			{				AddFile( strFolder + pszFile );				pszFile += _tcslen( pszFile ) + 1;			}		}		else		{			AddFile( strFolder );		}	}	delete [] szFiles;}
开发者ID:ivan386,项目名称:Shareaza,代码行数:34,


示例7: internalConfig

int LibMain::Run(int argc, char **argv){    Utils::banner(argv[0]);    CmdSwitchFile internalConfig(SwitchParser);    std::string configName = Utils::QualifiedFile(argv[0], ".cfg");    std::fstream configTest(configName.c_str(), std::ios::in);    if (!configTest.fail())    {        configTest.close();        if (!internalConfig.Parse(configName.c_str()))            Utils::fatal("Corrupt configuration file");    }    if (!SwitchParser.Parse(&argc, argv))    {        Utils::usage(argv[0], usageText);    }    if (argc < 2 && File.GetCount() < 3)    {        Utils::usage(argv[0], usageText);    }    // setup    ObjString outputFile = argv[1];    size_t n = outputFile.find_last_of('.');    if (n == std::string::npos || (n != outputFile.size()-1 && outputFile[n+1] != 'l'))    {        outputFile += ".l";    }    LibManager librarian(outputFile, caseSensitiveSwitch.GetValue());    if (librarian.IsOpen())        if (!librarian.LoadLibrary())        {            std::cout << outputFile.c_str() << " is not a library" << std::endl;            return 1;        }    for (int i= 2; i < argc; i++)        AddFile(librarian, argv[i]);    for (int i = 1; i < File.GetCount(); i++)        AddFile(librarian, File.GetValue()[i]);    for (CmdFiles::FileNameIterator it = addFiles.FileNameBegin(); it != addFiles.FileNameEnd(); ++it)    {        librarian.AddFile(*(*it));    }    for (CmdFiles::FileNameIterator it = replaceFiles.FileNameBegin(); it != replaceFiles.FileNameEnd(); ++it)    {        librarian.ReplaceFile(*(*it));    }    if (modified)        if (!librarian.SaveLibrary())        {            std::cout << "Error writing library file" << std::endl;            return 1;        }    return 0;}
开发者ID:bencz,项目名称:OrangeC,代码行数:56,


示例8: ASSERT

bool CNotAddedFilesDlg::AddFile(LPCTSTR szFileName, UINT nResourceString){	CString strMessage;	if (!strMessage.LoadString(nResourceString))	{		ASSERT(false);		return AddFile(szFileName, _T("???"));	}	else		return AddFile(szFileName, strMessage);}
开发者ID:quinzio,项目名称:renameit,代码行数:11,


示例9: AddFile

void CMainWnd::AddFile2(LPTSTR pszPath, LPTSTR pszFile, LPTSTR pszTitle){	if (IsValidStream(pszFile)) {		AddFile(pszFile, pszTitle);		return;	}	TCHAR szFile[MAX_PATH];	wsprintf(szFile, _T("%s//%s"), pszPath, pszFile);	AddFile(szFile, pszTitle);}
开发者ID:v-zaburdaev,项目名称:Gsplayer2,代码行数:11,


示例10: Generate

// Generate//------------------------------------------------------------------------------bool ToolManifest::Generate( const Node * mainExecutable, const Dependencies & dependencies ){	m_Files.Clear();	m_TimeStamp = 0;	m_Files.SetCapacity( 1 + dependencies.GetSize() );	// unify "main executable" and "extra files"	// (loads contents of file into memory, and creates hashes)    if ( !AddFile( mainExecutable ) )    {        return false; // AddFile will have emitted error    }	for ( size_t i=0; i<dependencies.GetSize(); ++i )	{		const FileNode & n = *( dependencies[ i ].GetNode()->CastTo< FileNode >() );		if ( !AddFile( &n ) )		{			return false; // AddFile will have emitted error		}	}	// create a hash for the whole tool chain	const size_t numFiles( m_Files.GetSize() );	const size_t memSize( numFiles * sizeof( uint32_t ) * 2 );	uint32_t * mem = (uint32_t *)ALLOC( memSize );	uint32_t * pos = mem;	for ( size_t i=0; i<numFiles; ++i )	{		const File & f = m_Files[ i ];		// file contents		*pos = f.m_Hash;		++pos;		// file name & sub-path (relative to remote folder)		AStackString<> relativePath;		GetRemoteFilePath( (uint32_t)i, relativePath, false ); // false = don't use full path		*pos = xxHash::Calc32( relativePath );		++pos;	}	m_ToolId = xxHash::Calc64( mem, memSize );	FREE( mem );	// update time stamp (most recent file in manifest)	for ( size_t i=0; i<numFiles; ++i )	{		const File & f = m_Files[ i ];		ASSERT( f.m_TimeStamp ); // should have had an error before if the file was missing		m_TimeStamp = Math::Max( m_TimeStamp, f.m_TimeStamp );	}	return true;}
开发者ID:ClxS,项目名称:fastbuild,代码行数:55,


示例11: sett

void SpringDebugReport::AddVFSFile( const wxString& fn, const wxString& id ){	wxString dir = sett().GetCurrentUsedDataDir() + wxFileName::GetPathSeparator();	AddFile( dir + fn, id );	return;//TODO: wtf is there a return here?	wxArrayString res = usync().FindFilesVFS( fn );	if ( res.Count() > 0 ) {		AddFile( res[0], id );		wxLogError( _T("SpringDebugReport: file found: "), res[0].c_str() );	}	else		wxLogError( _T("SpringDebugReport: file not found: "), fn.c_str() );}
开发者ID:johnjianfang,项目名称:springlobby,代码行数:13,


示例12: CmdStringParse

/* * Parse the command string contained in the current context. */void CmdStringParse( OPT_STORAGE *cmdOpts, int *itemsParsed )/***********************************************************/{    int                 ch;    char *              filename;    for( ;; ) {        /*** Find the start of the next item ***/        CmdScanWhitespace();        ch = GetCharContext();        if( ch == '/0' )  break;        MarkPosContext();               /* mark start of switch */        /*** Handle switches, command files, and input files ***/        if( ch == '-'  ||  ch == '/' ) {        /* switch */            if( OPT_PROCESS( cmdOpts ) != 0 ) {                cmd_line_error();            }        } else if( ch == '@' ) {                /* command file */            filename = CmdScanFileNameWithoutQuotes();            PushContext();            if( OpenFileContext( filename ) ) {                FatalError( "Cannot open '%s'.", filename );            }            FreeMem( filename );            CmdStringParse( cmdOpts, itemsParsed );            PopContext();        } else if( ch == '"' ) {                /* quoted option or file name */            ch = GetCharContext();            if( ch == '-' ) {                Quoted = 1;                if( OPT_PROCESS( cmdOpts ) != 0 ) {                    cmd_line_error();                }            } else {                UngetCharContext();                UngetCharContext();                filename = CmdScanFileName();                AddFile( TYPE_DEFAULT_FILE, filename );                FreeMem( filename );            }                        } else {                                /* input file */            UngetCharContext();            filename = CmdScanFileName();            AddFile( TYPE_DEFAULT_FILE, filename );            FreeMem( filename );        }        (*itemsParsed)++;    }    CloseContext();}
开发者ID:Ukusbobra,项目名称:open-watcom-v2,代码行数:54,


示例13: SetMarkFile

/*** SetMarkFile - Change markfile** Purpose:**   Changes to a new markfile.** Input:*   val - String after the 'markfile' switch** Output:**   Returns Error string if error, NULL otherwise** Notes:**   We:** UNDONE:o Magically ensure that the current markfile is up to date and*	  saved to disk.  This means, at the very least, that there*	  can be no dirty files.**	o Remove the current markfile from the file list.**	o Read in the new markfile.**	o Invalidate all current marks.  This is just marking them*	  invalid in the PFILE.***************************************************************************/char *SetMarkFile (    char *val    ) {    REGISTER PFILE pFile;    buffer  tmpval;    pathbuf pathname;    strcpy ((char *) tmpval, val);    if (NULL == CanonFilename (tmpval, pathname)) {        sprintf (buf, "'%s': name is malformed", tmpval);        return buf;    }    if (!(pFile = FileNameToHandle (pathname, NULL))) {        pFile = AddFile (pathname);    }    if (!TESTFLAG(FLAGS(pFile), REAL) && !FileRead (pathname, pFile, FALSE)) {        RemoveFile (pFile);        sprintf (buf, "'%s' - %s", pathname, error());        return buf;    }    pFileMark = pFile;    for (pFile = pFileHead; pFile; pFile = pFile->pFileNext) {        if (!TESTFLAG(FLAGS(pFile), FAKE)) {            RSETFLAG (FLAGS(pFile), VALMARKS);        }    }    return NULL;}
开发者ID:mingpen,项目名称:OpenNT,代码行数:65,


示例14: AddFileAndParents

unsigned short int AddFileAndParents(boost::filesystem::path p, unsigned short int parent, std::string prefix, file_list& files){    if(!boost::filesystem::exists(p))    {        std::cerr << "Could not open " << p.string() << std::endl;        return parent;    }    boost::filesystem::path base;    for(boost::filesystem::path::iterator it = p.begin(); it != p.end(); ++it)    {        if(base.empty())        {            base = *it;        }        else        {            std::string name = base.string() + "/" + it->string();            base = boost::filesystem::path(name);        }        parent = AddFile(base, parent, prefix, files);    }    return parent;}
开发者ID:thekidder,项目名称:taffy,代码行数:25,


示例15:

std::unique_ptr<Project> JsonImporter::ImportProject(FileManager& fileManager, const filesystem::path& projectFile){    auto json = internal::ParseJsonFile(fileManager.GetFileSystem(), projectFile);    if (internal::IsValidProject(json))    {        auto project = std::make_unique<Project>();        project->SetName(json["project"]);        project->SetFile(projectFile);        for (auto& config : json["configs"])        {            project->AddConfiguration(internal::ImportConfig(config));        }        for (auto& filePath : json["files"])        {            project->AddFile(fileManager.GetOrCreateFile(filePath));        }        return project;    }    return nullptr;}
开发者ID:eparayre,项目名称:blueprint,代码行数:26,


示例16: FileSource

FileSourceZip::FileSourceZip(FileSourceFS &fs, const std::string &zipPath) : FileSource(zipPath), m_archive(0){	mz_zip_archive *zip = static_cast<mz_zip_archive*>(std::calloc(1, sizeof(mz_zip_archive)));	FILE *file = fs.OpenReadStream(zipPath);	if (!mz_zip_reader_init_file_stream(zip, file, 0)) {		Output("FileSourceZip: unable to open '%s'/n", zipPath.c_str());		std::free(zip);		return;	}	mz_zip_archive_file_stat zipStat;	Uint32 numFiles = mz_zip_reader_get_num_files(zip);	for (Uint32 i = 0; i < numFiles; i++) {		if (mz_zip_reader_file_stat(zip, i, &zipStat)) {			bool is_dir = mz_zip_reader_is_file_a_directory(zip, i);			if (!mz_zip_reader_is_file_encrypted(zip, i)) {				std::string fname = zipStat.m_filename;				if ((fname.size() > 1) && (fname[fname.size()-1] == '/')) {					fname.resize(fname.size() - 1);				}				AddFile(zipStat.m_filename, FileStat(i, zipStat.m_uncomp_size,					MakeFileInfo(fname, is_dir ? FileInfo::FT_DIR : FileInfo::FT_FILE)));			}		}	}	m_archive = static_cast<void*>(zip);}
开发者ID:Ikesters,项目名称:pioneer,代码行数:29,


示例17: CreateTrd

//=============================================================================//	eFdd::ReadScl//-----------------------------------------------------------------------------bool eFdd::ReadScl(const void* data, size_t data_size){	if(data_size < 9)		return false;	const byte* buf = (const byte*)data;	if(memcmp(data, "SINCLAIR", 8) || int(data_size) < 9 + (0x100 + 14)*buf[8])		return false;	CreateTrd();	int size = 0;	for(int i = 0; i < buf[8]; ++i)	{		size += buf[9 + 14 * i + 13];	}	if(size > 2544)	{		eUdi::eTrack::eSector* s = GetSector(0, 0, 9);		SectorDataW(s, 0xe5, size);			// free sec		UpdateCRC(s);	}	const byte* d = buf + 9 + 14 * buf[8];	for(int i = 0; i < buf[8]; ++i)	{		if(!AddFile(buf + 9 + 14*i, d))			return false;		d += buf[9 + 14*i + 13]*0x100;	}	return true;}
开发者ID:open-develop,项目名称:unrealspeccyp,代码行数:32,


示例18: DeleteAll

void FWadCollection::InitMultipleFiles (TArray<FString> &filenames){	int numfiles;	// open all the files, load headers, and count lumps	DeleteAll();	numfiles = 0;	for(unsigned i=0;i<filenames.Size(); i++)	{		int baselump = NumLumps;		AddFile (filenames[i]);	}	NumLumps = LumpInfo.Size();	if (NumLumps == 0)	{		I_FatalError ("W_InitMultipleFiles: no files found");	}	RenameNerve();	RenameSprites();	FixMacHexen();	// [RH] Set up hash table	FirstLumpIndex = new uint32_t[NumLumps];	NextLumpIndex = new uint32_t[NumLumps];	FirstLumpIndex_FullName = new uint32_t[NumLumps];	NextLumpIndex_FullName = new uint32_t[NumLumps];	InitHashChains ();	LumpInfo.ShrinkToFit();	Files.ShrinkToFit();}
开发者ID:emileb,项目名称:gzdoom,代码行数:32,


示例19: while

LRESULT UploadQueueFrame::onItemChanged(int /*idCtrl*/, LPNMHDR /* pnmh */, BOOL& /*bHandled*/) {	HTREEITEM userNode = ctrlQueued.GetSelectedItem();	while(userNode) {		ctrlList.DeleteAllItems();		UserItem* ui = reinterpret_cast<UserItem *>(ctrlQueued.GetItemData(userNode));		if(ui) {			auto users = UploadManager::getInstance()->getUploadQueue();			auto it = find_if(users.begin(), users.end(), [&](const UserPtr& u) { return u == ui->u; });			if(it != users.end()) {				ctrlList.SetRedraw(FALSE);				ctrlQueued.SetRedraw(FALSE);				for(auto i = it->files.cbegin(); i != it->files.cend(); ++i) {					AddFile(*i);				}				ctrlList.resort();				ctrlList.SetRedraw(TRUE);				ctrlQueued.SetRedraw(TRUE);				ctrlQueued.Invalidate(); 				updateStatus();				return 0;			}		} else {			LoadAll();		}		userNode = ctrlQueued.GetNextSiblingItem(userNode);	}	return 0;}
开发者ID:Dimetro83,项目名称:DC_DDD,代码行数:29,


示例20: ParseDirectory

//--------------------------------------------------------------------------------bool CFileIndexSubSystem::ParseDirectory(CString sPath, CWriteLock& lock)	{	WIN32_FIND_DATA data;	CFindFileHandle hand = ::FindFirstFile(sPath + "//*.*", &data);	if(! hand.IsValid())		return false;	CFileIndexDirObject* pDir;	CFileIndexFileObject* pFile;	for(;;)		{		if(data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)			{			if(data.cFileName[0] != '.')				ParseDirectory(sPath + '//' + data.cFileName, lock);			}		else			AddFile(sPath, data.cFileName, pDir, pFile, lock);		if(! ::FindNextFile(hand, &data))			break;		}	return true;	}
开发者ID:moosethemooche,项目名称:Certificate-Server,代码行数:28,


示例21: memset

void CVisionTestDlg::OnLoadimages() {	char aryFileBuffer[ 16*1024 ];	unsigned int unBufferLen = 16*1024 ;	memset( aryFileBuffer, 0,  16*1024 );	CFileDialog ldFile(TRUE, NULL, "", OFN_ALLOWMULTISELECT | OFN_ENABLESIZING , 						"Images (bmp, jpg, png)|*.bmp;*.jpg;*.png||");		// Set Buffer for the Filenames (this is only necessary because of Mulitselection)	ldFile.m_ofn.lpstrFile = aryFileBuffer;	ldFile.m_ofn.nMaxFile  = unBufferLen;	if (ldFile.DoModal() != IDOK)		return;	CString  strPath, strFileName, strFileTitle, strFileExt;	POSITION pos;		// Clear the list	ClearFiles();		// Pick all files and add the to the list	pos = ldFile.GetStartPosition();	while (pos != NULL)	{		strPath = ldFile.GetNextPathName(pos);		AddFile( strPath );	}}
开发者ID:scs,项目名称:leanxsugus,代码行数:31,


示例22:

voidCBFileListTable::ParseFile	(	const JString&				fullName,	const JPtrArray<JString>&	allSuffixList,	const time_t				modTime,	CBSymbolList*				symbolList,	CBCTree*					cTree,	CBJavaTree*					javaTree	){	if (CBPrefsManager::FileMatchesSuffix(fullName, allSuffixList))		{		const CBTextFileType fileType = (CBGetPrefsManager())->GetFileType(fullName);		JFAID_t id;		if (AddFile(fullName, fileType, modTime, &id))			{			itsChangedDuringParseFlag = kJTrue;			symbolList->FileChanged(fullName, fileType, id);			cTree->FileChanged(fullName, fileType, id);			javaTree->FileChanged(fullName, fileType, id);			}		}}
开发者ID:raorn,项目名称:jx_application_framework,代码行数:25,


示例23: parsedir

void parsedir(char *path){    WIN32_FIND_DATA fd;    HANDLE handle;	FILE *outfile = fopen("temp.dat","wb");            handle = FindFirstFile(path,&fd);    do     {        if(strcmp(fd.cFileName,".") != 0 && strcmp(fd.cFileName,"..") != 0 && !(fd.dwFileAttributes & FILE_ATTRIBUTE_HIDDEN))        {                            if(!(fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY))            {					FILE *infile = NULL;				char *temppath = (char*)calloc(strlen(path)+1,sizeof(char));				char *buffer = NULL;				int len=0;								strcpy(temppath,path);				temppath[strlen(temppath)-1] = '/0';								chdir(temppath);				AddFile(fd.cFileName);				chdir("..");								free(temppath);            }        }    } while(FindNextFile(handle,&fd)!=0);		fclose(outfile);}
开发者ID:Zhaochenguang,项目名称:vn_translation_tools,代码行数:32,


示例24: fopen

void FileList::AddFile(const char *filepath, const char *filename, FileListNodeContext context){	if (filepath == 0 || filename == 0)		return;	char *data;	//std::fstream file;	//file.open(filename, std::ios::in | std::ios::binary);	FILE *fp = fopen(filepath, "rb");	if (fp == 0)		return;	fseek(fp, 0, SEEK_END);	int length = ftell(fp);	fseek(fp, 0, SEEK_SET);	if (length > (int)((unsigned int) - 1 / 8)) {		// If this assert hits, split up your file. You could also change BitSize_t in RakNetTypes.h to unsigned long long but this is not recommended for performance reasons		RakAssert("Cannot add files over 536 MB" && 0);		fclose(fp);		return;	}	bool usedAlloca = false;	if (length < MAX_ALLOCA_STACK_ALLOCATION) {		data = (char*) alloca(length);		usedAlloca = true;	} else		data = (char*) rakMalloc_Ex(length, __FILE__, __LINE__);	fread(data, 1, length, fp);	AddFile(filename, filepath, data, length, length, context);	fclose(fp);	if (usedAlloca == false)		rakFree_Ex(data, __FILE__, __LINE__);}
开发者ID:Codyle,项目名称:facilitator,代码行数:31,


示例25: AddFile

bool ErrorReport::GetCrashDump(const fs::path & fileName) {	#if ARX_PLATFORM == ARX_PLATFORM_WIN32	bool bHaveDump = false;	if(fs::exists(m_pCrashInfo->miniDumpTmpFile))	{		fs::path fullPath = m_ReportFolder / fileName;		if(fs::rename(m_pCrashInfo->miniDumpTmpFile, fullPath))		{			AddFile(fullPath);			bHaveDump = true;		}	}		return bHaveDump;	#else //  ARX_PLATFORM != ARX_PLATFORM_WIN32		ARX_UNUSED(fileName);		// TODO: Write core dump to 	// fs::path fullPath = m_ReportFolder / fileName;		return getCrashDescription();	#endif	}
开发者ID:EstrangedGames,项目名称:ArxLibertatis,代码行数:29,


示例26: _tcslen

void MPanelItem::AddFlags(LPCTSTR asItem){	if (!asItem || !*asItem)		return;	size_t nLen = _tcslen(asItem);	// Check first, may be flag already exists?	if (pFlags) {				TCHAR* psz = pFlags->item.cFileName;		TCHAR* pszNext = _tcschr(psz, _T(','));		while (psz && *psz) {			if (!pszNext) pszNext = psz + _tcslen(psz);			if ((pszNext - psz) == nLen) {				if (_tcsncmp(psz, asItem, nLen) == 0)					return; // Этот флаг уже добавили			}			if (*pszNext != _T(',')) break;			psz = pszNext+1;			pszNext = _tcschr(psz, _T(','));		}		_tcscat(pFlags->item.cFileName, _T(","));		_tcscat(pFlags->item.cFileName, asItem);		pFlags->AddText(_T(","));	} else {		pFlags = AddFile(asItem, 0);		pFlags->isFlags = TRUE;	}	pFlags->AddText(asItem, -1, TRUE);}
开发者ID:kleopatra999,项目名称:FarPlugins,代码行数:33,


示例27: AddFile

unsigned int HTMLProject::AddLabel(const HTMLLabel *label){	int i;	static unsigned int lastFile=0;		if ( (i=FindLabel(label)) <0 )	{// construction du small label		smallLabel *newLabel = new smallLabel;		lastFile = AddFile(label->fname.String(),lastFile);				newLabel->file = lastFile;		newLabel->label = label->lname;/*// on cherche le bon endroit pour insérer le small label				int p = labelList->CountItems();		if (p>1)		{			do				p--;			while ( (p>=1) && ((smallLabel*)labelList->ItemAt(p))->file > lastFile);		}			// p=0 est un lien spécial: celui de la page d'intro				labelList->AddItem(newLabel,p);		return (p);*/		labelList->AddItem(newLabel);		return(labelList->CountItems()-1);	}	else		return (unsigned int)i;}
开发者ID:mmadia,项目名称:behappy-svn_clone,代码行数:33,


示例28: GetMiscCrashInfo

bool ErrorReport::Initialize(){		// Create a shared memory object.	m_SharedMemory = boost::interprocess::shared_memory_object(boost::interprocess::open_only, m_SharedMemoryName.toStdString().c_str(), boost::interprocess::read_write);	// Map the whole shared memory in this process	m_MemoryMappedRegion = boost::interprocess::mapped_region(m_SharedMemory, boost::interprocess::read_write);	// Our SharedCrashInfo will be stored in this shared memory.	m_pCrashInfo = (CrashInfo*)m_MemoryMappedRegion.get_address();	if(m_MemoryMappedRegion.get_size() != sizeof(CrashInfo))	{		m_DetailedError = "The size of the memory mapped region does not match the size of the CrashInfo structure.";		return false;	}	bool bMiscCrashInfo = GetMiscCrashInfo();	if(!bMiscCrashInfo)		return false;	// Add attached files from the report	for(int i = 0; i < m_pCrashInfo->nbFilesAttached; i++)		AddFile(m_pCrashInfo->attachedFiles[i]);	m_ReportFolder = fs::path(m_pCrashInfo->crashReportFolder) / fs::path(m_CrashDateTime.toString("yyyy.MM.dd hh.mm.ss").toUtf8());	if(!fs::create_directories(m_ReportFolder))	{		m_DetailedError = QString("Unable to create directory (%1) to store the crash report files.").arg(m_ReportFolder.string().c_str());		return false;	}	return true;}
开发者ID:EstrangedGames,项目名称:ArxLibertatis,代码行数:35,


示例29: GetFileCRC

ISoundInstance * CSoundManager2D::GetInstance(const char * c_pszFileName){	DWORD dwFileCRC = GetFileCRC(c_pszFileName);	TSoundDataMap::iterator itor = ms_dataMap.find(dwFileCRC);	CSoundData * pkSoundData;	if (itor == ms_dataMap.end())		pkSoundData = AddFile(dwFileCRC, c_pszFileName); // CSoundBase::AddFile	else		pkSoundData = itor->second;	assert(pkSoundData != NULL);	static DWORD k = 0;	DWORD start = k++;	DWORD end = start + INSTANCE_MAX_COUNT;	while (start < end)	{		CSoundInstance2D * pkInst = &ms_Instances[start % INSTANCE_MAX_COUNT];		if (pkInst->IsDone())		{			if (!pkInst->SetSound(pkSoundData))				TraceError("CSoundManager2D::GetInstance (filename: %s)", c_pszFileName);			return (pkInst);		}		++start;	}	return NULL;}
开发者ID:adi97ida,项目名称:Client,代码行数:35,



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


C++ AddFlag函数代码示例
C++ AddField函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。