From c767dbc30277d0c3cf4475d729b8465f9d85b8c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Vollst=C3=A4dt?= Date: Mon, 5 Sep 2011 03:02:15 +0200 Subject: [PATCH] Added a new helper function for getting a relative-to-repostory path --- SparkleLib/SparkleHelpers.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/SparkleLib/SparkleHelpers.cs b/SparkleLib/SparkleHelpers.cs index 741648d7..9a00fef3 100644 --- a/SparkleLib/SparkleHelpers.cs +++ b/SparkleLib/SparkleHelpers.cs @@ -17,6 +17,7 @@ using System; using System.IO; +using System.Text.RegularExpressions; namespace SparkleLib { @@ -76,5 +77,10 @@ namespace SparkleLib { DateTime unix_epoch = new DateTime (1970, 1, 1, 0, 0, 0, 0); return unix_epoch.AddSeconds (timestamp); } + + // Gets the relative path of two hirarchical absolute paths + public static string DiffPaths(string target, string source) { + return target.Replace(source + Path.DirectorySeparatorChar, ""); + } } }