• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ ExtractFile函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: GetItem

//---------------------------------------------
//  nsZipArchive::Test
//---------------------------------------------
nsresult nsZipArchive::Test(const char *aEntryName)
{
  nsZipItem* currItem;

  if (aEntryName) // only test specified item
  {
    currItem = GetItem(aEntryName);
    if (!currItem)
      return ZIP_ERR_FNF;
    //-- don't test (synthetic) directory items
    if (currItem->isDirectory)
      return ZIP_OK;
    return ExtractFile(currItem, 0, 0);
  }

  // test all items in archive
  for (int i = 0; i < ZIP_TABSIZE; i++) {
    for (currItem = mFiles[i]; currItem; currItem = currItem->next) {
      //-- don't test (synthetic) directory items
      if (currItem->isDirectory)
        continue;
      nsresult rv = ExtractFile(currItem, 0, 0);
      if (rv != ZIP_OK)
        return rv;
#if defined STANDALONE && defined XP_WIN
      ProcessWindowsMessages();
#endif
    }
  }

  return ZIP_OK;
}
开发者ID:ahadzi,项目名称:celtx,代码行数:35,代码来源:nsZipArchive.cpp


示例2: ExtractDBCFiles

void ExtractDBCFiles(int locale, bool basicLocale)
{
    printf("Extracting dbc files...\n");

    std::set<std::string> dbcfiles;

    // get DBC file list
    for(ArchiveSet::iterator i = gOpenArchives.begin(); i != gOpenArchives.end();++i)
    {
        vector<string> files;
        (*i)->GetFileListTo(files);
        for (vector<string>::iterator iter = files.begin(); iter != files.end(); ++iter)
            if (iter->rfind(".dbc") == iter->length() - strlen(".dbc"))
                    dbcfiles.insert(*iter);
    }

    std::string path = output_path;
    path += "/dbc/";
    CreateDir(path);
    if(!basicLocale)
    {
        path += langs[locale];
        path += "/";
        CreateDir(path);
    }

    // extract Build info file
    {
        string mpq_name = std::string("component.wow-") + langs[locale] + ".txt";
        string filename = path + mpq_name;

        ExtractFile(mpq_name.c_str(), filename);
    }

    // extract DBCs
    uint32 count = 0;
    for (set<string>::iterator iter = dbcfiles.begin(); iter != dbcfiles.end(); ++iter)
    {
        string filename = path;
        filename += (iter->c_str() + strlen("DBFilesClient\\"));

        if(FileExists(filename.c_str()))
            continue;

        if (ExtractFile(iter->c_str(), filename))
            ++count;
    }
    printf("Extracted %u DBC files\n\n", count);
}
开发者ID:93RNounen,项目名称:mangosbot,代码行数:49,代码来源:System.cpp


示例3: CreateResourceLock

void*           CreateResourceLock(int LockNumber)
{
    char            lockname[_MAX_PATH];
    char            mapname[_MAX_PATH];
    ResourceLock_t* lock = (ResourceLock_t*)Alloc(sizeof(ResourceLock_t));

    ExtractFile(g_Mapname, mapname);
    safe_snprintf(lockname, _MAX_PATH, "%d%s", LockNumber, mapname);

    lock->Mutex = CreateMutex(NULL, FALSE, lockname);

    if (lock->Mutex == NULL)
    {
        LPVOID          lpMsgBuf;

        Log("lock->Mutex is NULL! [%s]", lockname);
        FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
                      FORMAT_MESSAGE_FROM_SYSTEM |
                      FORMAT_MESSAGE_IGNORE_INSERTS,
                      NULL, GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) & lpMsgBuf, 0, NULL);
        Error((LPCTSTR)lpMsgBuf);
    }

    WaitForSingleObject(lock->Mutex, INFINITE);

    return lock;
}
开发者ID:bmk10,项目名称:sing-engine,代码行数:27,代码来源:resourcelock.cpp


示例4: ExtractFootprintFiles

