本文整理汇总了C++中AString::FilePart方法的典型用法代码示例。如果您正苦于以下问题:C++ AString::FilePart方法的具体用法?C++ AString::FilePart怎么用?C++ AString::FilePart使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AString
的用法示例。
在下文中一共展示了AString::FilePart方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetFileInfo
bool GetFileInfo(const AString& FileName, FILE_INFO *file)
{
struct dirent ent;
strcpy(ent.d_name, FileName.FilePart());
return SetFileData(FileName.PathPart(), ent, file);
}
示例2: CreateDirectory
bool CreateDirectory(const AString& dir)
{
AString parentdir = dir.PathPart();
FILE_INFO file;
bool success = true;
if (parentdir.Valid() && (parentdir != "/") && !::GetFileInfo(parentdir, &file)) success = CreateDirectory(parentdir);
if (success && (dir.FilePart().Valid()) && !::GetFileInfo(dir, &file)) {
#ifdef __LINUX__
success = (mkdir(dir, S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IWGRP | S_IXGRP | S_IROTH | S_IWOTH | S_IXOTH) == 0);
#else
success = ::CreateDirectoryA(dir.str(), NULL);
#endif
}
return success;
}
示例3: ListUsers
void ADVBConfig::ListUsers(AList& list) const
{
AHash users(10);
AList userpatterns;
AString filepattern = GetUserPatternsPattern();
AString filepattern_parsed = ParseRegex(filepattern);
AString _users = GetConfigItem("users");
AStdFile fp;
uint_t i, n = _users.CountColumns();
//debug("Reading users from config %s\n", config.GetFilename().str());
for (i = 0; i < n; i++) {
AString user = _users.Column(i).Words(0);
if (!users.Exists(user)) {
users.Insert(user, 0);
list.Add(new AString(user));
}
}
if (fp.open(GetPatternsFile())) {
AString line;
while (line.ReadLn(fp) >= 0) {
AString user;
int p;
if ((p = line.PosNoCase(" user:=")) >= 0) user = line.Mid(p + 7).Word(0).DeQuotify();
else if (line.PosNoCase("user:=") == 0) user = line.Mid(6).Word(0).DeQuotify();
if (user.Valid() && !users.Exists(user)) {
users.Insert(user, 0);
list.Add(new AString(user));
}
}
fp.close();
}
::CollectFiles(filepattern.PathPart(), filepattern.FilePart(), 0, userpatterns);
const AString *file = AString::Cast(userpatterns.First());
while (file) {
AString user;
ADataList regions;
if (MatchRegex(*file, filepattern_parsed, regions)) {
const REGEXREGION *region = (const REGEXREGION *)regions[0];
if (region) {
user = file->Mid(region->pos, region->len);
if (!users.Exists(user)) {
users.Insert(user, 0);
list.Add(new AString(user));
}
}
}
file = file->Next();
}
list.Sort(&AString::AlphaCompareCase);
}
示例4: Recurse
bool Recurse(const AString& PathPattern, uint_t nSubDirs, bool (*fn)(const FILE_INFO *file, void *Context), void *Context)
{
return ::Recurse(PathPattern.PathPart(), PathPattern.FilePart(), nSubDirs, fn, Context);
}