Esempio n. 1
0
        public static string FolderFromBaseSrcFolder(this CppSourceSpan cppSpan, string baseSrcFolder)
        {
            var path = cppSpan.FilePath();

            if (cppSpan.FilePath().IndexOf(baseSrcFolder) == -1)
            {
                return(Path.GetFileName(Path.GetDirectoryName(path)));
            }
            return(Path.GetDirectoryName(path.Substring(path.IndexOf(baseSrcFolder) + baseSrcFolder.Length + 1)));
        }
Esempio n. 2
0
        public static void CopyTo(this CppSourceSpan cppSpan, Config config)
        {
            var dst = Path.Combine(config.DstDir, "thirdparty", config.BaseSourceFolder, cppSpan.FolderFromBaseSrcFolder(config.BaseSourceFolder));

            // we could have a header outside of our BaseSourceFolder. in that case stick it in a folder in thirdparty
            if (cppSpan.FilePath().IndexOf(config.BaseSourceFolder) == -1)
            {
                dst = Path.Combine(config.DstDir, "thirdparty", cppSpan.FolderFromBaseSrcFolder(config.BaseSourceFolder));
            }
            Directory.CreateDirectory(dst);

            File.Copy(cppSpan.FilePath(), Path.Combine(dst, cppSpan.Filename()), true);
        }
Esempio n. 3
0
 public static string Folder(this CppSourceSpan cppSpan)
 {
     return(Path.GetFileName(Path.GetDirectoryName(cppSpan.FilePath())));
 }
Esempio n. 4
0
 public static string Filename(this CppSourceSpan cppSpan)
 {
     return(Path.GetFileName(cppSpan.FilePath()));
 }