mirror of https://github.com/mono/CppSharp.git
c-sharpdotnetmonobindingsbridgecclangcpluspluscppsharpglueinteropparserparsingpinvokeswigsyntax-treevisitorsxamarinxamarin-bindings
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
1.0 KiB
34 lines
1.0 KiB
using System; |
|
using System.Collections.Generic; |
|
using System.IO; |
|
|
|
public static class Glob |
|
{ |
|
static public string[] GetFiles(string[] patterns) |
|
{ |
|
List<string> filelist = new List<string>(); |
|
foreach (string pattern in patterns) |
|
filelist.AddRange(GetFiles(pattern)); |
|
string[] files = new string[filelist.Count]; |
|
filelist.CopyTo(files, 0); |
|
return files; |
|
} |
|
|
|
static public string[] GetFiles(string patternlist) |
|
{ |
|
List<string> filelist = new List<string>(); |
|
foreach (string pattern in |
|
patternlist.Split(Path.GetInvalidPathChars())) |
|
{ |
|
string dir = Path.GetDirectoryName(pattern); |
|
if (String.IsNullOrEmpty(dir)) dir = |
|
Directory.GetCurrentDirectory(); |
|
filelist.AddRange(Directory.GetFiles( |
|
Path.GetFullPath(dir), |
|
Path.GetFileName(pattern))); |
|
} |
|
string[] files = new string[filelist.Count]; |
|
filelist.CopyTo(files, 0); |
|
return files; |
|
} |
|
} |