Changeset View
Changeset View
Standalone View
Standalone View
source/lib/file/vfs/vfs_util.cpp
/* Copyright (C) 2015 Wildfire Games. | /* Copyright (C) 2019 Wildfire Games. | ||||
* | * | ||||
* Permission is hereby granted, free of charge, to any person obtaining | * Permission is hereby granted, free of charge, to any person obtaining | ||||
* a copy of this software and associated documentation files (the | * a copy of this software and associated documentation files (the | ||||
* "Software"), to deal in the Software without restriction, including | * "Software"), to deal in the Software without restriction, including | ||||
* without limitation the rights to use, copy, modify, merge, publish, | * without limitation the rights to use, copy, modify, merge, publish, | ||||
* distribute, sublicense, and/or sell copies of the Software, and to | * distribute, sublicense, and/or sell copies of the Software, and to | ||||
* permit persons to whom the Software is furnished to do so, subject to | * permit persons to whom the Software is furnished to do so, subject to | ||||
* the following conditions: | * the following conditions: | ||||
Show All 28 Lines | |||||
namespace vfs { | namespace vfs { | ||||
Status GetPathnames(const PIVFS& fs, const VfsPath& path, const wchar_t* filter, VfsPaths& pathnames) | Status GetPathnames(const PIVFS& fs, const VfsPath& path, const wchar_t* filter, VfsPaths& pathnames) | ||||
{ | { | ||||
std::vector<CFileInfo> files; | std::vector<CFileInfo> files; | ||||
RETURN_STATUS_IF_ERR(fs->GetDirectoryEntries(path, &files, 0)); | RETURN_STATUS_IF_ERR(fs->GetDirectoryEntries(path, &files, 0)); | ||||
pathnames.clear(); | |||||
pathnames.reserve(files.size()); | pathnames.reserve(files.size()); | ||||
for(size_t i = 0; i < files.size(); i++) | for(size_t i = 0; i < files.size(); i++) | ||||
{ | { | ||||
if(match_wildcard(files[i].Name().string().c_str(), filter)) | if(match_wildcard(files[i].Name().string().c_str(), filter)) | ||||
pathnames.push_back(path / files[i].Name()); | pathnames.push_back(path / files[i].Name()); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 85 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator