From 1ad7481136c7bb2f1e16082ead8bc9cf0e6c8391 Mon Sep 17 00:00:00 2001 From: marcos henrich Date: Sun, 6 Apr 2014 16:10:38 +0100 Subject: [PATCH] Added properties FileRelativeDirectory and FileRelativePath to TranslationUnit. --- src/AST/TranslationUnit.cs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/AST/TranslationUnit.cs b/src/AST/TranslationUnit.cs index ac8f9316..1e1d36c0 100644 --- a/src/AST/TranslationUnit.cs +++ b/src/AST/TranslationUnit.cs @@ -57,5 +57,23 @@ namespace CppSharp.AST /// Contains the include path. public string IncludePath; + + public string FileRelativeDirectory + { + get + { + var path = IncludePath.Replace('\\', '/'); + var index = path.LastIndexOf('/'); + return path.Substring(0, index); + } + } + + public string FileRelativePath + { + get + { + return Path.Combine(FileRelativeDirectory, FileName); + } + } } } \ No newline at end of file