From a2d1a5d6585fcb91ccaf54d9aa68cce61cbf80f8 Mon Sep 17 00:00:00 2001 From: Francisco Biagi Date: Fri, 12 Oct 2018 16:56:33 -0300 Subject: [PATCH 01/26] fix test with wrong file output path --- Test.SpssLib/TestSpssWriter.cs | 55 ++++++++++++++++++++-------------- 1 file changed, 32 insertions(+), 23 deletions(-) diff --git a/Test.SpssLib/TestSpssWriter.cs b/Test.SpssLib/TestSpssWriter.cs index e3d159d..98e4697 100644 --- a/Test.SpssLib/TestSpssWriter.cs +++ b/Test.SpssLib/TestSpssWriter.cs @@ -338,37 +338,37 @@ public void TestNoVarnameException() [TestMethod] public void TestWriteDoubleLongStringVar() { - var filename = @"c:\temp\testWriteDoubleLongString.sav"; + var filename = @"testWriteDoubleLongString.sav"; using (FileStream fileStream = new FileStream(filename, FileMode.Create, FileAccess.Write)) { var var1 = new Variable("stringvar_01") - { - Label = "This is a string variable", - Type = DataType.Text, - Width = 50, - TextWidth = 5000 - }; + { + Label = "This is a string variable", + Type = DataType.Text, + Width = 50, + TextWidth = 5000 + }; var var2 = new Variable("stringvar_02") - { - Label = "This is a string variable", - PrintFormat = new OutputFormat(FormatType.A, 60), - WriteFormat = new OutputFormat(FormatType.A, 70), - Type = DataType.Text, - Width = 50, - TextWidth = 5000 - }; + { + Label = "This is a string variable", + PrintFormat = new OutputFormat(FormatType.A, 60), + WriteFormat = new OutputFormat(FormatType.A, 70), + Type = DataType.Text, + Width = 50, + TextWidth = 5000 + }; var var3 = new Variable("stringvar_03") - { - Label = "This is a string variable", - PrintFormat = new OutputFormat(FormatType.A, 60), - WriteFormat = new OutputFormat(FormatType.A, 70), - Type = DataType.Text, - Width = 50, - TextWidth = 5000 - }; + { + Label = "This is a string variable", + PrintFormat = new OutputFormat(FormatType.A, 60), + WriteFormat = new OutputFormat(FormatType.A, 70), + Type = DataType.Text, + Width = 50, + TextWidth = 5000 + }; var var4 = new Variable("stringvar_04") { @@ -420,6 +420,15 @@ public void TestWriteDoubleLongStringVar() writer.EndFile(); } } + + FileStream readFileStream = new FileStream(filename, FileMode.Open, FileAccess.Read, + FileShare.Read, 2048 * 10, FileOptions.SequentialScan); + + int varCount, rowCount; + TestSpssReader.ReadData(readFileStream, out varCount, out rowCount); + + Assert.AreEqual(varCount, 6, "Variable count does not match"); + Assert.AreEqual(rowCount, 1, "Rows count does not match"); } private static void ReadFile(string filename, out int varCount, out int rowCount) From e3d68ae759fdfa32df8e77bc056e47345ff97de9 Mon Sep 17 00:00:00 2001 From: Andrei Vinogradov Date: Thu, 20 Feb 2020 13:07:57 +0300 Subject: [PATCH 02/26] SPSSLib ported to Net.Standard v2.0 --- SpssLib/Properties/AssemblyInfo.cs | 35 -- SpssLib/SpssLib.csproj | 73 +--- SpssLib/SpssLib.nuspec | 18 - Test.SpssLib/Properties/AssemblyInfo.cs | 36 -- Test.SpssLib/Test.SpssLib.csproj | 111 ++---- Test.SpssLib/TestSpssCopy.cs | 12 +- Test.SpssLib/TestSpssReader.cs | 72 ++-- Test.SpssLib/TestSpssWriter.cs | 445 ++++++++++++------------ 8 files changed, 313 insertions(+), 489 deletions(-) delete mode 100644 SpssLib/Properties/AssemblyInfo.cs delete mode 100644 SpssLib/SpssLib.nuspec delete mode 100644 Test.SpssLib/Properties/AssemblyInfo.cs diff --git a/SpssLib/Properties/AssemblyInfo.cs b/SpssLib/Properties/AssemblyInfo.cs deleted file mode 100644 index 6f20d7b..0000000 --- a/SpssLib/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("SPSS / PSPP data file .net library")] -[assembly: AssemblyDescription("A library for reading and writing .sav files")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("TNS")] -[assembly: AssemblyProduct("Sav")] -[assembly: AssemblyCopyright("")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("c60f91c7-9db3-4f60-b911-166431fcbdaf")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.1.5")] diff --git a/SpssLib/SpssLib.csproj b/SpssLib/SpssLib.csproj index 82950bd..d9023c0 100644 --- a/SpssLib/SpssLib.csproj +++ b/SpssLib/SpssLib.csproj @@ -1,50 +1,20 @@ - - + + - Debug - AnyCPU - 8.0.30703 - 2.0 - {A1736F6F-1A98-48E5-BB4B-377703A53AA5} - Library - Properties + netstandard2.0 + SPSS / PSPP data file .net library + TNS / SIISLtd + A library for reading and writing .sav files + https://github.com/SIIS-Ltd/SPSS-.NET-Reader + git + siisltd; infrastructure; utils; sav; spss; spsslib + https://github.com/SIIS-Ltd/SPSS-.NET-Reader/releases + 1.1.5 + 1.0.0 + 1.1.5 SpssLib - SpssLib - v4.0 - 512 - - - SAK - SAK - SAK - SAK - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - BasicDesignGuidelineRules.ruleset - false - AnyCPU - bin\Debug\SpssLib.XML - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - bin\Release\SpssLib.XML - - - - - + @@ -96,16 +66,5 @@ - - - - - - - \ No newline at end of file + + diff --git a/SpssLib/SpssLib.nuspec b/SpssLib/SpssLib.nuspec deleted file mode 100644 index 61b884f..0000000 --- a/SpssLib/SpssLib.nuspec +++ /dev/null @@ -1,18 +0,0 @@ - - - - $id$ - 1.1.5 - $title$ - Roeland Nieuwenhuis, Francisco Biagi - $author$ - https://raw.githubusercontent.com/TNSGlobal/SPSS-.NET-Reader/master/LICENSE - https://github.com/TNSGlobal/SPSS-.NET-Reader - http://www.tnsglobal.com/sites/default/files/tns-logo.jpg - false - $description$ - Allows you to read, write and manipulate SPSS files while being UTF save. Combat tested extensively within the TNS organization. - https://github.com/TNSGlobal/SPSS-.NET-Reader/releases - SPSS PSPP SAV - - \ No newline at end of file diff --git a/Test.SpssLib/Properties/AssemblyInfo.cs b/Test.SpssLib/Properties/AssemblyInfo.cs deleted file mode 100644 index f43d608..0000000 --- a/Test.SpssLib/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Test.SpssLib")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Microsoft")] -[assembly: AssemblyProduct("Test.SpssLib")] -[assembly: AssemblyCopyright("Copyright © Microsoft 2013")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("c96c942b-32e8-4101-b259-5ecf7cee8194")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Test.SpssLib/Test.SpssLib.csproj b/Test.SpssLib/Test.SpssLib.csproj index 2c4adf8..7e96a71 100644 --- a/Test.SpssLib/Test.SpssLib.csproj +++ b/Test.SpssLib/Test.SpssLib.csproj @@ -1,77 +1,36 @@ - - - - - Debug - AnyCPU - {5BED743E-E23F-4F0D-9E44-94B90FE8DF75} - Library - Properties - Test.SpssLib - Test.SpssLib - v4.0 - 512 - - SAK - SAK - SAK - SAK - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - - - - {a1736f6f-1a98-48e5-bb4b-377703a53aa5} - SpssLib - - - - - - - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - - + + + + netcoreapp2.2 + + false + + 7.3 + + + + + + + all + runtime; build; native; contentfiles; analyzers + + + + + + + + + + + Always + + + Always + + + Always + + \ No newline at end of file diff --git a/Test.SpssLib/TestSpssCopy.cs b/Test.SpssLib/TestSpssCopy.cs index edd5101..9d5945e 100644 --- a/Test.SpssLib/TestSpssCopy.cs +++ b/Test.SpssLib/TestSpssCopy.cs @@ -1,22 +1,20 @@ using System.IO; -using Microsoft.VisualStudio.TestTools.UnitTesting; using SpssLib.DataReader; +using Xunit; namespace Test.SpssLib { - [TestClass] public class TestSpssCopy { - [TestMethod] - [DeploymentItem(@"TestFiles\cakespss1000similarvars.sav")] + [Fact] public void TestCopyFile() { using (FileStream fileStream = - new FileStream("cakespss1000similarvars.sav", FileMode.Open, + new FileStream("TestFiles/cakespss1000similarvars.sav", FileMode.Open, FileAccess.Read, FileShare.Read, 2048 * 10, FileOptions.SequentialScan)) { - using (FileStream writeStream = new FileStream("ourcake1000similarvars.sav", FileMode.Create, FileAccess.Write)) + using (FileStream writeStream = new FileStream("TestFiles/ourcake1000similarvars.sav", FileMode.Create, FileAccess.Write)) { SpssReader spssDataset = new SpssReader(fileStream); @@ -31,7 +29,7 @@ public void TestCopyFile() spssWriter.EndFile(); } } - Assert.IsTrue(true); // To check errors, set to False and open the file + Assert.True(true); // To check errors, set to False and open the file } } } \ No newline at end of file diff --git a/Test.SpssLib/TestSpssReader.cs b/Test.SpssLib/TestSpssReader.cs index d4283e5..5937371 100644 --- a/Test.SpssLib/TestSpssReader.cs +++ b/Test.SpssLib/TestSpssReader.cs @@ -2,21 +2,19 @@ using System.Collections.Generic; using System.Diagnostics; using System.IO; -using Microsoft.VisualStudio.TestTools.UnitTesting; using SpssLib.DataReader; using SpssLib.FileParser; using SpssLib.SpssDataset; +using Xunit; namespace Test.SpssLib { - [TestClass] public class TestSpssReader { - [TestMethod] - [DeploymentItem(@"TestFiles\test.sav")] + [Fact] public void TestReadFile() { - FileStream fileStream = new FileStream("test.sav", FileMode.Open, FileAccess.Read, + FileStream fileStream = new FileStream("TestFiles/test.sav", FileMode.Open, FileAccess.Read, FileShare.Read, 2048*10, FileOptions.SequentialScan); int[] varenieValues = {1, 2 ,1}; @@ -31,28 +29,28 @@ public void TestReadFile() { {0, (i, variable) => { - Assert.AreEqual("varaible ñ", variable.Label, "Label mismatch"); - Assert.AreEqual(DataType.Numeric, variable.Type, "First file variable should be a Number"); + Assert.Equal("varaible ñ", variable.Label); //Label mismatch + Assert.Equal(DataType.Numeric, variable.Type); //First file variable should be a Number }}, {1, (i, variable) => { - Assert.AreEqual("straße", variable.Label, "Label mismatch"); - Assert.AreEqual(DataType.Text, variable.Type, "Second file variable should be a text"); + Assert.Equal("straße", variable.Label); //Label mismatch + Assert.Equal(DataType.Text, variable.Type); //Second file variable should be a text }} }, new Dictionary> { {0, (r, c, variable, value) => { // All numeric values are doubles - Assert.IsInstanceOfType(value, typeof(double), "First row variable should be a Number"); - double v = (double) value; - Assert.AreEqual(varenieValues[r], v, "Int value is different"); + Assert.IsType(value); // First row variable should be a Number + var v = (double) value; + Assert.Equal(varenieValues[r], v); //Int value is different }}, {1, (r, c, variable, value) => { - Assert.IsInstanceOfType(value, typeof(string), "Second row variable should be a text"); - string v = (string) value; - Assert.AreEqual(streetValues[r], v, "String value is different"); + Assert.IsType(value); //Second row variable should be a text + var v = (string) value; + Assert.Equal(streetValues[r], v); //String value is different }} }); } @@ -61,24 +59,25 @@ public void TestReadFile() fileStream.Close(); } - Assert.AreEqual(varCount, 3, "Variable count does not match"); - Assert.AreEqual(rowCount, 3, "Rows count does not match"); + Assert.Equal(3, varCount); // Variable count does not match + Assert.Equal(3, rowCount); // Rows count does not match } - [TestMethod] - [ExpectedException(typeof(SpssFileFormatException))] + [Fact] public void TestEmptyStream() { - int varCount; - int rowCount; - ReadData(new MemoryStream(new byte[0]), out varCount, out rowCount); + Assert.Throws(() => + { + int varCount; + int rowCount; + ReadData(new MemoryStream(new byte[0]), out varCount, out rowCount); + }); } - [TestMethod] - [DeploymentItem(@"TestFiles\MissingValues.sav")] + [Fact] public void TestReadMissingValuesAsNull() { - FileStream fileStream = new FileStream("MissingValues.sav", FileMode.Open, FileAccess.Read, + FileStream fileStream = new FileStream("TestFiles/MissingValues.sav", FileMode.Open, FileAccess.Read, FileShare.Read, 2048 * 10, FileOptions.SequentialScan); double?[][] varValues = @@ -93,21 +92,20 @@ public void TestReadMissingValuesAsNull() Action rowCheck = (r, c, variable, value) => { - Assert.AreEqual(varValues[c][r], value, $"Wrong value: row {r}, variable {c}"); + Assert.Equal(varValues[c][r], value); //Wrong value: row {r}, variable {c} }; - - + try { int varCount, rowCount; ReadData(fileStream, out varCount, out rowCount, new Dictionary> { - {0, (i, variable) => Assert.AreEqual(MissingValueType.NoMissingValues, variable.MissingValueType)}, - {1, (i, variable) => Assert.AreEqual(MissingValueType.OneDiscreteMissingValue, variable.MissingValueType)}, - {2, (i, variable) => Assert.AreEqual(MissingValueType.TwoDiscreteMissingValue, variable.MissingValueType)}, - {3, (i, variable) => Assert.AreEqual(MissingValueType.ThreeDiscreteMissingValue, variable.MissingValueType)}, - {4, (i, variable) => Assert.AreEqual(MissingValueType.Range, variable.MissingValueType)}, - {5, (i, variable) => Assert.AreEqual(MissingValueType.RangeAndDiscrete, variable.MissingValueType)}, + {0, (i, variable) => Assert.Equal(MissingValueType.NoMissingValues, variable.MissingValueType)}, + {1, (i, variable) => Assert.Equal(MissingValueType.OneDiscreteMissingValue, variable.MissingValueType)}, + {2, (i, variable) => Assert.Equal(MissingValueType.TwoDiscreteMissingValue, variable.MissingValueType)}, + {3, (i, variable) => Assert.Equal(MissingValueType.ThreeDiscreteMissingValue, variable.MissingValueType)}, + {4, (i, variable) => Assert.Equal(MissingValueType.Range, variable.MissingValueType)}, + {5, (i, variable) => Assert.Equal(MissingValueType.RangeAndDiscrete, variable.MissingValueType)}, }, new Dictionary> { @@ -143,8 +141,7 @@ internal static void ReadData(Stream fileStream, out int varCount, out int rowCo Debug.WriteLine(" {0} - {1}", label.Key, label.Value); } - Action checkVariable; - if (variableValidators != null && variableValidators.TryGetValue(varCount, out checkVariable)) + if (variableValidators != null && variableValidators.TryGetValue(varCount, out var checkVariable)) { checkVariable(varCount, variable); } @@ -163,8 +160,7 @@ internal static void ReadData(Stream fileStream, out int varCount, out int rowCo Debug.Write(value); Debug.Write('\t'); - Action checkValue; - if (valueValidators != null && valueValidators.TryGetValue(varIndex, out checkValue)) + if (valueValidators != null && valueValidators.TryGetValue(varIndex, out var checkValue)) { checkValue(rowCount, varIndex, variable, value); } diff --git a/Test.SpssLib/TestSpssWriter.cs b/Test.SpssLib/TestSpssWriter.cs index e3d159d..5a50a2c 100644 --- a/Test.SpssLib/TestSpssWriter.cs +++ b/Test.SpssLib/TestSpssWriter.cs @@ -1,51 +1,50 @@ using System; using System.Collections.Generic; using System.IO; -using Microsoft.VisualStudio.TestTools.UnitTesting; using SpssLib.DataReader; using SpssLib.SpssDataset; +using Xunit; namespace Test.SpssLib { - [TestClass] public class TestSpssWriter { - [TestMethod] + [Fact] public void TestWriteNumbers() { - var filename = @"testWriteNumbers.sav"; + var filename = @"TestFiles/testWriteNumbers.sav"; var variables = new List - { - new Variable("avariablename_01") - { - Label = "The variable Label", - ValueLabels = new Dictionary - { - {1, "Label for 1"}, - {2, "Label for 2"}, - }, - PrintFormat = new OutputFormat(FormatType.F, 8, 2), - WriteFormat = new OutputFormat(FormatType.F, 8, 2), - Type = DataType.Numeric, - Width = 10, - MissingValueType = MissingValueType.OneDiscreteMissingValue - }, - new Variable("avariablename_02") - { - Label = "Another variable", - ValueLabels = new Dictionary - { - {1, "this is 1"}, - {2, "this is 2"}, - }, - PrintFormat = new OutputFormat(FormatType.F, 8, 2), - WriteFormat = new OutputFormat(FormatType.F, 8, 2), - Type = DataType.Numeric, - Width = 10, - MissingValueType = MissingValueType.OneDiscreteMissingValue - } - }; + { + new Variable("avariablename_01") + { + Label = "The variable Label", + ValueLabels = new Dictionary + { + {1, "Label for 1"}, + {2, "Label for 2"}, + }, + PrintFormat = new OutputFormat(FormatType.F, 8, 2), + WriteFormat = new OutputFormat(FormatType.F, 8, 2), + Type = DataType.Numeric, + Width = 10, + MissingValueType = MissingValueType.OneDiscreteMissingValue + }, + new Variable("avariablename_02") + { + Label = "Another variable", + ValueLabels = new Dictionary + { + {1, "this is 1"}, + {2, "this is 2"}, + }, + PrintFormat = new OutputFormat(FormatType.F, 8, 2), + WriteFormat = new OutputFormat(FormatType.F, 8, 2), + Type = DataType.Numeric, + Width = 10, + MissingValueType = MissingValueType.OneDiscreteMissingValue + } + }; variables[0].MissingValues[0] = 999; variables[1].MissingValues[0] = 999; @@ -71,102 +70,102 @@ public void TestWriteNumbers() int rowCount; ReadFile(filename, out varCount, out rowCount); - Assert.AreEqual(varCount, 2, "Variable count does not match"); - Assert.AreEqual(rowCount, 2, "Rows count does not match"); + Assert.Equal(2, varCount); //Variable count does not match + Assert.Equal(2, rowCount); //Rows count does not match } - [TestMethod] + [Fact] public void TestWriteString() { - var filename = @"testWriteString.sav"; + var filename = @"TestFiles/testWriteString.sav"; var varString1 = new Variable("stringvar_01") - { - Label = "This is a string variable", - Type = DataType.Text, - TextWidth = 500, - }; + { + Label = "This is a string variable", + Type = DataType.Text, + TextWidth = 500, + }; var variable1 = new Variable("avariablename_01") - { - Label = "The variable Label", - ValueLabels = new Dictionary - { - {1, "Label for 1"}, - {2, "Label for 2"}, - }, - PrintFormat = new OutputFormat(FormatType.F, 8, 2), - WriteFormat = new OutputFormat(FormatType.F, 8, 2), - Type = DataType.Numeric, - Width = 10, - MissingValueType = MissingValueType.OneDiscreteMissingValue, - MissingValues = {[0] = 999} - }; + { + Label = "The variable Label", + ValueLabels = new Dictionary + { + {1, "Label for 1"}, + {2, "Label for 2"}, + }, + PrintFormat = new OutputFormat(FormatType.F, 8, 2), + WriteFormat = new OutputFormat(FormatType.F, 8, 2), + Type = DataType.Numeric, + Width = 10, + MissingValueType = MissingValueType.OneDiscreteMissingValue, + MissingValues = {[0] = 999} + }; var varString = new Variable("stringvar_02") - { - Label = "This is a string variable", - PrintFormat = new OutputFormat(FormatType.A, 60), - WriteFormat = new OutputFormat(FormatType.A, 60), - Type = DataType.Text, - Width = 60, - TextWidth = 60, - }; + { + Label = "This is a string variable", + PrintFormat = new OutputFormat(FormatType.A, 60), + WriteFormat = new OutputFormat(FormatType.A, 60), + Type = DataType.Text, + Width = 60, + TextWidth = 60, + }; var variable2 = new Variable("avariablename_02") - { - Label = "Another variable", - ValueLabels = new Dictionary - { - {1, "this is 1"}, - {2, "this is 2"}, - }, - PrintFormat = new OutputFormat(FormatType.F, 8, 2), - WriteFormat = new OutputFormat(FormatType.F, 8, 2), - Type = DataType.Numeric, - Width = 10, - MissingValueType = MissingValueType.OneDiscreteMissingValue, - MissingValues = {[0] = 999} - }; + { + Label = "Another variable", + ValueLabels = new Dictionary + { + {1, "this is 1"}, + {2, "this is 2"}, + }, + PrintFormat = new OutputFormat(FormatType.F, 8, 2), + WriteFormat = new OutputFormat(FormatType.F, 8, 2), + Type = DataType.Numeric, + Width = 10, + MissingValueType = MissingValueType.OneDiscreteMissingValue, + MissingValues = {[0] = 999} + }; var variables = new List - { - varString1, - variable1, - varString, - variable2 - }; + { + varString1, + variable1, + varString, + variable2 + }; var options = new SpssOptions(); var data = new[] - { - new object[] - { - // Exactly 500 - "Lorem ipsum dolor sit amet, consectetur adipiscing elit. In iaculis neque eget neque semper, vitae lacinia libero rhoncus. Mauris tellus lorem, imperdiet vitae bibendum ac, rhoncus nec dui. Donec in consequat leo. Nunc at ante nec metus aliquam hendrerit quis a augue. Suspendisse faucibus nunc mauris, sed faucibus mauris bibendum et. Sed auctor, dolor non luctus interdum, tellus neque auctor dui, sit amet luctus neque risus vel nibh. Nullam ornare ultricies quam. Vestibulum eget erat sit nullam.", - 15d, - "adsf ñlkj", - 15.5d - }, - new object[] - { - // 600, should be cut to 500 - "Lorem ipsum dolor sit amet, consectetur adipiscing elit. In elementum sed justo eu pulvinar. Maecenas non laoreet justo, eget ultrices dolor. Praesent sit amet sodales erat. Proin condimentum, metus et pulvinar ultrices, massa erat hendrerit lorem, vel mattis dolor ante id sem. Fusce laoreet mi tortor, ut interdum ipsum laoreet vel. Nullam lorem mauris, vulputate luctus velit placerat, scelerisque vehicula elit. Phasellus gravida ante quis augue convallis venenatis. Integer bibendum purus non felis interdum, quis fermentum tellus sodales. Fusce commodo ultrices leo ut vulputate. Quisque metus.", - 150d, - null, - 150d - }, - new object[] - { - // 255 chars - "Lorem ipsum dolor sit amet, consectetur adipiscing elit. In iaculis neque eget neque semper, vitae lacinia libero rhoncus. Mauris tellus lorem, imperdiet vitae bibendum ac, rhoncus nec dui. Donec in consequat leo. Nunc at ante nec metus aliquam hendrerit_", - null, - // 300 chars, should be cut to 60 - "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec.", - 200d - } - }; + { + new object[] + { + // Exactly 500 + "Lorem ipsum dolor sit amet, consectetur adipiscing elit. In iaculis neque eget neque semper, vitae lacinia libero rhoncus. Mauris tellus lorem, imperdiet vitae bibendum ac, rhoncus nec dui. Donec in consequat leo. Nunc at ante nec metus aliquam hendrerit quis a augue. Suspendisse faucibus nunc mauris, sed faucibus mauris bibendum et. Sed auctor, dolor non luctus interdum, tellus neque auctor dui, sit amet luctus neque risus vel nibh. Nullam ornare ultricies quam. Vestibulum eget erat sit nullam.", + 15d, + "adsf ñlkj", + 15.5d + }, + new object[] + { + // 600, should be cut to 500 + "Lorem ipsum dolor sit amet, consectetur adipiscing elit. In elementum sed justo eu pulvinar. Maecenas non laoreet justo, eget ultrices dolor. Praesent sit amet sodales erat. Proin condimentum, metus et pulvinar ultrices, massa erat hendrerit lorem, vel mattis dolor ante id sem. Fusce laoreet mi tortor, ut interdum ipsum laoreet vel. Nullam lorem mauris, vulputate luctus velit placerat, scelerisque vehicula elit. Phasellus gravida ante quis augue convallis venenatis. Integer bibendum purus non felis interdum, quis fermentum tellus sodales. Fusce commodo ultrices leo ut vulputate. Quisque metus.", + 150d, + null, + 150d + }, + new object[] + { + // 255 chars + "Lorem ipsum dolor sit amet, consectetur adipiscing elit. In iaculis neque eget neque semper, vitae lacinia libero rhoncus. Mauris tellus lorem, imperdiet vitae bibendum ac, rhoncus nec dui. Donec in consequat leo. Nunc at ante nec metus aliquam hendrerit_", + null, + // 300 chars, should be cut to 60 + "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec.", + 200d + } + }; using (FileStream fileStream = new FileStream(filename, FileMode.Create, FileAccess.Write)) { @@ -177,79 +176,78 @@ public void TestWriteString() { writer.WriteRecord(row); } + writer.EndFile(); } } - int varCount; - int rowCount; - ReadFile(filename, out varCount, out rowCount); + ReadFile(filename, out var varCount, out var rowCount); - Assert.AreEqual(varCount, 4, "Variable count does not match"); - Assert.AreEqual(rowCount, 3, "Rows count does not match"); + Assert.Equal(4, varCount); //Variable count does not match + Assert.Equal(3, rowCount); //Rows count does not match } - [TestMethod] + [Fact] public void TestWriteLongWeirdString() { - var filename = @"testTestWriteLongWeirdString.sav"; + var filename = @"TestFiles/testTestWriteLongWeirdString.sav"; var varString1 = new Variable("stringvar_01") - { - Label = "This is a string variable", - Type = DataType.Text, - TextWidth = 5000, - }; + { + Label = "This is a string variable", + Type = DataType.Text, + TextWidth = 5000, + }; var variable1 = new Variable("avariablename_01") - { - Label = "The variable Label", - ValueLabels = new Dictionary - { - {1, "Label for 1"}, - {2, "Label for 2"}, - }, - PrintFormat = new OutputFormat(FormatType.F, 8, 2), - WriteFormat = new OutputFormat(FormatType.F, 8, 2), - Type = DataType.Numeric, - Width = 10, - MissingValueType = MissingValueType.OneDiscreteMissingValue, - MissingValues = {[0] = 999} - }; + { + Label = "The variable Label", + ValueLabels = new Dictionary + { + {1, "Label for 1"}, + {2, "Label for 2"}, + }, + PrintFormat = new OutputFormat(FormatType.F, 8, 2), + WriteFormat = new OutputFormat(FormatType.F, 8, 2), + Type = DataType.Numeric, + Width = 10, + MissingValueType = MissingValueType.OneDiscreteMissingValue, + MissingValues = {[0] = 999} + }; var varString = new Variable("stringvar_02") - { - Label = "This is a string variable", - Type = DataType.Text, - TextWidth = 60, - Alignment = Alignment.Centre, - MeasurementType = MeasurementType.Ordinal - }; + { + Label = "This is a string variable", + Type = DataType.Text, + TextWidth = 60, + Alignment = Alignment.Centre, + MeasurementType = MeasurementType.Ordinal + }; var variable2 = new Variable("avariablename_02") - { - Label = "Another variable", - ValueLabels = new Dictionary - { - {1, "this is 1"}, - {2, "this is 2"}, - }, - PrintFormat = new OutputFormat(FormatType.F, 8, 2), - WriteFormat = new OutputFormat(FormatType.F, 8, 2), - Type = DataType.Numeric, - Width = 10, - MissingValueType = MissingValueType.OneDiscreteMissingValue, - MissingValues = {[0] = 999} - }; + { + Label = "Another variable", + ValueLabels = new Dictionary + { + {1, "this is 1"}, + {2, "this is 2"}, + }, + PrintFormat = new OutputFormat(FormatType.F, 8, 2), + WriteFormat = new OutputFormat(FormatType.F, 8, 2), + Type = DataType.Numeric, + Width = 10, + MissingValueType = MissingValueType.OneDiscreteMissingValue, + MissingValues = {[0] = 999} + }; var variables = new List - { - varString1, - variable1, - varString, - variable2 - }; + { + varString1, + variable1, + varString, + variable2 + }; var options = new SpssOptions(); @@ -291,51 +289,54 @@ public void TestWriteLongWeirdString() int rowCount; ReadFile(filename, out varCount, out rowCount); - Assert.AreEqual(varCount, 4, "Variable count does not match"); - Assert.AreEqual(rowCount, 3, "Rows count does not match"); + Assert.Equal(4, varCount); //Variable count does not match + Assert.Equal(3, rowCount); //Rows count does not match } - [ExpectedException(typeof (ArgumentNullException))] - [TestMethod] + [Fact] public void TestNullVarnameException() { - var filename = @"thisFileShouldNotExist.sav"; - - var variables = new List - { - new Variable(null) - }; - - using (FileStream fileStream = new FileStream(filename, FileMode.Create, FileAccess.Write)) + Assert.Throws(() => { - using (new SpssWriter(fileStream, variables)) + var filename = @"TestFiles/thisFileShouldNotExist.sav"; + + var variables = new List { + new Variable(null) + }; + using (FileStream fileStream = new FileStream(filename, FileMode.Create, FileAccess.Write)) + { + using (new SpssWriter(fileStream, variables)) + { + } } - } + }); } - [ExpectedException(typeof (ArgumentException))] - [TestMethod] + [Fact] public void TestNoVarnameException() { - var filename = @"emptyErrorFile.sav"; + Assert.Throws(() => + { + var filename = @"TestFiles/emptyErrorFile.sav"; - var variables = new List - { + var variables = new List + { #pragma warning disable 618 - new Variable() + new Variable() #pragma warning restore 618 - }; + }; - using (FileStream fileStream = new FileStream(filename, FileMode.Create, FileAccess.Write)) - { - using (new SpssWriter(fileStream, variables)) + using (FileStream fileStream = new FileStream(filename, FileMode.Create, FileAccess.Write)) { + using (new SpssWriter(fileStream, variables)) + { + } } - } + }); } - [TestMethod] + [Fact] public void TestWriteDoubleLongStringVar() { var filename = @"c:\temp\testWriteDoubleLongString.sav"; @@ -343,32 +344,32 @@ public void TestWriteDoubleLongStringVar() using (FileStream fileStream = new FileStream(filename, FileMode.Create, FileAccess.Write)) { var var1 = new Variable("stringvar_01") - { - Label = "This is a string variable", - Type = DataType.Text, - Width = 50, - TextWidth = 5000 - }; + { + Label = "This is a string variable", + Type = DataType.Text, + Width = 50, + TextWidth = 5000 + }; var var2 = new Variable("stringvar_02") - { - Label = "This is a string variable", - PrintFormat = new OutputFormat(FormatType.A, 60), - WriteFormat = new OutputFormat(FormatType.A, 70), - Type = DataType.Text, - Width = 50, - TextWidth = 5000 - }; + { + Label = "This is a string variable", + PrintFormat = new OutputFormat(FormatType.A, 60), + WriteFormat = new OutputFormat(FormatType.A, 70), + Type = DataType.Text, + Width = 50, + TextWidth = 5000 + }; var var3 = new Variable("stringvar_03") - { - Label = "This is a string variable", - PrintFormat = new OutputFormat(FormatType.A, 60), - WriteFormat = new OutputFormat(FormatType.A, 70), - Type = DataType.Text, - Width = 50, - TextWidth = 5000 - }; + { + Label = "This is a string variable", + PrintFormat = new OutputFormat(FormatType.A, 60), + WriteFormat = new OutputFormat(FormatType.A, 70), + Type = DataType.Text, + Width = 50, + TextWidth = 5000 + }; var var4 = new Variable("stringvar_04") { @@ -398,14 +399,14 @@ public void TestWriteDoubleLongStringVar() var variables = new List - { - var1, - var2, - var3, - var4, - var5, - var6 - }; + { + var1, + var2, + var3, + var4, + var5, + var6 + }; var options = new SpssOptions(); @@ -425,7 +426,7 @@ public void TestWriteDoubleLongStringVar() private static void ReadFile(string filename, out int varCount, out int rowCount) { FileStream readFileStream = new FileStream(filename, FileMode.Open, FileAccess.Read, - FileShare.Read, 2048*10, FileOptions.SequentialScan); + FileShare.Read, 2048 * 10, FileOptions.SequentialScan); try { From 4d6708fcbf7b9f3d713f3e193d2b77f2d851005b Mon Sep 17 00:00:00 2001 From: Andrei Vinogradov Date: Thu, 20 Feb 2020 13:12:28 +0300 Subject: [PATCH 03/26] Handling 1252 encoding in Net.Standard. --- .../Records/CharacterEncodingRecord.cs | 5 ++ SpssLib/SpssLib.csproj | 54 +------------------ Test.SpssLib/Test.SpssLib.csproj | 1 + Test.SpssLib/TestSpssReader.cs | 3 ++ 4 files changed, 10 insertions(+), 53 deletions(-) diff --git a/SpssLib/FileParser/Records/CharacterEncodingRecord.cs b/SpssLib/FileParser/Records/CharacterEncodingRecord.cs index 6302dfb..14e6546 100644 --- a/SpssLib/FileParser/Records/CharacterEncodingRecord.cs +++ b/SpssLib/FileParser/Records/CharacterEncodingRecord.cs @@ -92,6 +92,11 @@ private Encoding GetEncoding(string strEncoding) // 932 - Japanese (Shift-JIS) return Encoding.GetEncoding(932); } + + if (strEncoding.Equals("CP1252", StringComparison.InvariantCultureIgnoreCase)) + { + return Encoding.GetEncoding(1252); + } throw new SpssFileFormatException("Encoding not recognized: " + strEncoding); } diff --git a/SpssLib/SpssLib.csproj b/SpssLib/SpssLib.csproj index d9023c0..f3cd0e1 100644 --- a/SpssLib/SpssLib.csproj +++ b/SpssLib/SpssLib.csproj @@ -1,4 +1,4 @@ - + netstandard2.0 @@ -15,56 +15,4 @@ SpssLib - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Test.SpssLib/Test.SpssLib.csproj b/Test.SpssLib/Test.SpssLib.csproj index 7e96a71..81e9f79 100644 --- a/Test.SpssLib/Test.SpssLib.csproj +++ b/Test.SpssLib/Test.SpssLib.csproj @@ -10,6 +10,7 @@ + all diff --git a/Test.SpssLib/TestSpssReader.cs b/Test.SpssLib/TestSpssReader.cs index 5937371..35df15c 100644 --- a/Test.SpssLib/TestSpssReader.cs +++ b/Test.SpssLib/TestSpssReader.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Diagnostics; using System.IO; +using System.Text; using SpssLib.DataReader; using SpssLib.FileParser; using SpssLib.SpssDataset; @@ -16,6 +17,8 @@ public void TestReadFile() { FileStream fileStream = new FileStream("TestFiles/test.sav", FileMode.Open, FileAccess.Read, FileShare.Read, 2048*10, FileOptions.SequentialScan); + + Encoding.RegisterProvider(CodePagesEncodingProvider.Instance); //To enable support of 1252 encoding int[] varenieValues = {1, 2 ,1}; string[] streetValues = { "Landsberger Straße", "Fröbelplatz", "Bayerstraße" }; From 34a79a59a7271d14368904f43522fc2c5bbcc2b5 Mon Sep 17 00:00:00 2001 From: Maxim Markelow Date: Thu, 20 Feb 2020 15:07:55 +0300 Subject: [PATCH 04/26] Renamed to curisoity namespace --- .idea/.gitignore | 3 + .idea/.idea.Curisoity.SPSS/.idea/.name | 1 + .../.idea/contentModel.xml | 113 +++++++++++++++++ .../.idea.Curisoity.SPSS/.idea/encodings.xml | 4 + .../.idea/indexLayout.xml | 8 ++ .idea/.idea.Curisoity.SPSS/.idea/modules.xml | 8 ++ .../.idea/projectSettingsUpdater.xml | 6 + .idea/.idea.Curisoity.SPSS/.idea/vcs.xml | 6 + .idea/.idea.Curisoity.SPSS/riderModule.iml | 11 ++ .idea/.idea.Curisoity.SpssLib/.idea/.name | 1 + .../.idea/contentModel.xml | 12 ++ .../.idea/encodings.xml | 4 + .../.idea/indexLayout.xml | 8 ++ .../.idea.Curisoity.SpssLib/.idea/modules.xml | 8 ++ .../.idea/projectSettingsUpdater.xml | 6 + .idea/.idea.Curisoity.SpssLib/.idea/vcs.xml | 6 + .../.idea/workspace.xml | 119 ++++++++++++++++++ .idea/.idea.Curisoity.SpssLib/riderModule.iml | 7 ++ .idea/.idea.SpssLib/.idea/.name | 1 + .idea/.idea.SpssLib/.idea/contentModel.xml | 109 ++++++++++++++++ .idea/.idea.SpssLib/.idea/encodings.xml | 4 + .idea/.idea.SpssLib/.idea/indexLayout.xml | 8 ++ .idea/.idea.SpssLib/.idea/modules.xml | 8 ++ .../.idea/projectSettingsUpdater.xml | 6 + .idea/.idea.SpssLib/.idea/vcs.xml | 6 + .idea/.idea.SpssLib/riderModule.iml | 11 ++ Curisoity.SPSS.sln | 54 ++++++++ ReadMe.md | 10 +- SpssLib.sln | 42 ------- .../Compression/DecompressedDataStream.cs | 4 +- {SpssLib => src/Curiosity.SPSS}/Constants.cs | 2 +- .../Curiosity.SPSS/Curiosity.SPSS.csproj | 1 - .../Curiosity.SPSS}/DataReader/SpssOptions.cs | 4 +- .../Curiosity.SPSS}/DataReader/SpssReader.cs | 6 +- .../Curiosity.SPSS}/DataReader/SpssWriter.cs | 6 +- .../Curiosity.SPSS}/FileParser/Common.cs | 2 +- .../FileParser/CompressedRecordWriter.cs | 2 +- .../FileParser/IRecordWriter.cs | 2 +- .../Curiosity.SPSS}/FileParser/MetaData.cs | 4 +- .../FileParser/Records/BaseInfoRecord.cs | 2 +- .../Records/CharacterEncodingRecord.cs | 2 +- .../Records/DictionaryTerminationRecord.cs | 2 +- .../FileParser/Records/DocumentRecord.cs | 5 +- .../FileParser/Records/EbcdicHeaderRecord.cs | 2 +- .../FileParser/Records/EncodeEnabledRecord.cs | 2 +- .../FileParser/Records/EncodingExtensions.cs | 2 +- .../FileParser/Records/HeaderRecord.cs | 4 +- .../FileParser/Records/IRecord.cs | 2 +- .../FileParser/Records/IRecordParser.cs | 2 +- .../FileParser/Records/InfoRecord.cs | 5 +- .../FileParser/Records/InfoRecordParser.cs | 2 +- .../FileParser/Records/InfoRecordType.cs | 2 +- .../Records/LongVariableNamesRecord.cs | 2 +- .../Records/MachineFloatingPointInfoRecord.cs | 2 +- .../Records/MachineIntegerInfoRecord.cs | 2 +- .../FileParser/Records/ParserProvider.cs | 2 +- .../Records/ReaderWriterExtensions.cs | 2 +- .../FileParser/Records/RecordType.cs | 2 +- .../FileParser/Records/ValueLabelRecord.cs | 7 +- .../Records/VariableDataInfoRecord.cs | 2 +- .../FileParser/Records/VariableDataType.cs | 2 +- .../FileParser/Records/VariableDisplayInfo.cs | 4 +- .../Records/VariableDisplayInfoCollection.cs | 2 +- .../Records/VariableDisplayParameterRecord.cs | 4 +- .../FileParser/Records/VariableRecord.cs | 9 +- .../Records/VeryLongStringRecord.cs | 2 +- .../FileParser/SavFileParser.cs | 10 +- .../FileParser/SavFileWriter.cs | 8 +- .../FileParser/SpssFileFormatException.cs | 2 +- .../FileParser/StringWriter.cs | 4 +- .../Curiosity.SPSS}/SpssDataset/Alignment.cs | 2 +- .../Curiosity.SPSS}/SpssDataset/DataType.cs | 2 +- .../Curiosity.SPSS}/SpssDataset/FormatType.cs | 2 +- .../SpssDataset/MeasurementType.cs | 2 +- .../SpssDataset/MissingValueType.cs | 2 +- .../SpssDataset/OutputFormat.cs | 2 +- .../Curiosity.SPSS}/SpssDataset/Record.cs | 2 +- .../Curiosity.SPSS}/SpssDataset/Variable.cs | 3 +- .../Curiosity.SPSS}/doc/BinaryDescription.txt | 0 .../Curiosity.SPSS.UnitTests.csproj | 9 +- .../TestFiles/MissingValues.sav | Bin .../TestFiles/cakespss1000similarvars.sav | Bin .../TestFiles/test.sav | Bin .../Curiosity.SPSS.UnitTests}/TestSpssCopy.cs | 4 +- .../TestSpssReader.cs | 8 +- .../TestSpssWriter.cs | 23 ++-- .../test.runsettings | 0 87 files changed, 641 insertions(+), 145 deletions(-) create mode 100644 .idea/.gitignore create mode 100644 .idea/.idea.Curisoity.SPSS/.idea/.name create mode 100644 .idea/.idea.Curisoity.SPSS/.idea/contentModel.xml create mode 100644 .idea/.idea.Curisoity.SPSS/.idea/encodings.xml create mode 100644 .idea/.idea.Curisoity.SPSS/.idea/indexLayout.xml create mode 100644 .idea/.idea.Curisoity.SPSS/.idea/modules.xml create mode 100644 .idea/.idea.Curisoity.SPSS/.idea/projectSettingsUpdater.xml create mode 100644 .idea/.idea.Curisoity.SPSS/.idea/vcs.xml create mode 100644 .idea/.idea.Curisoity.SPSS/riderModule.iml create mode 100644 .idea/.idea.Curisoity.SpssLib/.idea/.name create mode 100644 .idea/.idea.Curisoity.SpssLib/.idea/contentModel.xml create mode 100644 .idea/.idea.Curisoity.SpssLib/.idea/encodings.xml create mode 100644 .idea/.idea.Curisoity.SpssLib/.idea/indexLayout.xml create mode 100644 .idea/.idea.Curisoity.SpssLib/.idea/modules.xml create mode 100644 .idea/.idea.Curisoity.SpssLib/.idea/projectSettingsUpdater.xml create mode 100644 .idea/.idea.Curisoity.SpssLib/.idea/vcs.xml create mode 100644 .idea/.idea.Curisoity.SpssLib/.idea/workspace.xml create mode 100644 .idea/.idea.Curisoity.SpssLib/riderModule.iml create mode 100644 .idea/.idea.SpssLib/.idea/.name create mode 100644 .idea/.idea.SpssLib/.idea/contentModel.xml create mode 100644 .idea/.idea.SpssLib/.idea/encodings.xml create mode 100644 .idea/.idea.SpssLib/.idea/indexLayout.xml create mode 100644 .idea/.idea.SpssLib/.idea/modules.xml create mode 100644 .idea/.idea.SpssLib/.idea/projectSettingsUpdater.xml create mode 100644 .idea/.idea.SpssLib/.idea/vcs.xml create mode 100644 .idea/.idea.SpssLib/riderModule.iml create mode 100644 Curisoity.SPSS.sln delete mode 100644 SpssLib.sln rename {SpssLib => src/Curiosity.SPSS}/Compression/DecompressedDataStream.cs (99%) rename {SpssLib => src/Curiosity.SPSS}/Constants.cs (93%) rename SpssLib/SpssLib.csproj => src/Curiosity.SPSS/Curiosity.SPSS.csproj (94%) rename {SpssLib => src/Curiosity.SPSS}/DataReader/SpssOptions.cs (96%) rename {SpssLib => src/Curiosity.SPSS}/DataReader/SpssReader.cs (92%) rename {SpssLib => src/Curiosity.SPSS}/DataReader/SpssWriter.cs (97%) rename {SpssLib => src/Curiosity.SPSS}/FileParser/Common.cs (94%) rename {SpssLib => src/Curiosity.SPSS}/FileParser/CompressedRecordWriter.cs (99%) rename {SpssLib => src/Curiosity.SPSS}/FileParser/IRecordWriter.cs (97%) rename {SpssLib => src/Curiosity.SPSS}/FileParser/MetaData.cs (97%) rename {SpssLib => src/Curiosity.SPSS}/FileParser/Records/BaseInfoRecord.cs (98%) rename {SpssLib => src/Curiosity.SPSS}/FileParser/Records/CharacterEncodingRecord.cs (98%) rename {SpssLib => src/Curiosity.SPSS}/FileParser/Records/DictionaryTerminationRecord.cs (95%) rename {SpssLib => src/Curiosity.SPSS}/FileParser/Records/DocumentRecord.cs (93%) rename {SpssLib => src/Curiosity.SPSS}/FileParser/Records/EbcdicHeaderRecord.cs (93%) rename {SpssLib => src/Curiosity.SPSS}/FileParser/Records/EncodeEnabledRecord.cs (96%) rename {SpssLib => src/Curiosity.SPSS}/FileParser/Records/EncodingExtensions.cs (99%) rename {SpssLib => src/Curiosity.SPSS}/FileParser/Records/HeaderRecord.cs (97%) rename {SpssLib => src/Curiosity.SPSS}/FileParser/Records/IRecord.cs (86%) rename {SpssLib => src/Curiosity.SPSS}/FileParser/Records/IRecordParser.cs (94%) rename {SpssLib => src/Curiosity.SPSS}/FileParser/Records/InfoRecord.cs (92%) rename {SpssLib => src/Curiosity.SPSS}/FileParser/Records/InfoRecordParser.cs (97%) rename {SpssLib => src/Curiosity.SPSS}/FileParser/Records/InfoRecordType.cs (96%) rename {SpssLib => src/Curiosity.SPSS}/FileParser/Records/LongVariableNamesRecord.cs (94%) rename {SpssLib => src/Curiosity.SPSS}/FileParser/Records/MachineFloatingPointInfoRecord.cs (97%) rename {SpssLib => src/Curiosity.SPSS}/FileParser/Records/MachineIntegerInfoRecord.cs (98%) rename {SpssLib => src/Curiosity.SPSS}/FileParser/Records/ParserProvider.cs (98%) rename {SpssLib => src/Curiosity.SPSS}/FileParser/Records/ReaderWriterExtensions.cs (93%) rename {SpssLib => src/Curiosity.SPSS}/FileParser/Records/RecordType.cs (89%) rename {SpssLib => src/Curiosity.SPSS}/FileParser/Records/ValueLabelRecord.cs (97%) rename {SpssLib => src/Curiosity.SPSS}/FileParser/Records/VariableDataInfoRecord.cs (98%) rename {SpssLib => src/Curiosity.SPSS}/FileParser/Records/VariableDataType.cs (71%) rename {SpssLib => src/Curiosity.SPSS}/FileParser/Records/VariableDisplayInfo.cs (78%) rename {SpssLib => src/Curiosity.SPSS}/FileParser/Records/VariableDisplayInfoCollection.cs (87%) rename {SpssLib => src/Curiosity.SPSS}/FileParser/Records/VariableDisplayParameterRecord.cs (98%) rename {SpssLib => src/Curiosity.SPSS}/FileParser/Records/VariableRecord.cs (99%) rename {SpssLib => src/Curiosity.SPSS}/FileParser/Records/VeryLongStringRecord.cs (96%) rename {SpssLib => src/Curiosity.SPSS}/FileParser/SavFileParser.cs (99%) rename {SpssLib => src/Curiosity.SPSS}/FileParser/SavFileWriter.cs (98%) rename {SpssLib => src/Curiosity.SPSS}/FileParser/SpssFileFormatException.cs (93%) rename {SpssLib => src/Curiosity.SPSS}/FileParser/StringWriter.cs (98%) rename {SpssLib => src/Curiosity.SPSS}/SpssDataset/Alignment.cs (92%) rename {SpssLib => src/Curiosity.SPSS}/SpssDataset/DataType.cs (90%) rename {SpssLib => src/Curiosity.SPSS}/SpssDataset/FormatType.cs (96%) rename {SpssLib => src/Curiosity.SPSS}/SpssDataset/MeasurementType.cs (91%) rename {SpssLib => src/Curiosity.SPSS}/SpssDataset/MissingValueType.cs (97%) rename {SpssLib => src/Curiosity.SPSS}/SpssDataset/OutputFormat.cs (97%) rename {SpssLib => src/Curiosity.SPSS}/SpssDataset/Record.cs (98%) rename {SpssLib => src/Curiosity.SPSS}/SpssDataset/Variable.cs (99%) rename {SpssLib => src/Curiosity.SPSS}/doc/BinaryDescription.txt (100%) rename Test.SpssLib/Test.SpssLib.csproj => tests/Curiosity.SPSS.UnitTests/Curiosity.SPSS.UnitTests.csproj (88%) rename {Test.SpssLib => tests/Curiosity.SPSS.UnitTests}/TestFiles/MissingValues.sav (100%) rename {Test.SpssLib => tests/Curiosity.SPSS.UnitTests}/TestFiles/cakespss1000similarvars.sav (100%) rename {Test.SpssLib => tests/Curiosity.SPSS.UnitTests}/TestFiles/test.sav (100%) rename {Test.SpssLib => tests/Curiosity.SPSS.UnitTests}/TestSpssCopy.cs (94%) rename {Test.SpssLib => tests/Curiosity.SPSS.UnitTests}/TestSpssReader.cs (98%) rename {Test.SpssLib => tests/Curiosity.SPSS.UnitTests}/TestSpssWriter.cs (97%) rename {Test.SpssLib => tests/Curiosity.SPSS.UnitTests}/test.runsettings (100%) diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..1deda3f --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/.idea.SpssLib/.idea/workspace.xml +/.idea.Curisoity.SPSS/.idea/workspace.xml diff --git a/.idea/.idea.Curisoity.SPSS/.idea/.name b/.idea/.idea.Curisoity.SPSS/.idea/.name new file mode 100644 index 0000000..79ceb71 --- /dev/null +++ b/.idea/.idea.Curisoity.SPSS/.idea/.name @@ -0,0 +1 @@ +Curisoity.SPSS \ No newline at end of file diff --git a/.idea/.idea.Curisoity.SPSS/.idea/contentModel.xml b/.idea/.idea.Curisoity.SPSS/.idea/contentModel.xml new file mode 100644 index 0000000..23d7d4a --- /dev/null +++ b/.idea/.idea.Curisoity.SPSS/.idea/contentModel.xml @@ -0,0 +1,113 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/.idea.Curisoity.SPSS/.idea/encodings.xml b/.idea/.idea.Curisoity.SPSS/.idea/encodings.xml new file mode 100644 index 0000000..df87cf9 --- /dev/null +++ b/.idea/.idea.Curisoity.SPSS/.idea/encodings.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/.idea.Curisoity.SPSS/.idea/indexLayout.xml b/.idea/.idea.Curisoity.SPSS/.idea/indexLayout.xml new file mode 100644 index 0000000..27ba142 --- /dev/null +++ b/.idea/.idea.Curisoity.SPSS/.idea/indexLayout.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/.idea.Curisoity.SPSS/.idea/modules.xml b/.idea/.idea.Curisoity.SPSS/.idea/modules.xml new file mode 100644 index 0000000..ee0fa78 --- /dev/null +++ b/.idea/.idea.Curisoity.SPSS/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/.idea.Curisoity.SPSS/.idea/projectSettingsUpdater.xml b/.idea/.idea.Curisoity.SPSS/.idea/projectSettingsUpdater.xml new file mode 100644 index 0000000..7515e76 --- /dev/null +++ b/.idea/.idea.Curisoity.SPSS/.idea/projectSettingsUpdater.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/.idea.Curisoity.SPSS/.idea/vcs.xml b/.idea/.idea.Curisoity.SPSS/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/.idea.Curisoity.SPSS/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/.idea.Curisoity.SPSS/riderModule.iml b/.idea/.idea.Curisoity.SPSS/riderModule.iml new file mode 100644 index 0000000..a15aa56 --- /dev/null +++ b/.idea/.idea.Curisoity.SPSS/riderModule.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/.idea.Curisoity.SpssLib/.idea/.name b/.idea/.idea.Curisoity.SpssLib/.idea/.name new file mode 100644 index 0000000..df78979 --- /dev/null +++ b/.idea/.idea.Curisoity.SpssLib/.idea/.name @@ -0,0 +1 @@ +Curisoity.SpssLib \ No newline at end of file diff --git a/.idea/.idea.Curisoity.SpssLib/.idea/contentModel.xml b/.idea/.idea.Curisoity.SpssLib/.idea/contentModel.xml new file mode 100644 index 0000000..eba0736 --- /dev/null +++ b/.idea/.idea.Curisoity.SpssLib/.idea/contentModel.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/.idea.Curisoity.SpssLib/.idea/encodings.xml b/.idea/.idea.Curisoity.SpssLib/.idea/encodings.xml new file mode 100644 index 0000000..df87cf9 --- /dev/null +++ b/.idea/.idea.Curisoity.SpssLib/.idea/encodings.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/.idea.Curisoity.SpssLib/.idea/indexLayout.xml b/.idea/.idea.Curisoity.SpssLib/.idea/indexLayout.xml new file mode 100644 index 0000000..27ba142 --- /dev/null +++ b/.idea/.idea.Curisoity.SpssLib/.idea/indexLayout.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/.idea.Curisoity.SpssLib/.idea/modules.xml b/.idea/.idea.Curisoity.SpssLib/.idea/modules.xml new file mode 100644 index 0000000..4458021 --- /dev/null +++ b/.idea/.idea.Curisoity.SpssLib/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/.idea.Curisoity.SpssLib/.idea/projectSettingsUpdater.xml b/.idea/.idea.Curisoity.SpssLib/.idea/projectSettingsUpdater.xml new file mode 100644 index 0000000..7515e76 --- /dev/null +++ b/.idea/.idea.Curisoity.SpssLib/.idea/projectSettingsUpdater.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/.idea.Curisoity.SpssLib/.idea/vcs.xml b/.idea/.idea.Curisoity.SpssLib/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/.idea.Curisoity.SpssLib/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/.idea.Curisoity.SpssLib/.idea/workspace.xml b/.idea/.idea.Curisoity.SpssLib/.idea/workspace.xml new file mode 100644 index 0000000..f713a5f --- /dev/null +++ b/.idea/.idea.Curisoity.SpssLib/.idea/workspace.xml @@ -0,0 +1,119 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +