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


C++ Filename::GetFile方法代码示例

本文整理汇总了C++中Filename::GetFile方法的典型用法代码示例。如果您正苦于以下问题:C++ Filename::GetFile方法的具体用法?C++ Filename::GetFile怎么用?C++ Filename::GetFile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Filename的用法示例。


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

示例1: AssertPathExists

Bool AssertPathExists(const Filename &fn)
{
	if (GeFExist(fn, true))
		return true;

	CFilenameArray pfnDir;
	Filename fnDir = fn;
	Bool bRet = false;
	Int32 a;
	Filename** ppfn;

	while (!GeFExist(fnDir, true))
	{
		Filename* pfn = pfnDir.InsertAt(0);
		if (!pfn)
			goto _error;
		*pfn = fnDir.GetFile();
		fnDir = fnDir.GetDirectory();
		if (!fnDir.Content())
		{
			return false;
		}
	}

	ppfn = pfnDir.GetArray()->GetArray();
	for (a = 0; a < pfnDir.GetElementCount(); a++)
	{
		fnDir += fnDir + *(ppfn[a]);
		if (GeFExist(fnDir, true))
			continue;
		if (!GeFCreateDir(fnDir))
			goto _error;
	}

	bRet = true;
_error:
	return bRet;
}
开发者ID:nr-plugins,项目名称:resedit,代码行数:38,代码来源:globals.cpp

示例2: ReadPreset

Bool ReadPreset(const Filename& fnPreset)
{
	AutoAlloc <BaseFile> pFile;
	if (!pFile)
		return false;

	Filename fnTemp;
	PresetElement* pPreset;
	String strName;
	Int32 n;
	CDynamicArray <char> arLine;
	char* pszLine;
	Bool bHeaderRead = false;
	String str;

	fnTemp = fnPreset.GetFile();
	fnTemp.ClearSuffix();
	strName = fnTemp.GetString();
	bHeaderRead = false;

	for (n = 0; n < g_Presets.GetElementCount(); n++)
	{
		if (g_Presets[n]->strName == strName)
			break;
	}
	if (n != g_Presets.GetElementCount())
		return false;

	pPreset = g_Presets.GetNextObject();
	if (!pPreset)
		return false;

	pPreset->strName = strName;
	if (!pFile->Open(fnPreset))
		return false;

	while (ReadLine(pFile, arLine))
	{
		pszLine = arLine.GetArray();

		if (!bHeaderRead)
		{
			if (strstr(pszLine, FILE_HEADER) == pszLine)
			{
				bHeaderRead = true;
				continue;
			}
		}
		if (!bHeaderRead)
			break;

		while (*pszLine != '\0')
		{
			if (strstr(pszLine, ORIG_PATH) == pszLine)
			{
				pszLine += strlen(ORIG_PATH);
				ReadString(pszLine, pPreset->strOrigin);
			}
			if (strstr(pszLine, DEST_PATH) == pszLine)
			{
				pszLine += strlen(DEST_PATH);
				ReadString(pszLine, pPreset->strDestination);
			}
			if (strstr(pszLine, CREATE_ZIP) == pszLine)
			{
				pszLine += strlen(CREATE_ZIP);
				ReadBool(pszLine, pPreset->bCreateZipFile);
			}
			if (strstr(pszLine, CREATE_ZIP_COMPRESSION) == pszLine)
			{
				pszLine += strlen(CREATE_ZIP_COMPRESSION);
				ReadInt32(pszLine, pPreset->lCreateZipCompressionLevel);
			}
			if (strstr(pszLine, CHECK_VERSION) == pszLine)
			{
				pszLine += strlen(CHECK_VERSION);
				ReadBool(pszLine, pPreset->bCheckVersion);
			}
			if (strstr(pszLine, PARSE_SYMBOLS) == pszLine)
			{
				pszLine += strlen(PARSE_SYMBOLS);
				ReadBool(pszLine, pPreset->bParseSymbols);
			}
			if (strstr(pszLine, WRITE_BUILD) == pszLine)
			{
				pszLine += strlen(WRITE_BUILD);
				ReadBool(pszLine, pPreset->bWriteBuildInfo);
			}
			if (strstr(pszLine, REMOVE_SCC) == pszLine)
			{
				pszLine += strlen(REMOVE_SCC);
				ReadBool(pszLine, pPreset->bRemoveSCC);
			}
			if (strstr(pszLine, BATCH) == pszLine)
			{
				pszLine += strlen(BATCH);
				ReadBool(pszLine, pPreset->bBatch);
			}
			if (strstr(pszLine, PASSWORD) == pszLine)
			{
//.........这里部分代码省略.........
开发者ID:phohale,项目名称:ResEdit,代码行数:101,代码来源:Distri.cpp

示例3: WriteExportFile

void ApplinkExporter::WriteExportFile(BaseContainer* bc, PolygonObject* ob, BaseFile* objfile, ExportObject& mObject, LONG vcnt, LONG pcnt)
{
	const CPolygon* padr = ob->GetPolygonR();
	Bool expUV = bc->GetBool(IDC_CHK_EXP_UV);
	Bool expMat = bc->GetBool(IDC_CHK_EXP_MAT);
	String str;

	if(expMat && materialArray.GetCount() > 0)
	{
		Filename fileMatObj;
		fileMatObj.SetFile(GetActiveDocument()->GetDocumentName());
		fileMatObj.SetSuffix("mtl");

		str = "mtllib " + fileMatObj.GetFile().GetString() + "\n";
		this->WriteString(str, objfile);
		this->WriteEndLine(objfile);
	}

	str = "g " + ob->GetName() + "\n";
	this->WriteString(str, objfile);
	this->WriteEndLine(objfile);

	// vertex positions
	ApplinkExporter::WriteVertexPositions(objfile, mObject, vcnt);
	//UV
	if(expUV)
		ApplinkExporter::WriteUVWTag(objfile, mObject, pcnt, padr);

	//Polygon faces v/vt/vn (v//vn)
	str = "# begin " + LongToString(pcnt) + " faces\n";
	this->WriteString(str, objfile);

	LONG y=0;
	String prevMat = "", currMat = "";

	for (LONG i = 0; i < pcnt; i++)
	{
		if(expMat && materialArray.GetCount() > 0)
		{
			currMat = mObject.tempMats[mObject.pmatidxArray[i]]->GetName();
			if(currMat != prevMat)
			{
				str = "usemtl " + currMat + "\n";
				this->WriteString(str, objfile);
				prevMat = currMat;
			}
		}

		//GePrint("Polygon[" + LongToString(i) + "] " + LongToString(vadr[i].a) + ", " + LongToString(vadr[i].b) + ", " + LongToString(vadr[i].c) + ", " + LongToString(vadr[i].d));
		str = "f";
		//GePrint("poly vertices: " + LongToString(mObject.Fpvnb[i]));
		for(LONG j = 0; j < mObject.Fpvnb[i]; j++)
		{			
			str += " ";
			str += LongToString(mObject.Fv[y+j] + 1 + vpcnt);

			if(expUV && mObject.Fvt.GetCount() > 0)
			{
				str += "/";
				str += LongToString(mObject.Fvt[y+j] + 1 + vtcnt);
			}
		}

		str += "\n";
		//GePrint("str = " + str);
		this->WriteString(str, objfile);
		y += mObject.Fpvnb[i];
	}

	str = "# end " + LongToString(pcnt) + " faces\n";
	this->WriteString(str, objfile);
	this->WriteEndLine(objfile);
}
开发者ID:oyaGG,项目名称:3DCoat_Applinks,代码行数:73,代码来源:ApplinkExporter.cpp

示例4: AddFilename

void AddFilename(Filename &fn, const Filename fnDest)
{
	if (!fnDest.Content())
		return;
	AddFilename1(fn, fnDest.GetDirectory(), fnDest.GetFile());
}
开发者ID:nr-plugins,项目名称:resedit,代码行数:6,代码来源:globals.cpp

示例5: AddFilename1

void AddFilename1(Filename &fn, const Filename fnDir, const Filename fnFile)
{
	if (fnDir.Content())
		AddFilename1(fn, fnDir.GetDirectory(), fnDir.GetFile());
	fn += fnFile;
}
开发者ID:nr-plugins,项目名称:resedit,代码行数:6,代码来源:globals.cpp


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