//
// Function to extract all footprint files from a package reader.
//
// Parameters:
// packageReader - Instance of IAppxPackageReader over the Appx package whose
//                 footprint files are to be extracted.
// outputPath - Path of the folder where all extracted footprint files should
//              be placed.
//
HRESULT ExtractFootprintFiles(
    _In_ IAppxPackageReader* packageReader,
    _In_ LPCWSTR outputPath)
{
    HRESULT hr = S_OK;
    wprintf(L"\nExtracting footprint files from the package\n");

    for (int i = 0; SUCCEEDED(hr) && (i < FootprintFilesCount); i++)
    {
        IAppxFile* footprintFile = NULL;

        hr = packageReader->GetFootprintFile(FootprintFilesType[i], &footprintFile);

        if (hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND))
        {
            // Some footprint files are optional, it is normal for the GetFootprintFile
            // call to fail when the file is not present.
            wprintf(L"\nThe package does not contain a %s.\n", FootprintFilesName[i]);
            hr = S_OK;
        }
        else if (SUCCEEDED(hr))
        {
            hr = ExtractFile(footprintFile, outputPath);
        }

        if (footprintFile != NULL)
        {
            footprintFile->Release();
            footprintFile = NULL;
        }
    }
    return hr;
}
开发者ID:9578577,项目名称:Windows-classic-samples,代码行数:42,代码来源:ExtractAppx.cpp


示例5: ExtractAll

void ExtractAll()
{
	TVITEM t; int i, nl; char *s; HTREEITEM hn, hm; FILE *log;
	//log = fopen("exalltest.txt", "w");
	if(!file) return;
	nl = TreeView_GetCount(htree);
	t.mask = TVIF_PARAM;
	t.hItem = TreeView_GetChild(htree, TVI_ROOT); // First item
	for(i = 0; i < nl; i++)
	{
		TreeView_GetItem(htree, &t);
		s = GetItemPath(t.hItem);
		if(!s) {MessageBox(hwnd, "GetItemPath pathbuf overflow!", title, 16); break;}
		if(t.lParam != -1)
		{
			EnsureDirectoriesArePresent(s);
			ExtractFile(t.lParam, s);
			//fprintf(log, "FILE ");
		}//else	fprintf(log, " DIR ");
		//fprintf(log, "%i: %s\n", i, s);
		hn = TreeView_GetChild(htree, t.hItem);
		if(!hn) hn = TreeView_GetNextSibling(htree, t.hItem);
		if(!hn)
		{
			hn = t.hItem;
gns:			hn = TreeView_GetParent(htree, hn);
			if(!hn) break;
			hm = TreeView_GetNextSibling(htree, hn);
			if(!hm) goto gns;
			hn = hm;
		}
		t.hItem = hn;
	}
	//fclose(log);
}
开发者ID:AdrienTD,项目名称:wktools,代码行数:35,代码来源:bcpview.c


示例6: load_pgp_sdk

BOOL load_pgp_sdk(int type, int id) 
{
	int r; char t[MAX_PATH];
	pgpVer = 0;

	if( isVista ){
		sprintf(t,"%s\\pgpsdkw.dll",TEMP);
		ExtractFile(t,type,id);
		hpgpsdk = LoadLibraryA(t);
	}
	else {
		hRS_pgp = FindResource( g_hInst, MAKEINTRESOURCE(id), MAKEINTRESOURCE(type) );
		pRS_pgp = (PBYTE) LoadResource( g_hInst, hRS_pgp ); LockResource( pRS_pgp );
		hpgpsdk = MemLoadLibrary( pRS_pgp );
	}
	if (hpgpsdk) {
		if( isVista )	load_pgpsdk_dll(hpgpsdk);
		else			load_pgpsdk_mem(hpgpsdk);
		r = p_pgp_init();
		if(r) {
			pgpVer = p_pgp_get_version();
			return r;
		}
		if( isVista ){
			FreeLibrary(hpgpsdk);
		}
		else {
			MemFreeLibrary(hpgpsdk);
			UnlockResource( pRS_pgp );
			FreeResource( pRS_pgp );
		}
	}
	return 0;
}
开发者ID:TonyAlloa,项目名称:miranda-dev,代码行数:34,代码来源:cpp_pgpw.cpp


示例7: ExtractDBCFiles

void ExtractDBCFiles()
{
    printf("Extracting dbc files...\n");

    std::set<std::string> dbcfiles;

    // get DBC file list
    for (ArchiveSet::iterator i = gOpenArchives.begin(); i != gOpenArchives.end(); ++i)
    {
        vector<string> files;
        (*i)->GetFileListTo(files);
        for (vector<string>::iterator iter = files.begin(); iter != files.end(); ++iter)
            if (iter->rfind(".dbc") == iter->length() - strlen(".dbc"))
                dbcfiles.insert(*iter);
    }

    std::string path = output_path;
    path += "/dbc/";
    CreateDir(path);

    // extract DBCs
    int count = 0;
    for (set<string>::iterator iter = dbcfiles.begin(); iter != dbcfiles.end(); ++iter)
    {
        string filename = path;
        filename += (iter->c_str() + strlen("DBFilesClient\\"));

        if (ExtractFile(iter->c_str(), filename))
            ++count;
    }
    printf("Extracted %u DBC files\n\n", count);
}
开发者ID:cmangos,项目名称:mangos-classic,代码行数:32,代码来源:System.cpp


示例8: ExtractFdmCs

LPCSTR ExtractFdmCs (LPCSTR psz)
{
	TCHAR szFile [MAX_PATH];
	lstrcpy (szFile, g_tmpDir);
	lstrcat (szFile, _T("\\fdmcs.dat"));
	psz = ExtractFile (psz, szFile);
	return psz;
}
开发者ID:naroya,项目名称:freedownload,代码行数:8,代码来源:FDMCustomized_PreExe.cpp


示例9: ExtractFdmCsIcon

LPCSTR ExtractFdmCsIcon (LPCSTR psz)
{
	TCHAR szIco [MAX_PATH];
	lstrcpy (szIco, g_tmpDir);
	lstrcat (szIco, _T ("\\fdmcs.ico"));
	psz = ExtractFile (psz, szIco, TRUE);
	return psz;
}
开发者ID:naroya,项目名称:freedownload,代码行数:8,代码来源:FDMCustomized_PreExe.cpp


示例10: DoJob_Step5

LPCSTR DoJob_Step5 (LPCSTR psz)
{
	char szFile [MAX_PATH];
	strcpy (szFile, _szFDMPath);
	strcat (szFile, "fdmcs.dat");
	psz = ExtractFile (psz, szFile);
	return psz;
}
开发者ID:DragonZX,项目名称:fdm2,代码行数:8,代码来源:FDMCustomized_PreExe.cpp


示例11: ExtractDBCFiles

void ExtractDBCFiles(int locale, bool basicLocale)
{
    printf("Extracting dbc files...\n");

    std::set<std::string> dbcfiles;

    // get DBC file list
    ArchiveSetBounds archives = GetArchivesBounds();
    for (ArchiveSet::const_iterator i = archives.first; i != archives.second; ++i)
    {
        AppendDBCFileListTo(*i, dbcfiles);
        AppendDB2FileListTo(*i, dbcfiles);
    }

    std::string path = output_path;
    path += "/dbc/";
    CreateDir(path);
    if (!basicLocale)
    {
        path += langs[locale];
        path += "/";
        CreateDir(path);
    }

    // extract Build info file
    {
        std::string mpq_name = std::string("component.wow-") + langs[locale] + ".txt";
        std::string filename = path + mpq_name;

        ExtractFile(mpq_name.c_str(), filename);
    }

    // extract DBCs
    int count = 0;
    for (std::set<std::string>::iterator iter = dbcfiles.begin(); iter != dbcfiles.end(); ++iter)
    {
        std::string filename = path;
        filename += (iter->c_str() + strlen("DBFilesClient\\"));

        if (ExtractFile(iter->c_str(), filename))
            ++count;
    }
    printf("Extracted %u DBC/DB2 files\n\n", count);
}
开发者ID:BooYoods,项目名称:cmangos-wod,代码行数:44,代码来源:System.cpp


示例12: ExtractScheme

			void						CURI::Parse(const std::string& uri)
			{
				_uri = uri;
				_scheme			= ExtractScheme();
				_directories	= ExtractDirectories();
				_file			= ExtractFile();
				_extension		= ExtractExtension();
				_path			= ExtractPath();
				//_query			= ExtractQuery();
			}
开发者ID:the13620,项目名称:aoofwm-vfs,代码行数:10,代码来源:URI.cpp


示例13: ExtractAction

