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


C++ AString::CatPath方法代码示例

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


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

示例1: SetFileData

static bool SetFileData(const AString& path, const struct dirent& finddata, FILE_INFO *file)
{
	struct stat statdata;
	bool success = false;

	file->FileName  = path.CatPath(finddata.d_name);
	file->ShortName = file->FileName.FilePart();
	file->Attrib    = 0;

	if (stat(file->FileName, &statdata) == 0) {
		file->FileSize = statdata.st_size;
		file->CreateTime.fromtime(statdata.st_mtime);
		file->AccessTime.fromtime(statdata.st_atime);
		file->WriteTime.fromtime(statdata.st_mtime);
		
		if (statdata.st_mode & S_IRUSR) file->Attrib |= FILE_FLAG_READABLE;
		if (statdata.st_mode & S_IWUSR) file->Attrib |= FILE_FLAG_WRITABLE;
		if (statdata.st_mode & S_IXUSR) file->Attrib |= FILE_FLAG_EXECUTABLE;
		
		if (statdata.st_mode & S_IRGRP) file->Attrib |= FILE_FLAG_READABLE << 3;
		if (statdata.st_mode & S_IWGRP) file->Attrib |= FILE_FLAG_WRITABLE << 3;
		if (statdata.st_mode & S_IXGRP) file->Attrib |= FILE_FLAG_EXECUTABLE << 3;
		
		if (statdata.st_mode & S_IROTH) file->Attrib |= FILE_FLAG_READABLE << 6;
		if (statdata.st_mode & S_IWOTH) file->Attrib |= FILE_FLAG_WRITABLE << 6;
		if (statdata.st_mode & S_IXOTH) file->Attrib |= FILE_FLAG_EXECUTABLE << 6;
		
		if (S_ISDIR(statdata.st_mode))  file->Attrib |= FILE_FLAG_IS_DIR;

		success = true;
	}

	return success;
}
开发者ID:,项目名称:,代码行数:34,代码来源:

示例2: CollectFiles

bool CollectFiles(const AString& Path, const AString& Pattern, uint_t nSubdirs, AList& list, uint16_t attribMask, uint16_t attribCmp, AQuitHandler *pQuitHandler)
{
	COLLECT_CONTEXT context;

	context.Pattern 	  = ParsePathRegex(Pattern);
	context.pList   	  = &list;
	context.pQuitHandler  = pQuitHandler;
	context.AttribMask    = attribMask;
	context.AttribCompare = attribCmp;
	context.bAnyName      = IsRegexAnyPattern(context.Pattern);

	return ::Recurse(Path.CatPath("*"), nSubdirs, &__CollectFiles, &context);
}
开发者ID:,项目名称:,代码行数:13,代码来源:

示例3: CollectFilesEx

bool CollectFilesEx(const AString& Path, const AString& Pattern, uint_t nSubdirs, AList& list, uint_t sortFlags, uint16_t attribSet, uint16_t attribClr, AQuitHandler *pQuitHandler)
{
	COLLECTEX_CONTEXT context;

	context.Pattern 	  = ParsePathRegex(Pattern);
	context.pList   	  = &list;
	context.pQuitHandler  = pQuitHandler;
	context.AttribSet     = attribSet;
	context.AttribClr	  = attribClr;
	context.bAnyName      = IsRegexAnyPattern(context.Pattern);
	context.CmpFunc		  = AFileNode::GetSortFunction(sortFlags);
	context.CmpFlags	  = sortFlags;

	return ::Recurse(Path.CatPath("*"), nSubdirs, &__CollectFilesEx, &context);
}
开发者ID:,项目名称:,代码行数:15,代码来源:

示例4: Recurse

bool Recurse(const AString& Path, const AString& Pattern, uint_t nSubDirs, bool (*fn)(const FILE_INFO *file, void *Context), void *Context)
{
	WIN32_FIND_DATA finddata;
	AString   pattern, pattern1 = ParsePathRegex(Pattern);
	FILE_INFO file;
	HANDLE    handle;
	bool      ok = true, any = IsRegexAnyPattern(pattern1);

	pattern = Path.CatPath("*");
	if ((handle = ::FindFirstFile(pattern, &finddata)) != INVALID_HANDLE_VALUE) {
		do {
			SetFileData(Path, finddata, &file);

			if ((file.ShortName != ".") && (file.ShortName != "..")) {
				bool done = false;

				if (any || MatchPathRegex(file.ShortName, pattern1)) {
					ok = (*fn)(&file, Context);
					if (!ok) break;
					done = true;
				}
				if ((nSubDirs > 0) && (file.Attrib & FILE_FLAG_IS_DIR)) {
					if (!done) {
						ok = (*fn)(&file, Context);
						if (!ok) break;
					}

					ok = Recurse(file.FileName, Pattern, nSubDirs - 1, fn, Context);
					if (!ok) break;
				}
			}
		} while (ok && ::FindNextFile(handle, &finddata));

		::FindClose(handle);
	}

	return ok;
}
开发者ID:,项目名称:,代码行数:38,代码来源:

示例5: CatPath

AString CatPath(const AString& dir1, const AString& dir2)
{
	if (dir2[0] != '/') return dir1.CatPath(dir2);

	return dir2;
}
开发者ID:richardxday,项目名称:rddvb,代码行数:6,代码来源:dvbmisc.cpp


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