Anonymous avatar Anonymous committed 9754e27

Adding possibility to list only new tags in ods file.

Comments (0)

Files changed (6)

Binary file added.

Binary file added.

resman.tests/TestLineOptions.cs

+
+using System;
+using NUnit.Framework;
+using resman.ResourceModels;
+using resman.ResourceSearcher;
+
+namespace resman.Tests
+{
+	[TestFixture]
+	public class TestLineOptions
+	{
+	    [Test]
+	    public void Simple()
+	    {
+	        Assert.AreEqual(LineOptionsEnum.Append, LineOptions.ConvertToEnum("  random  "));
+	        Assert.AreEqual(LineOptionsEnum.Ignore, LineOptions.ConvertToEnum("    i "));
+	        
+	        
+	        Assert.AreEqual(LineOptionsEnum.Remove, LineOptions.ConvertToEnum("  d "));
+	    }
+	}
+}

resman.tests/TestsData/ResourceModels/TableReaderOdt/AppendRemove/.~lock.appendremove.ods#

-,OBIRK/ltdda,PC-VIL14.obirk.com,21.12.2009 10:04,file:///C:/Documents%20and%20Settings/ltdda/Application%20Data/OpenOffice.org/3;

resman/ResourceModels/LineOptions.cs

-
-using System;
-
-namespace resman.ResourceModels
-{
-	public enum LineOptions
-	{
-	    Append,
-	    Remove,
-	    Ignore
-	}
-}

resman/ResourceModels/LineOptionsEnum.cs

+
+using System;
+
+namespace resman.ResourceModels
+{
+    public class LineOptions
+    {
+        public static LineOptionsEnum ConvertToEnum(string text)
+        {
+            text = text.ToLower().Trim();
+            if (text.Equals("+"))
+                return LineOptionsEnum.Append;
+            if (text.Equals("-"))
+                return LineOptionsEnum.Remove;
+            if (text.Equals("m"))
+                return LineOptionsEnum.Append;
+            if (text.Equals("i"))
+                return LineOptionsEnum.Ignore;
+            if (text.Equals("d"))
+                return LineOptionsEnum.Remove;
+            return LineOptionsEnum.Append;
+        }
+    }
+    
+    public enum LineOptionsEnum
+    {
+        Append,
+        Remove,
+        Ignore
+    }
+}
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.