void ExtractAction(void)
{
    DWORD dwPos;

    dwPos = ListView_GetNextItem(hListView, -1, LVNI_SELECTED);
    if (dwPos == -1)
        MessageBoxA(NULL, "Load a file first", "ERROR", 0);
    else
        ExtractFile(&sFile, dwPos);
}
开发者ID:w4kfu,项目名称:homm3_fun,代码行数:10,代码来源:main.c


示例14: Mix_Linked_Version

bool C4MusicFileSDL::Play(bool loop)
{
	const SDL_version * link_version = Mix_Linked_Version();
	if (link_version->major < 1
	    || (link_version->major == 1 && link_version->minor < 2)
	    || (link_version->major == 1 && link_version->minor == 2 && link_version->patch < 7))
	{
		// Check existance and try extracting it
		if (!FileExists(FileName)) if (!ExtractFile())
				// Doesn't exist - or file is corrupt
			{
				LogF("Error reading %s", FileName);
				return false;
			}
		// Load
		Music = Mix_LoadMUS(SongExtracted ? Config.AtTempPath(C4CFN_TempMusic2) : FileName);
		// Load failed
		if (!Music)
		{
			LogF("SDL_mixer: %s", SDL_GetError());
			return false;
		}
		// Play Song
		if (Mix_PlayMusic(Music, loop? -1 : 1) == -1)
		{
			LogF("SDL_mixer: %s", SDL_GetError());
			return false;
		}
	}
	else
	{
		// Load Song
		// Fixme: Try loading this from the group incrementally for less lag
		size_t filesize;
		if (!C4Group_ReadFile(FileName, &Data, &filesize))
		{
			LogF("Error reading %s", FileName);
			return false;
		}
		// Mix_FreeMusic frees the RWop
		Music = Mix_LoadMUS_RW(SDL_RWFromConstMem(Data, filesize));
		if (!Music)
		{
			LogF("SDL_mixer: %s", SDL_GetError());
			return false;
		}
		if (Mix_PlayMusic(Music, loop? -1 : 1) == -1)
		{
			LogF("SDL_mixer: %s", SDL_GetError());
			return false;
		}
	}
	return true;
}
开发者ID:Meowtimer,项目名称:openclonk,代码行数:54,代码来源:C4MusicFile.cpp


示例15: GetNumItems

			void File::ExtractToFolder( const BString & Folder )
			{
				int iItems = GetNumItems();

				for ( int i = 0; i < iItems; i++ )
				{
					BString FileName = GetFileName( i );
					BString LocalFolder = String::File::GetStripFilename( FileName );
					Bootil::File::CreateFolder( Folder + "/" + LocalFolder );
					ExtractFile( i, Folder + "/" + FileName );
				}
			}
开发者ID:AlVar009,项目名称:bootil,代码行数:12,代码来源:Compression.cpp


示例16: CatalogPage

static void CatalogPage(FILE *ifile, unsigned short page)
{
	TCatalog catalog;
	int i,k,fpos;

	fpos = page * PAGE_LENGTH;
	fseek (ifile, fpos, SEEK_SET);
	k = fread (catalog.page, 1, PAGE_LENGTH, ifile);
	for (i = 0; i < FILEMAP_LENGTH; i++)
	{
		ExtractFile(ifile, catalog.filemap[i]);
	}
}
开发者ID:ngospina,项目名称:SOLOTools,代码行数:13,代码来源:DiskDump.c


示例17: DoJob_Step4

LPCSTR DoJob_Step4 (LPCSTR psz)
{
	if (_dwFlags & FC_ADDBUTTONTOIE)
	{
		char szFile [MAX_PATH];

		

		strcpy (szFile, _szFDMPath);
		strcat (szFile, "fdmcsiebtn.ico");
		psz = ExtractFile (psz, szFile);
	}

	if (_dwFlags & FC_ADDDOWNLOADS)
	{
		DWORD dwDLCount = *((LPDWORD) psz);
		psz += sizeof (DWORD);

		while (dwDLCount--)
		{
			char szURL [10000], szReferer [10000], szComment [10000];
			DWORD dwSize;

			dwSize = *((LPDWORD) psz);
			psz += sizeof (DWORD);
			CopyMemory (szURL, psz, dwSize);
			szURL [dwSize] = 0;
			psz += dwSize;

			dwSize = *((LPDWORD) psz);
			psz += sizeof (DWORD);
			CopyMemory (szReferer, psz, dwSize);
			szReferer [dwSize] = 0;
			psz += dwSize;

			dwSize = *((LPDWORD) psz);
			psz += sizeof (DWORD);
			CopyMemory (szComment, psz, dwSize);
			szComment [dwSize] = 0;
			psz += dwSize;

			BOOL bAutoStart = *((LPBOOL) psz);
			psz += sizeof (BOOL);

			AddURLToDownload (szURL, szReferer, szComment, bAutoStart);
		}
	}

	return psz;
}
开发者ID:DragonZX,项目名称:fdm2,代码行数:50,代码来源:FDMCustomized_PreExe.cpp


