Skip to content

Commit

Permalink
Initial source file upload...
Browse files Browse the repository at this point in the history
  • Loading branch information
akesseler committed Aug 26, 2018
1 parent 3d1ed40 commit 2dbee1f
Show file tree
Hide file tree
Showing 43 changed files with 8,422 additions and 7 deletions.
12 changes: 5 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
# Plexdata.CsvParser
## Plexdata CSV Parser

_Provide a short description right here..._
The _Plexdata CSV Parser_ represents a library that allows importing and exporting of CSV files based on a user-defined class. Further, it is possible to configure the importing and exporting behavior.

## Limitations
Main feature of this library is that users only need to create an own class representing a single line of a CSV file. Each property that has to be included in the CSV processing should be tagged by a proper CSV attribute, which can be obtained from this library. Thereafter, this custom class can be used either together with the importer or together with the exporter to process CSV files.

_TBD, if some_...
Finally, it would also be possible (assuming a proper configuration is used) to write a CSV output according to the rules of RFC 4180. For more information about RFC 4180 please visit the web-site under [https://www.ietf.org/rfc/rfc4180.txt](https://www.ietf.org/rfc/rfc4180.txt).

## Known Issues

_TBD, if some_...
The software has been published under the terms of _MIT License_.

Empty file removed code/.keep
Empty file.
138 changes: 138 additions & 0 deletions code/hlp/Plexdata.CsvParser.NET.shfbproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<!-- The configuration and platform will be used to determine which assemblies to include from solution and
project documentation sources -->
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{18be0e07-5a16-4f28-8b8b-6e05060a9883}</ProjectGuid>
<SHFBSchemaVersion>2017.9.26.0</SHFBSchemaVersion>
<!-- AssemblyName, Name, and RootNamespace are not used by SHFB but Visual Studio adds them anyway -->
<AssemblyName>Documentation</AssemblyName>
<RootNamespace>Documentation</RootNamespace>
<Name>Documentation</Name>
<!-- SHFB properties -->
<FrameworkVersion>.NET Framework 4.6.1</FrameworkVersion>
<OutputPath>chm\</OutputPath>
<HtmlHelpName>Plexdata.CsvParser.NET</HtmlHelpName>
<Language>en-US</Language>
<DocumentationSources>
<DocumentationSource sourceFile="..\src\Plexdata.CsvParser.NET\bin\Release\Plexdata.CsvParser.NET.dll" />
<DocumentationSource sourceFile="..\src\Plexdata.CsvParser.NET\bin\Release\Plexdata.CsvParser.NET.xml" /></DocumentationSources>
<HelpFileFormat>HtmlHelp1</HelpFileFormat>
<SyntaxFilters>C#</SyntaxFilters>
<PresentationStyle>VS2013</PresentationStyle>
<CleanIntermediates>True</CleanIntermediates>
<KeepLogFile>True</KeepLogFile>
<DisableCodeBlockComponent>False</DisableCodeBlockComponent>
<IndentHtml>False</IndentHtml>
<BuildAssemblerVerbosity>OnlyWarningsAndErrors</BuildAssemblerVerbosity>
<HelpTitle>Plexdata.CsvParser.NET</HelpTitle>
<HelpFileVersion>1.0.0.0</HelpFileVersion>
<NamingMethod>Guid</NamingMethod>
<ContentPlacement>AboveNamespaces</ContentPlacement>
<RootNamespaceContainer>True</RootNamespaceContainer>
<RootNamespaceTitle>Plexdata.CsvParser.NET</RootNamespaceTitle>
<NamespaceGrouping>False</NamespaceGrouping>
<Preliminary>False</Preliminary>
<SdkLinkTarget>Blank</SdkLinkTarget>
<VisibleItems>Attributes, ExplicitInterfaceImplementations, InheritedMembers, InheritedFrameworkMembers, InheritedFrameworkInternalMembers, InheritedFrameworkPrivateMembers, Internals, Privates, PrivateFields, Protected, SealedProtected, NoPIATypes, PublicCompilerGenerated, EditorBrowsableNever, NonBrowsable</VisibleItems>
<ApiFilter>
<Filter entryType="Namespace" fullName="" isExposed="False" xmlns="">
<Filter entryType="Class" fullName="&lt;Module&gt;" isExposed="True" />
</Filter>
</ApiFilter>
<MissingTags>Summary, Parameter, Returns, Value, Remarks, AutoDocumentCtors, Namespace, TypeParameter, IncludeTargets, AutoDocumentDispose</MissingTags>
<ComponentConfigurations>
<ComponentConfig id="Code Block Component" enabled="True">
<component id="Code Block Component">
<basePath value="{@HtmlEncProjectFolder}" />
<outputPaths>{@HelpFormatOutputPaths}</outputPaths>
<allowMissingSource value="false" />
<removeRegionMarkers value="false" />
<colorizer syntaxFile="{@SHFBFolder}PresentationStyles\Colorizer\highlight.xml" styleFile="{@SHFBFolder}PresentationStyles\Colorizer\highlight.xsl" stylesheet="{@SHFBFolder}PresentationStyles\Colorizer\highlight.css" scriptFile="{@SHFBFolder}PresentationStyles\Colorizer\highlight.js" disabled="{@DisableCodeBlockComponent}" language="cs" tabSize="0" numberLines="false" outlining="false" keepSeeTags="false" defaultTitle="true" />
</component>
</ComponentConfig>
<ComponentConfig id="API Token Resolution" enabled="True">
<component id="API Token Resolution">{@TokenFiles}
<replace elements="/*//token" item="string(.)" /></component>
</ComponentConfig>
</ComponentConfigurations>
<PlugInConfigurations>
<PlugInConfig id="Documented Entities Only" enabled="True">
<configuration />
</PlugInConfig>
</PlugInConfigurations>
<TransformComponentArguments>
<Argument Key="logoFile" Value="" />
<Argument Key="logoHeight" Value="" />
<Argument Key="logoWidth" Value="" />
<Argument Key="logoAltText" Value="" />
<Argument Key="logoPlacement" Value="left" />
<Argument Key="logoAlignment" Value="left" />
<Argument Key="maxVersionParts" Value="" />
<Argument Key="defaultLanguage" Value="cs" />
<Argument Key="includeEnumValues" Value="true" />
<Argument Key="baseSourceCodeUrl" Value="" />
<Argument Key="requestExampleUrl" Value="" />
</TransformComponentArguments>
<CopyrightText>Copyright &amp;#169%3b 2018 plexdata.de</CopyrightText>
<CopyrightHref>http://www.plexdata.de/</CopyrightHref>
<NamespaceSummaries>
<NamespaceSummaryItem name="Plexdata.CsvParser.Attributes" isDocumented="True">The attributes namespace contains classes to be used to tag own classes as CSV document as well as to tag class properties as CSV columns.</NamespaceSummaryItem>
<NamespaceSummaryItem name="Plexdata.CsvParser.Constants" isDocumented="True">The constants namespace contains classes that support an easy access to all constant values provided by the library.</NamespaceSummaryItem>
<NamespaceSummaryItem name="Plexdata.CsvParser.Internals" isDocumented="True">The internals namespace contains classes that should not be used by the outside world.</NamespaceSummaryItem>
<NamespaceSummaryItem name="Plexdata.CsvParser.Processors" isDocumented="True">The processors namespace contains classes to import or export CSV files as well as to configure the importer's and the exporter's behaviour.</NamespaceSummaryItem>
<NamespaceSummaryItem name="Plexdata.CsvParser (Group)" isGroup="True" isDocumented="True" />
</NamespaceSummaries>
<ProjectSummary>&amp;lt%3bp&amp;gt%3b
The CSV Parser represents a library that allows importing and exporting of CSV files. Also, it is possible to configure the importing and exporting behavior.
&amp;lt%3b/p&amp;gt%3b
&amp;lt%3bp&amp;gt%3b
Main feature of this library is that users only need to create an own class representing a single line of a CSV file. Thereafter, this custom class is used either together with the importer or together with the exporter to process CSV files.
&amp;lt%3b/p&amp;gt%3b
&amp;lt%3bp&amp;gt%3b
Finally, it would also be possible %28assuming a proper configuration is used%29 to write a CSV output according to the rules of RFC 4180. For more information about RFC 4180 please visit the web-site under &amp;lt%3ba target=&amp;quot%3b_blank&amp;quot%3b href=&amp;quot%3bhttps://www.ietf.org/rfc/rfc4180.txt&amp;quot%3b&amp;gt%3bhttps://www.ietf.org/rfc/rfc4180.txt&amp;lt%3b/a&amp;gt%3b.
&amp;lt%3b/p&amp;gt%3b
&amp;lt%3bp&amp;gt%3b
&amp;lt%3bstrong&amp;gt%3bLicense&amp;lt%3b/strong&amp;gt%3b
&amp;lt%3b/p&amp;gt%3b
&amp;lt%3bp&amp;gt%3b
The software has been published under the terms of &amp;lt%3ba target=&amp;quot%3b_blank&amp;quot%3b href=&amp;quot%3bhttp://www.plexdata.de/licenses/mit.html&amp;quot%3b&amp;gt%3bMIT License&amp;lt%3b/a&amp;gt%3b.
&amp;lt%3b/p&amp;gt%3b
</ProjectSummary>
<FooterText>
</FooterText>
<WarnOnMissingSourceContext>False</WarnOnMissingSourceContext>
</PropertyGroup>
<!-- There are no properties for these groups. AnyCPU needs to appear in order for Visual Studio to perform
the build. The others are optional common platform types that may appear. -->
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|Win32' ">
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|Win32' ">
</PropertyGroup>
<!-- Import the SHFB build targets -->
<Import Project="$(SHFBROOT)\SandcastleHelpFileBuilder.targets" />
<!-- The pre-build and post-build event properties must appear *after* the targets file import in order to be
evaluated correctly. -->
<PropertyGroup>
<PreBuildEvent>
</PreBuildEvent>
<PostBuildEvent>
</PostBuildEvent>
<RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
</PropertyGroup>
</Project>
18 changes: 18 additions & 0 deletions code/hlp/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
## Overview

The help file project named ``Plexdata.CsvParser.NET.shfbproj`` has been created using [Sandcastle Help File Builder](https://ewsoftware.github.io/SHFB/html/bd1ddb51-1c4f-434f-bb1a-ce2135d3a909.htm) version v2018.7.8.0.

## Building the Help

Usually, there should be no need to change this file because of the CHM help file is automatically created during release build of the project sources via ``MSBuild.exe``. But if you like, you can download _Sandcastle Help File Builder_ from [https://github.com/EWSoftware/SHFB/releases](https://github.com/EWSoftware/SHFB/releases) and modify the project help fitting your own needs.

For example you may like to create an HTML version of the project API documentation. In such a case just download and install the _Sandcastle Help File Builder_ as mentioned above. Then follow the steps below:

- As first, you should create a copy of the help file project ``Plexdata.CsvParser.NET.shfbproj`` and rename it, for instance, into ``Plexdata.CsvParser.NET-HTML.shfbproj``.
- As next, open this new file with the _Sandcastle Help File Builder_.
- Thereafter, show tab _Project Properties_ and move to section _Build_.
- Now un-tick the _HTML help 1 (chm)_ setting and tick the setting _Website (HTML/ASP.NET)_ instead.
- Then you should change the output path accordingly. For this purpose move to section _Paths_ and modify the value of box _Help content output path_. For example you could change this path into ``html\``.
- Finally, rebuild the whole help.

After a successful build you will find the result inside the project file’s sub-folder you named above.
8 changes: 8 additions & 0 deletions code/src/HISTORY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@



**1.0.0.0**

- Initial draft.
- Released on [https://github.com/akesseler/Plexdata.CsvParser](https://github.com/akesseler/Plexdata.CsvParser).

Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
/*
* MIT License
*
* Copyright (c) 2018 plexdata.de
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/

using NUnit.Framework;
using Plexdata.CsvParser.Attributes;
using System;

namespace Plexdata.CsvParser.Tests.Attributes
{
[TestFixture]
[TestOf(nameof(CsvColumnAttribute))]
public class CsvColumnAttributeTests
{
[Test]
public void Construction_DefaultConstructor_ResultDoesNotThrow()
{
Assert.DoesNotThrow(() => { new CsvColumnAttribute(); });
}

[Test]
public void Construction_DefaultConstructor_ResultIsTrue()
{
CsvColumnAttribute attribute = new CsvColumnAttribute();
Assert.IsTrue(attribute.Header == String.Empty && attribute.Offset == -1);
}

[Test]
[TestCase(null)]
[TestCase("")]
[TestCase("test-header")]
public void Header_SetValue_ResultAreEqual(String expected)
{
CsvColumnAttribute attribute = new CsvColumnAttribute();
attribute.Header = expected;
Assert.AreEqual(expected, attribute.Header);
}

[Test]
[TestCase(-42)]
[TestCase(42)]
public void Offset_SetValue_ResultAreEqual(Int32 expected)
{
CsvColumnAttribute attribute = new CsvColumnAttribute();
attribute.Offset = expected;
Assert.AreEqual(expected, attribute.Offset);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*
* MIT License
*
* Copyright (c) 2018 plexdata.de
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/

using NUnit.Framework;
using Plexdata.CsvParser.Attributes;
using System;

namespace Plexdata.CsvParser.Tests.Attributes
{
[TestFixture]
[TestOf(nameof(CsvDocumentAttribute))]
public class CsvDocumentAttributeTests
{
[Test]
public void Construction_DefaultConstructor_ResultDoesNotThrow()
{
Assert.DoesNotThrow(() => { new CsvDocumentAttribute(); });
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*
* MIT License
*
* Copyright (c) 2018 plexdata.de
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/

using NUnit.Framework;
using Plexdata.CsvParser.Attributes;
using System;

namespace Plexdata.CsvParser.Tests.Attributes
{
[TestFixture]
[TestOf(nameof(CsvIgnoreAttribute))]
public class CsvIgnoreAttributeTests
{
[Test]
public void Construction_DefaultConstructor_ResultDoesNotThrow()
{
Assert.DoesNotThrow(() => { new CsvIgnoreAttribute(); });
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/*
* MIT License
*
* Copyright (c) 2018 plexdata.de
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/

using NUnit.Framework;
using Plexdata.CsvParser.Constants;
using System;

namespace Plexdata.CsvParser.Tests.Attributes
{
[TestFixture]
[TestOf(nameof(ColumnSeparators))]
public class ColumnSeparatorsTests
{
[Test]
[TestCase(':', ColumnSeparators.ColonSeparator)]
[TestCase(',', ColumnSeparators.CommaSeparator)]
[TestCase(';', ColumnSeparators.SemicolonSeparator)]
[TestCase('\t', ColumnSeparators.TabulatorSeparator)]
[TestCase(',', ColumnSeparators.DefaultSeparator)]
public void Verification_ColumnSeparators_ResultAreEqual(Char expected, Char actual)
{
Assert.AreEqual(expected, actual);
}
}
}
Loading

0 comments on commit 2dbee1f

Please sign in to comment.