示例18: ExtractDBCFiles

void ExtractDBCFiles(int l, bool basicLocale)
{
    printf("Extracting dbc files...\n");

    SFILE_FIND_DATA foundFile;
    memset(&foundFile, 0, sizeof(foundFile));
    HANDLE listFile = SFileFindFirstFile(LocaleMpq, "DBFilesClient\\*dbc", &foundFile, NULL);
    HANDLE dbcFile = NULL;
    uint32 count = 0;
    if (listFile)
    {
        std::string outputPath = output_path;
        outputPath += "/dbc/";

        CreateDir(outputPath);
        if (!basicLocale)
        {
            outputPath += Locales[l];
            outputPath += "/";
            CreateDir(outputPath);
        }

        std::string filename;

        do
        {
            if (!SFileOpenFileEx(LocaleMpq, foundFile.cFileName, SFILE_OPEN_PATCHED_FILE, &dbcFile))
            {
                printf("Unable to open file %s in the archive\n", foundFile.cFileName);
                continue;
            }

            filename = foundFile.cFileName;
            filename = outputPath + filename.substr(filename.rfind('\\') + 1);

            if (FileExists(filename.c_str()))
                continue;

            if (ExtractFile(dbcFile, filename.c_str()))
                ++count;

            SFileCloseFile(dbcFile);
        } while (SFileFindNextFile(listFile, &foundFile));

        SFileFindClose(listFile);
    }

    printf("Extracted %u DBC files\n\n", count);
}
开发者ID:Agyla,项目名称:ArkCORE4,代码行数:49,代码来源:System.cpp


示例19: ExtractCameraFiles

void ExtractCameraFiles(int locale, bool basicLocale)
{
    printf("Extracting camera files...\n");
    DBCFile camdbc("DBFilesClient\\CinematicCamera.dbc");

    if (!camdbc.open())
    {
        printf("Unable to open CinematicCamera.dbc. Camera extract aborted.\n");
        return;
    }

    // get camera file list from DBC
    std::vector<std::string> camerafiles;
    size_t cam_count = camdbc.getRecordCount();

    for (size_t i = 0; i < cam_count; ++i)
    {
        std::string camFile(camdbc.getRecord(i).getString(1));
        size_t loc = camFile.find(".mdx");
        if (loc != std::string::npos)
            camFile.replace(loc, 4, ".m2");
        camerafiles.push_back(std::string(camFile));
    }

    std::string path = output_path;
    path += "/Cameras/";
    CreateDir(path);
    if (!basicLocale)
    {
        path += langs[locale];
        path += "/";
        CreateDir(path);
    }

    // extract M2s
    uint32 count = 0;
    for (std::string thisFile : camerafiles)
    {
        std::string filename = path;
        filename += (thisFile.c_str() + strlen("Cameras\\"));

        if (boost::filesystem::exists(filename))
            continue;

        if (ExtractFile(thisFile.c_str(), filename))
            ++count;
    }
    printf("Extracted %u camera files\n", count);
}
开发者ID:martial69320,项目名称:cerberus,代码行数:49,代码来源:System.cpp


示例20:

BOOL C4MusicFileMID::Play(BOOL loop)
	{

	// check existance
	if(!FileExists(FileName))
		// try extracting it
		if(!ExtractFile())
			// doesn't exist - or file is corrupt
			return FALSE;

	// Play Song
	PlayMidi(SongExtracted ? Config.AtTempPath(C4CFN_TempMusic2) : FileName, Application.hWindow);

	return TRUE;
	}
开发者ID:Marko10-000,项目名称:clonk-rage,代码行数:15,代码来源:C4MusicFile.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ ExtractFileName函数代码示例发布时间:2022-05-30
下一篇:
C++ ExtractDestination函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap