From aed8ba58632df0f6116436e7af78591001fb169c Mon Sep 17 00:00:00 2001 From: Ryan O'Neill Date: Sun, 18 Dec 2022 18:53:48 +0000 Subject: [PATCH 01/40] New dev readme. --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 77aa687..10f9ca4 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ # GeneGenie.Gedcom -## Current work will be on the new dev branch, this branch is being kept here until that version is stable. +## Current working dev branch for code quality, .net 7 and improved tests. -A .Net 6.0 library for loading, saving, working with and analysing family trees stored in the GEDCOM format. +A .Net library for loading, saving, working with and analysing family trees stored in the GEDCOM format. Thank you to David A Knight who developed Gedcom.Net from which this project was forked. From f2832c3a42ba2cc058253dd8117f3fc4684b519d Mon Sep 17 00:00:00 2001 From: Ryan O'Neill Date: Sun, 18 Dec 2022 18:56:13 +0000 Subject: [PATCH 02/40] Update to .net 7. --- GeneGenie.Gedcom.Sample/GeneGenie.Gedcom.Sample.csproj | 2 +- GeneGenie.Gedcom.Tests/GeneGenie.Gedcom.Tests.csproj | 2 +- GeneGenie.Gedcom/GeneGenie.Gedcom.csproj | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/GeneGenie.Gedcom.Sample/GeneGenie.Gedcom.Sample.csproj b/GeneGenie.Gedcom.Sample/GeneGenie.Gedcom.Sample.csproj index 163b6b8..5e96d69 100644 --- a/GeneGenie.Gedcom.Sample/GeneGenie.Gedcom.Sample.csproj +++ b/GeneGenie.Gedcom.Sample/GeneGenie.Gedcom.Sample.csproj @@ -2,7 +2,7 @@ Exe - net6.0 + net7.0 diff --git a/GeneGenie.Gedcom.Tests/GeneGenie.Gedcom.Tests.csproj b/GeneGenie.Gedcom.Tests/GeneGenie.Gedcom.Tests.csproj index bc9585b..8b546bf 100644 --- a/GeneGenie.Gedcom.Tests/GeneGenie.Gedcom.Tests.csproj +++ b/GeneGenie.Gedcom.Tests/GeneGenie.Gedcom.Tests.csproj @@ -1,7 +1,7 @@  - net6.0 + net7.0 false 0.6 diff --git a/GeneGenie.Gedcom/GeneGenie.Gedcom.csproj b/GeneGenie.Gedcom/GeneGenie.Gedcom.csproj index 498cb16..38c394b 100644 --- a/GeneGenie.Gedcom/GeneGenie.Gedcom.csproj +++ b/GeneGenie.Gedcom/GeneGenie.Gedcom.csproj @@ -1,7 +1,7 @@  - net6.0 + net7.0 From 14607a1805cfbda81c2455d3ef1bbfd18a41b610 Mon Sep 17 00:00:00 2001 From: Ryan O'Neill Date: Mon, 19 Dec 2022 10:18:39 +0000 Subject: [PATCH 03/40] Remove AppVeyor, SonarQube, StyleCop before moving to GH Actions. --- README.md | 2 +- SonarQube.bat | 6 ------ appveyor.yml | 23 ----------------------- stylecop.json | 9 --------- 4 files changed, 1 insertion(+), 39 deletions(-) delete mode 100644 SonarQube.bat delete mode 100644 appveyor.yml delete mode 100644 stylecop.json diff --git a/README.md b/README.md index 10f9ca4..9d0eab3 100644 --- a/README.md +++ b/README.md @@ -68,7 +68,7 @@ You'll want to make sure that the file you just read was parsed OK and handle an GedcomRecordWriter.OutputGedcom(db, "Rewritten.ged"); ### Current build status -[![AppVeyor branch](https://img.shields.io/appveyor/ci/RyanONeill1970/genegenie-gedcom/master.svg)](https://ci.appveyor.com/project/RyanONeill1970/genegenie-gedcom) [![NuGet](https://img.shields.io/nuget/v/GeneGenie.Gedcom.svg)](https://www.nuget.org/packages/GeneGenie.Gedcom) [![AppVeyor tests](https://img.shields.io/appveyor/tests/RyanONeill1970/genegenie-gedcom.svg)](https://ci.appveyor.com/project/RyanONeill1970/genegenie-gedcom/build/tests) +Migrating to GitHub Actions ### Code quality [![Maintainability](https://sonarcloud.io/api/project_badges/measure?project=GeneGenie.Gedcom&metric=sqale_rating)](https://sonarcloud.io/dashboard?id=GeneGenie.Gedcom) [![Quality gate](https://sonarcloud.io/api/project_badges/measure?project=GeneGenie.Gedcom&metric=alert_status)](https://sonarcloud.io/dashboard?id=GeneGenie.Gedcom) [![Bugs](https://sonarcloud.io/api/project_badges/measure?project=GeneGenie.Gedcom&metric=bugs)](https://sonarcloud.io/component_measures?id=GeneGenie.Gedcom&metric=Reliability) [![Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=GeneGenie.Gedcom&metric=vulnerabilities)](https://sonarcloud.io/component_measures?id=GeneGenie.Gedcom&metric=Security) [![Code smells](https://sonarcloud.io/api/project_badges/measure?project=GeneGenie.Gedcom&metric=code_smells)](https://sonarcloud.io/component_measures?id=GeneGenie.Gedcom&metric=Maintainability) [![Coverage](https://sonarcloud.io/api/project_badges/measure?project=GeneGenie.Gedcom&metric=coverage)](https://sonarcloud.io/component_measures?id=GeneGenie.Gedcom&metric=Coverage) [![Duplications](https://sonarcloud.io/api/project_badges/measure?project=GeneGenie.Gedcom&metric=duplicated_lines_density)](https://sonarcloud.io/component_measures?id=GeneGenie.Gedcom&metric=Duplications) [![Reliability](https://sonarcloud.io/api/project_badges/measure?project=GeneGenie.Gedcom&metric=reliability_rating)](https://sonarcloud.io/dashboard?id=GeneGenie.Gedcom) [![Security](https://sonarcloud.io/api/project_badges/measure?project=GeneGenie.Gedcom&metric=security_rating)](https://sonarcloud.io/dashboard?id=GeneGenie.Gedcom) [![Security](https://sonarcloud.io/api/project_badges/measure?project=GeneGenie.Gedcom&metric=sqale_index)](https://sonarcloud.io/dashboard?id=GeneGenie.Gedcom) [![Lines of code](https://sonarcloud.io/api/project_badges/measure?project=GeneGenie.Gedcom&metric=ncloc)](https://sonarcloud.io/dashboard?id=GeneGenie.Gedcom) diff --git a/SonarQube.bat b/SonarQube.bat deleted file mode 100644 index 2d55d40..0000000 --- a/SonarQube.bat +++ /dev/null @@ -1,6 +0,0 @@ -dotnet tool install --global dotnet-sonarscanner --version 4.10.0 -dotnet test GeneGenie.Gedcom.Tests\GeneGenie.Gedcom.Tests.csproj /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:CoverletOutput="%CD%\opencover.xml" -dotnet build-server shutdown -dotnet sonarscanner begin /k:"GeneGenie.Gedcom" /o:"thegenegenieproject" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.login=%SonarQubeApiKey% /d:sonar.cs.opencover.reportsPaths="%CD%\opencover.xml" -dotnet build -dotnet sonarscanner end /d:sonar.login=%SonarQubeApiKey% diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 975b3a6..0000000 --- a/appveyor.yml +++ /dev/null @@ -1,23 +0,0 @@ -version: 1.0.{build} -image: Visual Studio 2017 -configuration: - - Release -before_build: -- cmd: nuget restore -build: - verbosity: minimal -after_build: -- cmd: dotnet pack GeneGenie.Gedcom\GeneGenie.Gedcom.csproj --configuration Release --output . --no-build -artifacts: -- path: '**/*.nupkg' - name: nugetpackage -deploy: -- provider: NuGet - api_key: - secure: bcYrYC8tAmSYcblYfwjk9upKKLg6kEuQbYVAw9knvBSu32OOfmtXPXHwpDqSCadQ - artifact: nugetpackage - on: - branch: master - -test_script: - - cmd: SonarQube.bat diff --git a/stylecop.json b/stylecop.json deleted file mode 100644 index b5ef429..0000000 --- a/stylecop.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "$schema": "https://raw.githubusercontent.com/DotNetAnalyzers/StyleCopAnalyzers/master/StyleCop.Analyzers/StyleCop.Analyzers/Settings/stylecop.schema.json", - "settings": { - "documentationRules": { - "companyName": "GeneGenie.com", - "copyrightText": "Copyright (c) {companyName}. All Rights Reserved.\r\nLicensed under the GNU Affero General Public License v3.0. See LICENSE in the project root for license information." - } - } -} From bc94602b8832042eb9ce252c292e9a771029223b Mon Sep 17 00:00:00 2001 From: Ryan O'Neill Date: Mon, 19 Dec 2022 10:22:52 +0000 Subject: [PATCH 04/40] Create codeql.yml --- .github/workflows/codeql.yml | 75 ++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 .github/workflows/codeql.yml diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 0000000..a49f7ea --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,75 @@ +# For most projects, this workflow file will not need changing; you simply need +# to commit it to your repository. +# +# You may wish to alter this file to override the set of languages analyzed, +# or to provide custom queries or build logic. +# +# ******** NOTE ******** +# We have attempted to detect the languages in your repository. Please check +# the `language` matrix defined below to confirm you have the correct set of +# supported CodeQL languages. +# +name: "CodeQL" + +on: + push: + branches: [ main, dev ] + pull_request: + # The branches below must be a subset of the branches above + branches: [ main, dev ] + schedule: + - cron: '23 12 * * 0' + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + permissions: + actions: read + contents: read + security-events: write + + strategy: + fail-fast: false + matrix: + language: [ 'csharp' ] + # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] + # Learn more about CodeQL language support at https://git.io/codeql-language-support + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Setup .Net SDK (v7.0) + uses: actions/setup-dotnet@v3 + with: + dotnet-version: '7.0.x' + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v2 + with: + languages: ${{ matrix.language }} + # If you wish to specify custom queries, you can do so here or in a config file. + # By default, queries listed here will override any specified in a config file. + # Prefix the list here with "+" to use these queries and those in the config file. + # queries: ./path/to/local/query, your-org/your-repo/queries@main + + # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). + # If this step fails, then you should remove it and run the build manually (see below) + - name: Autobuild + uses: github/codeql-action/autobuild@v2 + + # ℹ️ Command-line programs to run using the OS shell. + # 📚 https://git.io/JvXDl + + # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines + # and modify them (or add more) to build your code if your project + # uses a compiled language + + #- run: | + # make bootstrap + # make release + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v2 From 622ee1df5a502468894f7eb27cfcc3d089848248 Mon Sep 17 00:00:00 2001 From: Ryan O'Neill Date: Mon, 19 Dec 2022 10:23:14 +0000 Subject: [PATCH 05/40] Delete codeql-analysis.yml --- .github/workflows/codeql-analysis.yml | 71 --------------------------- 1 file changed, 71 deletions(-) delete mode 100644 .github/workflows/codeql-analysis.yml diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml deleted file mode 100644 index 3464d78..0000000 --- a/.github/workflows/codeql-analysis.yml +++ /dev/null @@ -1,71 +0,0 @@ -# For most projects, this workflow file will not need changing; you simply need -# to commit it to your repository. -# -# You may wish to alter this file to override the set of languages analyzed, -# or to provide custom queries or build logic. -name: "CodeQL" - -on: - push: - branches: [master] - pull_request: - # The branches below must be a subset of the branches above - branches: [master] - schedule: - - cron: '0 8 * * 5' - -jobs: - analyze: - name: Analyze - runs-on: ubuntu-latest - - strategy: - fail-fast: false - matrix: - # Override automatic language detection by changing the below list - # Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python'] - language: ['csharp'] - # Learn more... - # https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection - - steps: - - name: Checkout repository - uses: actions/checkout@v2 - with: - # We must fetch at least the immediate parents so that if this is - # a pull request then we can checkout the head. - fetch-depth: 2 - - # If this run was triggered by a pull request event, then checkout - # the head of the pull request instead of the merge commit. - - run: git checkout HEAD^2 - if: ${{ github.event_name == 'pull_request' }} - - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v1 - with: - languages: ${{ matrix.language }} - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. - # queries: ./path/to/local/query, your-org/your-repo/queries@main - - # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). - # If this step fails, then you should remove it and run the build manually (see below) - - name: Autobuild - uses: github/codeql-action/autobuild@v1 - - # ℹ️ Command-line programs to run using the OS shell. - # 📚 https://git.io/JvXDl - - # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines - # and modify them (or add more) to build your code if your project - # uses a compiled language - - #- run: | - # make bootstrap - # make release - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v1 From 9c91deb44a38aa09b4f8f19e30b6ff5e8f0f4f7b Mon Sep 17 00:00:00 2001 From: Ryan O'Neill Date: Mon, 19 Dec 2022 10:25:19 +0000 Subject: [PATCH 06/40] Create sonar.yml --- .github/workflows/sonar.yml | 43 +++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/workflows/sonar.yml diff --git a/.github/workflows/sonar.yml b/.github/workflows/sonar.yml new file mode 100644 index 0000000..aa1bde0 --- /dev/null +++ b/.github/workflows/sonar.yml @@ -0,0 +1,43 @@ +name: SonarCloud + +on: + push: + branches: [ main, dev ] + pull_request: + branches: [ main, dev ] + types: [opened, synchronize, reopened] + +jobs: + build: + name: Build and analyze + runs-on: ubuntu-latest + steps: + - name: Set up JDK 11 + uses: actions/setup-java@v3 + with: + distribution: 'zulu' + java-version: '11' + java-package: jdk # optional (jdk or jre) - defaults to jdk + + - uses: actions/checkout@v3 + with: + fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis + + - name: Setup .Net SDK (v7.0) + uses: actions/setup-dotnet@v3 + with: + dotnet-version: '7.0.x' + + - name: Install dotnet global tools + run: | + dotnet tool install --global dotnet-coverage + dotnet tool install --global dotnet-sonarscanner + - name: Build and analyze + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + run: | + dotnet sonarscanner begin /k:"GeneGenie.DataQuality" /o:"thegenegenieproject" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.vscoveragexml.reportsPaths=coverage.xml + dotnet build --no-incremental + dotnet-coverage collect 'dotnet test' -f xml -o 'coverage.xml' + dotnet sonarscanner end From eb6ed800c446a7b56c788ddf0cffbb7bbb05cd5b Mon Sep 17 00:00:00 2001 From: Ryan O'Neill Date: Mon, 19 Dec 2022 10:28:37 +0000 Subject: [PATCH 07/40] Point readme status badges at new workflow. --- README.md | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 9d0eab3..6dbd607 100644 --- a/README.md +++ b/README.md @@ -67,14 +67,24 @@ You'll want to make sure that the file you just read was parsed OK and handle an GedcomRecordWriter.OutputGedcom(db, "Rewritten.ged"); -### Current build status -Migrating to GitHub Actions +## Build status +[![Build and run tests](https://github.com/TheGeneGenieProject/GeneGenie.Gedcom/actions/workflows/sonar.yml/badge.svg)](https://github.com/TheGeneGenieProject/GeneGenie.Gedcom/actions/workflows/sonar.yml) ### Code quality -[![Maintainability](https://sonarcloud.io/api/project_badges/measure?project=GeneGenie.Gedcom&metric=sqale_rating)](https://sonarcloud.io/dashboard?id=GeneGenie.Gedcom) [![Quality gate](https://sonarcloud.io/api/project_badges/measure?project=GeneGenie.Gedcom&metric=alert_status)](https://sonarcloud.io/dashboard?id=GeneGenie.Gedcom) [![Bugs](https://sonarcloud.io/api/project_badges/measure?project=GeneGenie.Gedcom&metric=bugs)](https://sonarcloud.io/component_measures?id=GeneGenie.Gedcom&metric=Reliability) [![Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=GeneGenie.Gedcom&metric=vulnerabilities)](https://sonarcloud.io/component_measures?id=GeneGenie.Gedcom&metric=Security) [![Code smells](https://sonarcloud.io/api/project_badges/measure?project=GeneGenie.Gedcom&metric=code_smells)](https://sonarcloud.io/component_measures?id=GeneGenie.Gedcom&metric=Maintainability) [![Coverage](https://sonarcloud.io/api/project_badges/measure?project=GeneGenie.Gedcom&metric=coverage)](https://sonarcloud.io/component_measures?id=GeneGenie.Gedcom&metric=Coverage) [![Duplications](https://sonarcloud.io/api/project_badges/measure?project=GeneGenie.Gedcom&metric=duplicated_lines_density)](https://sonarcloud.io/component_measures?id=GeneGenie.Gedcom&metric=Duplications) [![Reliability](https://sonarcloud.io/api/project_badges/measure?project=GeneGenie.Gedcom&metric=reliability_rating)](https://sonarcloud.io/dashboard?id=GeneGenie.Gedcom) [![Security](https://sonarcloud.io/api/project_badges/measure?project=GeneGenie.Gedcom&metric=security_rating)](https://sonarcloud.io/dashboard?id=GeneGenie.Gedcom) [![Security](https://sonarcloud.io/api/project_badges/measure?project=GeneGenie.Gedcom&metric=sqale_index)](https://sonarcloud.io/dashboard?id=GeneGenie.Gedcom) [![Lines of code](https://sonarcloud.io/api/project_badges/measure?project=GeneGenie.Gedcom&metric=ncloc)](https://sonarcloud.io/dashboard?id=GeneGenie.Gedcom) - -[![Build stats](https://buildstats.info/appveyor/chart/ryanoneill1970/genegenie-gedcom)](https://ci.appveyor.com/project/ryanoneill1970/genegenie-gedcom/history) +[![Bugs](https://sonarcloud.io/api/project_badges/measure?project=GeneGenie.Gedcom&metric=bugs)](https://sonarcloud.io/summary/new_code?id=GeneGenie.Gedcom) +[![CodeQL](https://github.com/TheGeneGenieProject/GeneGenie.Gedcom/actions/workflows/codeql.yml/badge.svg)](https://github.com/TheGeneGenieProject/GeneGenie.Gedcom/actions/workflows/codeql.yml) +[![Code Smells](https://sonarcloud.io/api/project_badges/measure?project=GeneGenie.Gedcom&metric=code_smells)](https://sonarcloud.io/summary/new_code?id=GeneGenie.Gedcom) +[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=GeneGenie.Gedcom&metric=coverage)](https://sonarcloud.io/summary/new_code?id=GeneGenie.Gedcom) +[![Duplicated Lines (%)](https://sonarcloud.io/api/project_badges/measure?project=GeneGenie.Gedcom&metric=duplicated_lines_density)](https://sonarcloud.io/summary/new_code?id=GeneGenie.Gedcom) +[![Lines of Code](https://sonarcloud.io/api/project_badges/measure?project=GeneGenie.Gedcom&metric=ncloc)](https://sonarcloud.io/summary/new_code?id=GeneGenie.Gedcom) +[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=GeneGenie.Gedcom&metric=sqale_rating)](https://sonarcloud.io/summary/new_code?id=GeneGenie.Gedcom) +[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=GeneGenie.Gedcom&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=GeneGenie.Gedcom) +[![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=GeneGenie.Gedcom&metric=reliability_rating)](https://sonarcloud.io/summary/new_code?id=GeneGenie.Gedcom) +[![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=GeneGenie.Gedcom&metric=security_rating)](https://sonarcloud.io/summary/new_code?id=GeneGenie.Gedcom) +[![Technical Debt](https://sonarcloud.io/api/project_badges/measure?project=GeneGenie.Gedcom&metric=sqale_index)](https://sonarcloud.io/summary/new_code?id=GeneGenie.Gedcom) +[![Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=GeneGenie.Gedcom&metric=vulnerabilities)](https://sonarcloud.io/summary/new_code?id=GeneGenie.Gedcom) ## Contributing We would love your help, see [Contributing.md](Contributing.md) for guidelines. + From cde6aef9f48f4457d29d59c292778d97c2dc39f8 Mon Sep 17 00:00:00 2001 From: Ryan O'Neill Date: Mon, 19 Dec 2022 10:34:17 +0000 Subject: [PATCH 08/40] Delete more StyleCop. --- Contributing.md | 2 +- .../GeneGenie.Gedcom.Sample.csproj | 14 +------------- .../GeneGenie.Gedcom.Tests.csproj | 12 ------------ GeneGenie.Gedcom/GeneGenie.Gedcom.csproj | 9 --------- GlobalSuppressions.cs | 6 ------ 5 files changed, 2 insertions(+), 41 deletions(-) delete mode 100644 GlobalSuppressions.cs diff --git a/Contributing.md b/Contributing.md index 29f4f36..cd5e943 100644 --- a/Contributing.md +++ b/Contributing.md @@ -30,4 +30,4 @@ Major changes should have benchmarks wrapped around the old and new code to prov ### Style guidelines -The StyleCop.Analyzer nuget package is used in all projects to help enforce style guidelines. These guidelines are there to ensure a consistent style, I don't necessarily agree with all of them but they represent a good compromise. When we remove the final few build warnings from the compiler, style violations will be treated as errors and will halt any build. +The .editorconfig settings file is used in all projects to help enforce style guidelines. These guidelines are there to ensure a consistent style, I don't necessarily agree with all of them but they represent a good compromise. When we remove the final few build warnings from the compiler, style violations will be treated as errors and will halt any build. diff --git a/GeneGenie.Gedcom.Sample/GeneGenie.Gedcom.Sample.csproj b/GeneGenie.Gedcom.Sample/GeneGenie.Gedcom.Sample.csproj index 5e96d69..8adaf74 100644 --- a/GeneGenie.Gedcom.Sample/GeneGenie.Gedcom.Sample.csproj +++ b/GeneGenie.Gedcom.Sample/GeneGenie.Gedcom.Sample.csproj @@ -1,4 +1,4 @@ - + Exe @@ -17,18 +17,6 @@ - - - - - - - - - - all - runtime; build; native; contentfiles; analyzers - diff --git a/GeneGenie.Gedcom.Tests/GeneGenie.Gedcom.Tests.csproj b/GeneGenie.Gedcom.Tests/GeneGenie.Gedcom.Tests.csproj index 8b546bf..f0e2ab6 100644 --- a/GeneGenie.Gedcom.Tests/GeneGenie.Gedcom.Tests.csproj +++ b/GeneGenie.Gedcom.Tests/GeneGenie.Gedcom.Tests.csproj @@ -22,24 +22,12 @@ - - - - - - - - all runtime; build; native; contentfiles; analyzers - - all - runtime; build; native; contentfiles; analyzers - all diff --git a/GeneGenie.Gedcom/GeneGenie.Gedcom.csproj b/GeneGenie.Gedcom/GeneGenie.Gedcom.csproj index 38c394b..2609116 100644 --- a/GeneGenie.Gedcom/GeneGenie.Gedcom.csproj +++ b/GeneGenie.Gedcom/GeneGenie.Gedcom.csproj @@ -15,13 +15,8 @@ $(OutputPath)$(AssemblyName).xml - - - - - @@ -29,10 +24,6 @@ - - all - runtime; build; native; contentfiles; analyzers - diff --git a/GlobalSuppressions.cs b/GlobalSuppressions.cs deleted file mode 100644 index ab8eab0..0000000 --- a/GlobalSuppressions.cs +++ /dev/null @@ -1,6 +0,0 @@ -// -// Copyright (c) GeneGenie.com. All Rights Reserved. -// Licensed under the GNU Affero General Public License v3.0. See LICENSE in the project root for license information. -// - -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.ReadabilityRules", "SA1101:Prefix local calls with this", Justification = "Reviewed")] From d162ba65b05efa31b3731bacc7c9d246c8d5e56a Mon Sep 17 00:00:00 2001 From: Ryan O'Neill Date: Mon, 19 Dec 2022 10:39:43 +0000 Subject: [PATCH 09/40] Fix case of Ansel.ged file not able to be found in Linux. --- .../EncoderTests/GedcomAnselEncoderTest.cs | 8 ++++---- GeneGenie.Gedcom.Tests/GeneGenie.Gedcom.Tests.xml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/GeneGenie.Gedcom.Tests/EncoderTests/GedcomAnselEncoderTest.cs b/GeneGenie.Gedcom.Tests/EncoderTests/GedcomAnselEncoderTest.cs index 0687711..4660a7e 100644 --- a/GeneGenie.Gedcom.Tests/EncoderTests/GedcomAnselEncoderTest.cs +++ b/GeneGenie.Gedcom.Tests/EncoderTests/GedcomAnselEncoderTest.cs @@ -22,7 +22,7 @@ public class GedcomAnselEncoderTest [Fact] public void Ansel_charset_is_recognised() { - var reader = GedcomRecordReader.CreateReader("./Data/Ansel.ged"); + var reader = GedcomRecordReader.CreateReader("./Data/ANSEL.GED"); Assert.Equal(GedcomCharset.Ansel, reader.Parser.Charset); } @@ -34,7 +34,7 @@ public void Ansel_charset_is_recognised() [Fact] public void Record_count_is_33_children_plus_two_parents() { - var reader = GedcomRecordReader.CreateReader("./Data/Ansel.ged"); + var reader = GedcomRecordReader.CreateReader("./Data/ANSEL.GED"); Assert.Equal(35, reader.Database.Individuals.Count); } @@ -44,7 +44,7 @@ public void Record_count_is_33_children_plus_two_parents() /// The expected test data has been rigorously checked to ensure the Unicode characters match exactly. If your editor /// is not Unicode aware updates them, they'll probably fail. /// - /// The name of the child test record in the Ansel.ged file. + /// The name of the child test record in the ANSEL.GED file. /// The expected text to find in the birth place field, after translation to Unicode. /// The expected text to find in the death place field, after translation to Unicode. [Theory] @@ -83,7 +83,7 @@ public void Record_count_is_33_children_plus_two_parents() [InlineData("code: FE (Unicode: comma above, 0313) /high comma, centered/", "A̓B̓C̓D̓E̓F̓G̓H̓I̓J̓K̓L̓M̓N̓O̓P̓Q̓R̓S̓T̓U̓V̓W̓X̓Y̓Z̓", "a̓b̓c̓d̓e̓f̓g̓h̓i̓j̓k̓l̓m̓n̓o̓p̓q̓r̓s̓t̓u̓v̓w̓x̓y̓z̓")] public void Characters_can_be_translated_to_unicode(string childName, string birthPlace, string deathPlace) { - var reader = GedcomRecordReader.CreateReader("./Data/Ansel.ged"); + var reader = GedcomRecordReader.CreateReader("./Data/ANSEL.GED"); var child = reader.Database.Individuals.First(i => i.GetName().Name == childName); diff --git a/GeneGenie.Gedcom.Tests/GeneGenie.Gedcom.Tests.xml b/GeneGenie.Gedcom.Tests/GeneGenie.Gedcom.Tests.xml index 21d036b..92b94a8 100644 --- a/GeneGenie.Gedcom.Tests/GeneGenie.Gedcom.Tests.xml +++ b/GeneGenie.Gedcom.Tests/GeneGenie.Gedcom.Tests.xml @@ -53,7 +53,7 @@ The expected test data has been rigorously checked to ensure the Unicode characters match exactly. If your editor is not Unicode aware updates them, they'll probably fail. - The name of the child test record in the Ansel.ged file. + The name of the child test record in the ANSEL.GED file. The expected text to find in the birth place field, after translation to Unicode. The expected text to find in the death place field, after translation to Unicode. From 0830757e50b8d281ad587dca6b29c6e02f10a91d Mon Sep 17 00:00:00 2001 From: Ryan O'Neill Date: Mon, 19 Dec 2022 10:44:53 +0000 Subject: [PATCH 10/40] Revert line feed tests as failing under Linux. Needs work for cross platform. --- GeneGenie.Gedcom.Tests/GedcomIdentTest.cs | 2 +- GeneGenie.Gedcom.Tests/GedcomSimpleTest.cs | 2 +- .../RecordReaderTests/GedcomRecordCountTest.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/GeneGenie.Gedcom.Tests/GedcomIdentTest.cs b/GeneGenie.Gedcom.Tests/GedcomIdentTest.cs index 9fe3d7a..9e68dbb 100644 --- a/GeneGenie.Gedcom.Tests/GedcomIdentTest.cs +++ b/GeneGenie.Gedcom.Tests/GedcomIdentTest.cs @@ -31,7 +31,7 @@ private void Multiline_note_is_read_when_dodgy_ident_tag_is_used() var noteXref = reader.Database.Individuals.Single().Notes.First(); var note = reader.Database.Notes.Single(n => n.XrefId == noteXref); - Assert.Equal("First line of a note.\r\nSecond line of a note.\r\nThird line of a note.", note.Text); + Assert.Equal("First line of a note.\nSecond line of a note.\nThird line of a note.", note.Text); } [Fact] diff --git a/GeneGenie.Gedcom.Tests/GedcomSimpleTest.cs b/GeneGenie.Gedcom.Tests/GedcomSimpleTest.cs index 8545ab1..35abb6e 100644 --- a/GeneGenie.Gedcom.Tests/GedcomSimpleTest.cs +++ b/GeneGenie.Gedcom.Tests/GedcomSimpleTest.cs @@ -44,7 +44,7 @@ private void Creator_address() { var reader = GetReader("./Data/simple.ged"); var creatorAddress = reader.Database.Submitters.SingleOrDefault()?.Address.AddressLine; - Assert.Equal("Submitters address\r\naddress continued here", creatorAddress); + Assert.Equal("Submitters address\naddress continued here", creatorAddress); } [Fact] diff --git a/GeneGenie.Gedcom.Tests/RecordReaderTests/GedcomRecordCountTest.cs b/GeneGenie.Gedcom.Tests/RecordReaderTests/GedcomRecordCountTest.cs index dcf0159..ad211f8 100644 --- a/GeneGenie.Gedcom.Tests/RecordReaderTests/GedcomRecordCountTest.cs +++ b/GeneGenie.Gedcom.Tests/RecordReaderTests/GedcomRecordCountTest.cs @@ -52,7 +52,7 @@ private void Submitter_name_can_be_read(string file, string expectedName) } [Theory] - [InlineData("./Data/allged.ged", "Corporation address line 1\r\nCorporation address line 2\r\nCorporation address line 3\r\nCorporation address line 4")] + [InlineData("./Data/allged.ged", "Corporation address line 1\nCorporation address line 2\nCorporation address line 3\nCorporation address line 4")] private void Corporation_address_can_be_read(string file, string expected) { var reader = GedcomRecordReader.CreateReader(file); From dbf70fd7980f9a1dc6e59b8b4cf97646de708597 Mon Sep 17 00:00:00 2001 From: Ryan O'Neill Date: Mon, 19 Dec 2022 10:47:39 +0000 Subject: [PATCH 11/40] Set up editorconfig standards. --- .editorconfig | 102 ++++++++++++++++++++++---- GeneGenie.Gedcom.Sample/.editorconfig | 7 ++ GeneGenie.Gedcom.Tests/.editorconfig | 17 +++-- 3 files changed, 106 insertions(+), 20 deletions(-) create mode 100644 GeneGenie.Gedcom.Sample/.editorconfig diff --git a/.editorconfig b/.editorconfig index 4817c21..2b1d7c2 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,21 +1,95 @@ -############################### -# Core EditorConfig Options # -############################### -root = true + # All files [*] indent_style = space +csharp_indent_labels = one_less_than_current +csharp_using_directive_placement = inside_namespace:suggestion +csharp_prefer_simple_using_statement = true:suggestion +csharp_prefer_braces = true:silent +csharp_style_namespace_declarations = block_scoped:silent +csharp_style_prefer_method_group_conversion = true:silent +csharp_style_prefer_top_level_statements = true:silent +csharp_style_expression_bodied_methods = false:silent +csharp_style_expression_bodied_constructors = false:silent +csharp_style_expression_bodied_operators = false:silent +csharp_style_expression_bodied_properties = true:silent +csharp_style_expression_bodied_indexers = true:silent +csharp_style_expression_bodied_accessors = true:silent +csharp_style_expression_bodied_lambdas = true:silent +csharp_style_expression_bodied_local_functions = false:silent +csharp_style_throw_expression = true:suggestion +dotnet_diagnostic.IDE0073.severity = error -# XML project files -[*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj}] -indent_size = 4 +# Xml files +[*.xml] +indent_size = 2 -# XML config files -[*.{props,targets,ruleset,config,nuspec,resx,vsixmanifest,vsct}] -indent_size = 4 +[*.{cs,vb}] +#### Naming styles #### + +# Naming rules + +dotnet_naming_rule.interface_should_be_begins_with_i.severity = suggestion +dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface +dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i + +dotnet_naming_rule.types_should_be_pascal_case.severity = suggestion +dotnet_naming_rule.types_should_be_pascal_case.symbols = types +dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case + +dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = suggestion +dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members +dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case + +# Symbol specifications -# Code files -[*.{cs,csx,vb,vbx}] +dotnet_naming_symbols.interface.applicable_kinds = interface +dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected +dotnet_naming_symbols.interface.required_modifiers = + +dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum +dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected +dotnet_naming_symbols.types.required_modifiers = + +dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method +dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected +dotnet_naming_symbols.non_field_members.required_modifiers = + +# Naming styles + +dotnet_naming_style.begins_with_i.required_prefix = I +dotnet_naming_style.begins_with_i.required_suffix = +dotnet_naming_style.begins_with_i.word_separator = +dotnet_naming_style.begins_with_i.capitalization = pascal_case + +dotnet_naming_style.pascal_case.required_prefix = +dotnet_naming_style.pascal_case.required_suffix = +dotnet_naming_style.pascal_case.word_separator = +dotnet_naming_style.pascal_case.capitalization = pascal_case + +dotnet_naming_style.pascal_case.required_prefix = +dotnet_naming_style.pascal_case.required_suffix = +dotnet_naming_style.pascal_case.word_separator = +dotnet_naming_style.pascal_case.capitalization = pascal_case +dotnet_style_operator_placement_when_wrapping = beginning_of_line +tab_width = 4 indent_size = 4 -insert_final_newline = true -charset = utf-8-bom +end_of_line = crlf +dotnet_style_coalesce_expression = true:suggestion +dotnet_style_null_propagation = true:suggestion +dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion +dotnet_style_prefer_auto_properties = true:silent +dotnet_style_object_initializer = true:suggestion +dotnet_style_collection_initializer = true:suggestion +dotnet_style_prefer_simplified_boolean_expressions = true:suggestion +dotnet_style_prefer_conditional_expression_over_assignment = true:silent +dotnet_style_prefer_conditional_expression_over_return = true:silent +dotnet_style_explicit_tuple_names = true:suggestion +dotnet_style_prefer_inferred_tuple_names = true:suggestion +dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion +dotnet_style_prefer_compound_assignment = true:suggestion +dotnet_style_prefer_simplified_interpolation = true:suggestion +dotnet_style_namespace_match_folder = true:suggestion + +# License header +file_header_template = \r\nCopyright (c) GeneGenie.com. All Rights Reserved.\r\nLicensed under the GNU Affero General Public License v3.0. See LICENSE in the project root for license information.\r\n diff --git a/GeneGenie.Gedcom.Sample/.editorconfig b/GeneGenie.Gedcom.Sample/.editorconfig new file mode 100644 index 0000000..4c77e11 --- /dev/null +++ b/GeneGenie.Gedcom.Sample/.editorconfig @@ -0,0 +1,7 @@ +# Allow inheritence of settings from directory above. +root = false + +[*.{cs,vb}] +dotnet_diagnostic.CA1303.severity = none +dotnet_diagnostic.CA1812.severity = none +dotnet_diagnostic.CA1848.severity = none diff --git a/GeneGenie.Gedcom.Tests/.editorconfig b/GeneGenie.Gedcom.Tests/.editorconfig index f5e3c01..4db2cf6 100644 --- a/GeneGenie.Gedcom.Tests/.editorconfig +++ b/GeneGenie.Gedcom.Tests/.editorconfig @@ -1,7 +1,12 @@ -[*.cs] +# Allow inheritence of settings from directory above. +root = false -# CS1591: Missing XML comment for publicly visible type or member -dotnet_diagnostic.CS1591.severity = none - -# SA1600: Elements should be documented -dotnet_diagnostic.SA1600.severity = none +# Remove junk warnings from unit tests, mostly because we are certain of the input data. +[*.{cs,vb}] +dotnet_diagnostic.CA1062.severity = none +dotnet_diagnostic.CA1307.severity = none +dotnet_diagnostic.CA1310.severity = none +dotnet_diagnostic.CA1707.severity = none +dotnet_diagnostic.CA1812.severity = none +dotnet_diagnostic.CA2007.severity = none +dotnet_diagnostic.IDE0057.severity = none From d46403f9d30c3a47ddc7051f9ecf0c4c9bf96418 Mon Sep 17 00:00:00 2001 From: Ryan O'Neill Date: Mon, 19 Dec 2022 10:52:54 +0000 Subject: [PATCH 12/40] More cross platform path test fixes. --- GeneGenie.Gedcom.Sample/Step1LoadTreeFromFile.cs | 2 +- GeneGenie.Gedcom.Tests/GedcomXRefTest.cs | 8 ++++---- README.md | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/GeneGenie.Gedcom.Sample/Step1LoadTreeFromFile.cs b/GeneGenie.Gedcom.Sample/Step1LoadTreeFromFile.cs index 22d3883..0d882f2 100644 --- a/GeneGenie.Gedcom.Sample/Step1LoadTreeFromFile.cs +++ b/GeneGenie.Gedcom.Sample/Step1LoadTreeFromFile.cs @@ -32,7 +32,7 @@ public static GedcomDatabase LoadPresidentsTree() private static GedcomDatabase LoadGedcomFromFile() { - var gedcomReader = GedcomRecordReader.CreateReader("Data\\presidents.ged"); + var gedcomReader = GedcomRecordReader.CreateReader("Data/presidents.ged"); if (gedcomReader.Parser.ErrorState != Enums.GedcomErrorState.NoError) { Console.WriteLine($"Could not read file, encountered error {gedcomReader.Parser.ErrorState} press a key to continue."); diff --git a/GeneGenie.Gedcom.Tests/GedcomXRefTest.cs b/GeneGenie.Gedcom.Tests/GedcomXRefTest.cs index 58c5d2f..7e120ea 100644 --- a/GeneGenie.Gedcom.Tests/GedcomXRefTest.cs +++ b/GeneGenie.Gedcom.Tests/GedcomXRefTest.cs @@ -18,10 +18,10 @@ namespace GeneGenie.Gedcom.Tests public class GedcomXRefTest { [Theory] - [InlineData(".\\Data\\simple.ged")] - [InlineData(".\\Data\\presidents.ged")] - [InlineData(".\\Data\\Spouse-sealing.ged")] - [InlineData(".\\Data\\superfluous-ident-test.ged")] + [InlineData("./Data/simple.ged")] + [InlineData("./Data/presidents.ged")] + [InlineData("./Data/Spouse-sealing.ged")] + [InlineData("./Data/superfluous-ident-test.ged")] private void Original_record_id(string sourceFile) { var originalReader = GedcomRecordReader.CreateReader(sourceFile, false); diff --git a/README.md b/README.md index 6dbd607..b989542 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ Check the sample project out for working code, basic operations are; To load a tree into memory use the following static helper. - var gedcomReader = GedcomRecordReader.CreateReader("Data\\presidents.ged"); + var gedcomReader = GedcomRecordReader.CreateReader("Data/presidents.ged"); There are other variants of this helper and non static methods that allow you to specify additional parameters such as encoding. From b2bbc7eab483f6d2973e33b7084d1e251c9c9ac9 Mon Sep 17 00:00:00 2001 From: Ryan O'Neill Date: Mon, 19 Dec 2022 11:02:20 +0000 Subject: [PATCH 13/40] Remove duplicated copyright noise text. --- GeneGenie.Gedcom.Sample/Program.cs | 1 - GeneGenie.Gedcom.Sample/Step2QueryTree.cs | 1 - GeneGenie.Gedcom.Tests/Date/GedcomDateCompareTest.cs | 1 - GeneGenie.Gedcom/GedcomChangeDate.cs | 2 -- 4 files changed, 5 deletions(-) diff --git a/GeneGenie.Gedcom.Sample/Program.cs b/GeneGenie.Gedcom.Sample/Program.cs index 59cadc4..92e2bbb 100644 --- a/GeneGenie.Gedcom.Sample/Program.cs +++ b/GeneGenie.Gedcom.Sample/Program.cs @@ -2,7 +2,6 @@ // Copyright (c) GeneGenie.com. All Rights Reserved. // Licensed under the GNU Affero General Public License v3.0. See LICENSE in the project root for license information. // -// Copyright (C) 2016 Ryan O'Neill r@genegenie.com namespace GeneGenie.Gedcom.Sample { diff --git a/GeneGenie.Gedcom.Sample/Step2QueryTree.cs b/GeneGenie.Gedcom.Sample/Step2QueryTree.cs index 74ed346..22254e3 100644 --- a/GeneGenie.Gedcom.Sample/Step2QueryTree.cs +++ b/GeneGenie.Gedcom.Sample/Step2QueryTree.cs @@ -2,7 +2,6 @@ // Copyright (c) GeneGenie.com. All Rights Reserved. // Licensed under the GNU Affero General Public License v3.0. See LICENSE in the project root for license information. // -// Copyright (C) 2016 Ryan O'Neill r@genegenie.com namespace GeneGenie.Gedcom.Sample { diff --git a/GeneGenie.Gedcom.Tests/Date/GedcomDateCompareTest.cs b/GeneGenie.Gedcom.Tests/Date/GedcomDateCompareTest.cs index 50ca731..62d2c28 100644 --- a/GeneGenie.Gedcom.Tests/Date/GedcomDateCompareTest.cs +++ b/GeneGenie.Gedcom.Tests/Date/GedcomDateCompareTest.cs @@ -2,7 +2,6 @@ // Copyright (c) GeneGenie.com. All Rights Reserved. // Licensed under the GNU Affero General Public License v3.0. See LICENSE in the project root for license information. // -// Copyright (C) 2016 Ryan O'Neill r@genegenie.com namespace GeneGenie.Gedcom.Date.Tests { diff --git a/GeneGenie.Gedcom/GedcomChangeDate.cs b/GeneGenie.Gedcom/GedcomChangeDate.cs index d4a7fd7..a3e6940 100644 --- a/GeneGenie.Gedcom/GedcomChangeDate.cs +++ b/GeneGenie.Gedcom/GedcomChangeDate.cs @@ -2,8 +2,6 @@ // Copyright (c) GeneGenie.com. All Rights Reserved. // Licensed under the GNU Affero General Public License v3.0. See LICENSE in the project root for license information. // -// Copyright (C) 2008 David A Knight david@ritter.demon.co.uk -// Copyright (C) 2016 Ryan O'Neill r@genegenie.com namespace GeneGenie.Gedcom { From 95b7c3db0fc3706f8bf17808bb4a1fc4900650fc Mon Sep 17 00:00:00 2001 From: Ryan O'Neill Date: Mon, 19 Dec 2022 11:07:45 +0000 Subject: [PATCH 14/40] Update sonar.yml --- .github/workflows/sonar.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sonar.yml b/.github/workflows/sonar.yml index aa1bde0..be604af 100644 --- a/.github/workflows/sonar.yml +++ b/.github/workflows/sonar.yml @@ -37,7 +37,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} run: | - dotnet sonarscanner begin /k:"GeneGenie.DataQuality" /o:"thegenegenieproject" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.vscoveragexml.reportsPaths=coverage.xml + dotnet sonarscanner begin /k:"GeneGenie.Gedcom" /o:"thegenegenieproject" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.vscoveragexml.reportsPaths=coverage.xml dotnet build --no-incremental dotnet-coverage collect 'dotnet test' -f xml -o 'coverage.xml' dotnet sonarscanner end From 38f6c865addfc0b73d9bb623f109061720e4398d Mon Sep 17 00:00:00 2001 From: Ryan O'Neill Date: Mon, 19 Dec 2022 11:24:33 +0000 Subject: [PATCH 15/40] Trigger build. --- GeneGenie.Gedcom.Tests/Date/GedcomDateMatchTest.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/GeneGenie.Gedcom.Tests/Date/GedcomDateMatchTest.cs b/GeneGenie.Gedcom.Tests/Date/GedcomDateMatchTest.cs index 0eaee55..e02ec78 100644 --- a/GeneGenie.Gedcom.Tests/Date/GedcomDateMatchTest.cs +++ b/GeneGenie.Gedcom.Tests/Date/GedcomDateMatchTest.cs @@ -2,7 +2,6 @@ // Copyright (c) GeneGenie.com. All Rights Reserved. // Licensed under the GNU Affero General Public License v3.0. See LICENSE in the project root for license information. // -// Copyright (C) 2016 Ryan O'Neill r@genegenie.com namespace GeneGenie.Gedcom.Date.Tests { From 63973d67fd9968d1e5897595e579599d63f2fc94 Mon Sep 17 00:00:00 2001 From: Ryan O'Neill Date: Mon, 19 Dec 2022 11:31:01 +0000 Subject: [PATCH 16/40] Rework test. --- .../Date/GedcomDateMatchTest.cs | 30 ++++++++----------- 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/GeneGenie.Gedcom.Tests/Date/GedcomDateMatchTest.cs b/GeneGenie.Gedcom.Tests/Date/GedcomDateMatchTest.cs index e02ec78..0f4bfc6 100644 --- a/GeneGenie.Gedcom.Tests/Date/GedcomDateMatchTest.cs +++ b/GeneGenie.Gedcom.Tests/Date/GedcomDateMatchTest.cs @@ -5,7 +5,6 @@ namespace GeneGenie.Gedcom.Date.Tests { - using System.Collections.Generic; using Xunit; /// @@ -13,24 +12,12 @@ namespace GeneGenie.Gedcom.Date.Tests /// public class GedcomDateMatchTest { - public static IEnumerable DatesToMatch() - { - yield return new object[] { string.Empty, string.Empty, 100m }; - yield return new object[] { "19 APR 1996", "19 APR 1996", 100m }; - yield return new object[] { "Jan 1990", "Jan 1990", 100m }; - yield return new object[] { "Feb 2000", "FEB 2000", 100m }; - yield return new object[] { "Jan 1 1990", "Jan 2 1990", 83.3m }; - } - - private static GedcomDate CreateDate(string dateText) - { - var date = new GedcomDate(); - date.ParseDateString(dateText); - return date; - } - [Theory] - [MemberData(nameof(DatesToMatch))] + [InlineData("", "", 100)] + [InlineData("19 APR 1996", "19 APR 1996", 100)] + [InlineData("Jan 1990", "Jan 1990", 100)] + [InlineData("Feb 2000", "FEB 2000", 100)] + [InlineData("Jan 1 1990", "Jan 2 1990", 83.3)] private void Dates_should_match(string dateAText, string dateBText, decimal expectedMatch) { var dateA = CreateDate(dateAText); @@ -40,5 +27,12 @@ private void Dates_should_match(string dateAText, string dateBText, decimal expe Assert.Equal(expectedMatch, matched, 1); } + + private static GedcomDate CreateDate(string dateText) + { + var date = new GedcomDate(); + date.ParseDateString(dateText); + return date; + } } } From abac75188a62f1df341bd427593ce0d569d24673 Mon Sep 17 00:00:00 2001 From: Ryan O'Neill Date: Mon, 19 Dec 2022 11:36:06 +0000 Subject: [PATCH 17/40] Trigger build. --- GeneGenie.Gedcom.Tests/GedcomDeleteTest.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/GeneGenie.Gedcom.Tests/GedcomDeleteTest.cs b/GeneGenie.Gedcom.Tests/GedcomDeleteTest.cs index 1fda0af..0d5dd29 100644 --- a/GeneGenie.Gedcom.Tests/GedcomDeleteTest.cs +++ b/GeneGenie.Gedcom.Tests/GedcomDeleteTest.cs @@ -2,8 +2,6 @@ // Copyright (c) GeneGenie.com. All Rights Reserved. // Licensed under the GNU Affero General Public License v3.0. See LICENSE in the project root for license information. // -// Copyright (C) 2007 David A Knight david@ritter.demon.co.uk -// Copyright (C) 2016 Ryan O'Neill r@genegenie.com namespace GeneGenie.Gedcom { From 1eac92b5d84efc78a6c119428b5a34b600dfd13e Mon Sep 17 00:00:00 2001 From: Ryan O'Neill Date: Mon, 19 Dec 2022 21:34:17 +0000 Subject: [PATCH 18/40] Fix test that break on Linux due to line terminators not being detected and preserved. --- GeneGenie.Gedcom.Tests/GedcomIdentTest.cs | 2 +- GeneGenie.Gedcom.Tests/GedcomSimpleTest.cs | 2 +- .../GeneGenie.Gedcom.Tests.csproj | 27 ++---- .../GedcomRecordCountTest.cs | 3 +- .../RecordReaderTests/LineTerminatorTests.cs | 39 ++++++++ GeneGenie.Gedcom/AssemblyInfo.cs | 8 ++ GeneGenie.Gedcom/GeneGenie.Gedcom.csproj | 1 - GeneGenie.Gedcom/Parser/GedcomRecordReader.cs | 85 +++++++++++++----- GeneGenie.Gedcom/StrongName.snk | Bin 596 -> 0 bytes 9 files changed, 123 insertions(+), 44 deletions(-) create mode 100644 GeneGenie.Gedcom.Tests/RecordReaderTests/LineTerminatorTests.cs create mode 100644 GeneGenie.Gedcom/AssemblyInfo.cs delete mode 100644 GeneGenie.Gedcom/StrongName.snk diff --git a/GeneGenie.Gedcom.Tests/GedcomIdentTest.cs b/GeneGenie.Gedcom.Tests/GedcomIdentTest.cs index 9e68dbb..9fe3d7a 100644 --- a/GeneGenie.Gedcom.Tests/GedcomIdentTest.cs +++ b/GeneGenie.Gedcom.Tests/GedcomIdentTest.cs @@ -31,7 +31,7 @@ private void Multiline_note_is_read_when_dodgy_ident_tag_is_used() var noteXref = reader.Database.Individuals.Single().Notes.First(); var note = reader.Database.Notes.Single(n => n.XrefId == noteXref); - Assert.Equal("First line of a note.\nSecond line of a note.\nThird line of a note.", note.Text); + Assert.Equal("First line of a note.\r\nSecond line of a note.\r\nThird line of a note.", note.Text); } [Fact] diff --git a/GeneGenie.Gedcom.Tests/GedcomSimpleTest.cs b/GeneGenie.Gedcom.Tests/GedcomSimpleTest.cs index 35abb6e..8545ab1 100644 --- a/GeneGenie.Gedcom.Tests/GedcomSimpleTest.cs +++ b/GeneGenie.Gedcom.Tests/GedcomSimpleTest.cs @@ -44,7 +44,7 @@ private void Creator_address() { var reader = GetReader("./Data/simple.ged"); var creatorAddress = reader.Database.Submitters.SingleOrDefault()?.Address.AddressLine; - Assert.Equal("Submitters address\naddress continued here", creatorAddress); + Assert.Equal("Submitters address\r\naddress continued here", creatorAddress); } [Fact] diff --git a/GeneGenie.Gedcom.Tests/GeneGenie.Gedcom.Tests.csproj b/GeneGenie.Gedcom.Tests/GeneGenie.Gedcom.Tests.csproj index f0e2ab6..876fbb4 100644 --- a/GeneGenie.Gedcom.Tests/GeneGenie.Gedcom.Tests.csproj +++ b/GeneGenie.Gedcom.Tests/GeneGenie.Gedcom.Tests.csproj @@ -6,27 +6,16 @@ 0.6 - - - $(OutputPath)$(AssemblyName).xml - + + $(OutputPath)$(AssemblyName).xml + - + latest - - all - runtime; build; native; contentfiles; analyzers - @@ -56,16 +45,16 @@ Always - Always + Always Always - Always + Always - Always + Always Always @@ -86,7 +75,7 @@ "Unit tests for the GeneGenie.Gedcom library" GeneGenie.Gedcom.Tests" GeneGenie.Gedcom.Tests" - + diff --git a/GeneGenie.Gedcom.Tests/RecordReaderTests/GedcomRecordCountTest.cs b/GeneGenie.Gedcom.Tests/RecordReaderTests/GedcomRecordCountTest.cs index ad211f8..1ed573d 100644 --- a/GeneGenie.Gedcom.Tests/RecordReaderTests/GedcomRecordCountTest.cs +++ b/GeneGenie.Gedcom.Tests/RecordReaderTests/GedcomRecordCountTest.cs @@ -2,7 +2,6 @@ // Copyright (c) GeneGenie.com. All Rights Reserved. // Licensed under the GNU Affero General Public License v3.0. See LICENSE in the project root for license information. // -// Copyright (C) 2016 Ryan O'Neill r@genegenie.com namespace GeneGenie.Gedcom.Parser { @@ -52,7 +51,7 @@ private void Submitter_name_can_be_read(string file, string expectedName) } [Theory] - [InlineData("./Data/allged.ged", "Corporation address line 1\nCorporation address line 2\nCorporation address line 3\nCorporation address line 4")] + [InlineData("./Data/allged.ged", "Corporation address line 1\r\nCorporation address line 2\r\nCorporation address line 3\r\nCorporation address line 4")] private void Corporation_address_can_be_read(string file, string expected) { var reader = GedcomRecordReader.CreateReader(file); diff --git a/GeneGenie.Gedcom.Tests/RecordReaderTests/LineTerminatorTests.cs b/GeneGenie.Gedcom.Tests/RecordReaderTests/LineTerminatorTests.cs new file mode 100644 index 0000000..174fcfa --- /dev/null +++ b/GeneGenie.Gedcom.Tests/RecordReaderTests/LineTerminatorTests.cs @@ -0,0 +1,39 @@ +// +// Copyright (c) GeneGenie.com. All Rights Reserved. +// Licensed under the GNU Affero General Public License v3.0. See LICENSE in the project root for license information. +// + +namespace GeneGenie.Gedcom.Tests.RecordReaderTests +{ + using GeneGenie.Gedcom.Parser; + using System.IO; + using System.Text; + using Xunit; + + /// + /// Tests for verifying GEDCOM line terminators can be found. + /// + public class LineTerminatorTests + { + /// + /// Tests to ensure we can detect if the source GEDCOM file has CR, CRLF or LF terminated lines. + /// + /// + /// + [Theory] + [InlineData("", "\r\n")] + [InlineData("First line. \n Second line.", "\n")] + [InlineData("First line. \r Second line.", "\r")] + public void Line_delimiter_can_be_parsed(string text, string expectedTerminator) + { + using (var ms = new MemoryStream(Encoding.UTF8.GetBytes(text))) + { + var sr = new StreamReader(ms); + + var newlineTerminator = GedcomRecordReader.DetectNewline(sr); + + Assert.Equal(expectedTerminator, newlineTerminator); + } + } + } +} diff --git a/GeneGenie.Gedcom/AssemblyInfo.cs b/GeneGenie.Gedcom/AssemblyInfo.cs new file mode 100644 index 0000000..f000918 --- /dev/null +++ b/GeneGenie.Gedcom/AssemblyInfo.cs @@ -0,0 +1,8 @@ +// +// Copyright (c) GeneGenie.com. All Rights Reserved. +// Licensed under the GNU Affero General Public License v3.0. See LICENSE in the project root for license information. +// + +using System.Runtime.CompilerServices; + +[assembly: InternalsVisibleTo("GeneGenie.Gedcom.Tests")] diff --git a/GeneGenie.Gedcom/GeneGenie.Gedcom.csproj b/GeneGenie.Gedcom/GeneGenie.Gedcom.csproj index 2609116..89e56ed 100644 --- a/GeneGenie.Gedcom/GeneGenie.Gedcom.csproj +++ b/GeneGenie.Gedcom/GeneGenie.Gedcom.csproj @@ -35,7 +35,6 @@ GeneGenie.Gedcom" true 1.1.0 - StrongName.snk Ryan O'Neill, David A. Knight, Grant Winney .Net 6.0 library for loading, saving, working with and analysing family trees stored in the GEDCOM format. https://github.com/TheGeneGenieProject/GeneGenie.Gedcom/blob/master/Licence.txt diff --git a/GeneGenie.Gedcom/Parser/GedcomRecordReader.cs b/GeneGenie.Gedcom/Parser/GedcomRecordReader.cs index a4ac5dc..15189ff 100644 --- a/GeneGenie.Gedcom/Parser/GedcomRecordReader.cs +++ b/GeneGenie.Gedcom/Parser/GedcomRecordReader.cs @@ -45,6 +45,9 @@ public class GedcomRecordReader private StreamReader stream; + // Newline varies by input file, we scan for it on open so we can preserve for writing. + private string newlineDelimiter; + /// /// Initializes a new instance of the class. /// Create a GedcomRecordReader for reading a GEDCOM file into a GedcomDatabase. @@ -222,6 +225,8 @@ public bool ReadGedcom(string gedcomFile) } } + newlineDelimiter = DetectNewline(gedcomFile, enc); + stream = new StreamReader(gedcomFile, enc); while (!stream.EndOfStream) @@ -231,8 +236,7 @@ public bool ReadGedcom(string gedcomFile) if (line != null) { - // file may not have same newline as environment so this isn't 100% correct - read += line.Length + Environment.NewLine.Length; + read += line.Length + newlineDelimiter.Length; Parser.GedcomParse(line); // to allow for inaccuracy above @@ -501,6 +505,47 @@ public bool ReadGedcom(string gedcomFile) return success; } + private static string DetectNewline(string gedcomFile, Encoding enc) + { + using (var sr = new StreamReader(gedcomFile, enc)) + { + return DetectNewline(sr); + } + } + + internal static string DetectNewline(StreamReader sr) + { + int i = 0; + while (!sr.EndOfStream && i < 512) + { + var nextChar = sr.Read(); + + if (nextChar == '\r') + { + nextChar = sr.Read(); + + if (nextChar == '\n') + { + // This is a Windows CRLF formatted line. + return "\r\n"; + } + + // Odd format, just a CR on it's own. + return "\r"; + } + else if (nextChar == '\n') + { + // Looks like Linux / Unix. + sr.Read(); // Throw away the LF character. + return "\n"; + } + + i++; + } + + return Environment.NewLine; + } + private void Parser_ParseError(object sender, EventArgs e) { string error = GedcomParser.GedcomErrorString(Parser.ErrorState); @@ -884,7 +929,7 @@ private bool AddressParse(GedcomAddress address, string tag, string lineValue, G switch (tag) { case "CONT": - address.AddressLine += Environment.NewLine; + address.AddressLine += newlineDelimiter; address.AddressLine += lineValue; done = true; break; @@ -2855,7 +2900,7 @@ private void ReadNoteRecord() switch (tag) { case "CONT": - noteRecord.ParsedText.Append(Environment.NewLine); + noteRecord.ParsedText.Append(newlineDelimiter); noteRecord.ParsedText.Append(lineValue); break; case "CONC": @@ -3190,7 +3235,7 @@ private void ReadSourceRecord() if (!string.IsNullOrEmpty(sourceRecord.Text)) { capacity += sourceRecord.Text.Length; - capacity += Environment.NewLine.Length; + capacity += newlineDelimiter.Length; } sourceRecord.TextText = new StringBuilder(capacity); @@ -3202,7 +3247,7 @@ private void ReadSourceRecord() else { sourceRecord.TextText.Append(sourceRecord.Text); - sourceRecord.TextText.Append(Environment.NewLine); + sourceRecord.TextText.Append(newlineDelimiter); sourceRecord.TextText.Append(lineValue); } } @@ -3262,7 +3307,7 @@ private void ReadSourceRecord() switch (tag) { case "CONT": - sourceRecord.OriginatorText.Append(Environment.NewLine); + sourceRecord.OriginatorText.Append(newlineDelimiter); sourceRecord.OriginatorText.Append(lineValue); break; case "CONC": @@ -3275,7 +3320,7 @@ private void ReadSourceRecord() switch (tag) { case "CONT": - sourceRecord.TitleText.Append(Environment.NewLine); + sourceRecord.TitleText.Append(newlineDelimiter); sourceRecord.TitleText.Append(lineValue); break; case "CONC": @@ -3288,7 +3333,7 @@ private void ReadSourceRecord() switch (tag) { case "CONT": - sourceRecord.PublicationText.Append(Environment.NewLine); + sourceRecord.PublicationText.Append(newlineDelimiter); sourceRecord.PublicationText.Append(lineValue); break; case "CONC": @@ -3303,7 +3348,7 @@ private void ReadSourceRecord() switch (tag) { case "CONT": - sourceRecord.TextText.Append(Environment.NewLine); + sourceRecord.TextText.Append(newlineDelimiter); sourceRecord.TextText.Append(lineValue); break; case "CONC": @@ -3814,7 +3859,7 @@ private void ReadEventRecord() else if (tag == "CONT" && eventRecord.EventType == GedcomEventType.DSCRFact) { - eventRecord.Classification += Environment.NewLine; + eventRecord.Classification += newlineDelimiter; eventRecord.Classification += lineValue; } else if (tag == "CONC" && @@ -4238,7 +4283,7 @@ private void ReadSourceCitationRecord() case "CONT": if (sourceRecord != null) { - sourceRecord.Title += Environment.NewLine; + sourceRecord.Title += newlineDelimiter; sourceRecord.Title += lineValue; } @@ -4259,7 +4304,7 @@ private void ReadSourceCitationRecord() if (!string.IsNullOrEmpty(sourceCitation.Text)) { capacity += sourceCitation.Text.Length; - capacity += Environment.NewLine.Length; + capacity += newlineDelimiter.Length; } sourceCitation.ParsedText = new StringBuilder(capacity); @@ -4267,7 +4312,7 @@ private void ReadSourceCitationRecord() if (!string.IsNullOrEmpty(sourceCitation.Text)) { - sourceCitation.ParsedText.Append(Environment.NewLine); + sourceCitation.ParsedText.Append(newlineDelimiter); } sourceCitation.ParsedText.Append(lineValue); @@ -4338,7 +4383,7 @@ private void ReadSourceCitationRecord() if (!string.IsNullOrEmpty(sourceCitation.Text)) { capacity += sourceCitation.Text.Length; - capacity += Environment.NewLine.Length; + capacity += newlineDelimiter.Length; } sourceCitation.ParsedText = new StringBuilder(capacity); @@ -4346,7 +4391,7 @@ private void ReadSourceCitationRecord() if (!string.IsNullOrEmpty(sourceCitation.Text)) { - sourceCitation.ParsedText.Append(Environment.NewLine); + sourceCitation.ParsedText.Append(newlineDelimiter); } sourceCitation.ParsedText.Append(lineValue); @@ -4365,11 +4410,11 @@ private void ReadSourceCitationRecord() { if (sourceCitation.ParsedText == null) { - int capacity = lineValue.Length + Environment.NewLine.Length; + int capacity = lineValue.Length + newlineDelimiter.Length; sourceCitation.ParsedText = new StringBuilder(capacity); } - sourceCitation.ParsedText.Append(Environment.NewLine); + sourceCitation.ParsedText.Append(newlineDelimiter); sourceCitation.ParsedText.Append(lineValue); } } @@ -4391,11 +4436,11 @@ private void ReadSourceCitationRecord() { if (sourceCitation.ParsedText == null) { - int capacity = lineValue.Length + Environment.NewLine.Length; + int capacity = lineValue.Length + newlineDelimiter.Length; sourceCitation.ParsedText = new StringBuilder(capacity); } - sourceCitation.ParsedText.Append(Environment.NewLine); + sourceCitation.ParsedText.Append(newlineDelimiter); sourceCitation.ParsedText.Append(lineValue); } } diff --git a/GeneGenie.Gedcom/StrongName.snk b/GeneGenie.Gedcom/StrongName.snk deleted file mode 100644 index a694cf2fb676de82d4ba8e537e682fe2f7250575..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 596 zcmV-a0;~N80ssI2Bme+XQ$aES1ONa500984Y^UNV74uWI#RI(+o@LFTlUV%z#&jO# zK~j&5y7b~ty|kV61Tq&L|M_7p!Zz>Jyq2Vin@~B%8X%!fBX{QflJzC297TYs^fDK9 zm|AcOpbm2Am+PIi_@vCv6Tx&#ATCy%{1&X(O@o2lb^50`PNuDJt0+jyIwxBn>z z92*tOl)OPIH&8N8{qPSSmW1%6m$K~@I(8g0?Yf?Gd-@@mE36RqwHc-SRF}PJ9R`qW zcu0_k4LEk~K2Llldi$1c;k{3ra)>(8Yj=bN!!Txx#@;VInm6uCf9c$!X*em`G-*z2 z?6B{c-(7TU1NtyHhY+t|0REWe=2Gz}(Nv1)$|ewSR;ue!&_`Z8BHGb1Os^(moDuOi z6(4UF?O|eN0@Ot_W84GCn+qqtXiP)q_!k@NO&^yeoMcHXFkD@9r@a*Iv-DM8d_Ll) zC+iVW+;mRKY>%i_D%6BCudIs-ND}d}`dAUKd1W0R9@!bk2>UU~+4R#eKsq5l0B?Ms zeFBo0&k)C;2E_MHU_Zx>j}y4ON7uHrEKFhfQn^>$=t%J? Date: Tue, 20 Dec 2022 16:06:36 +0000 Subject: [PATCH 19/40] Reverse linefeed changes so code does not care what they are. --- GeneGenie.Gedcom.Tests/GedcomIdentTest.cs | 4 +++- GeneGenie.Gedcom.Tests/GedcomSimpleTest.cs | 2 +- .../RecordReaderTests/GedcomRecordCountTest.cs | 9 +++++---- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/GeneGenie.Gedcom.Tests/GedcomIdentTest.cs b/GeneGenie.Gedcom.Tests/GedcomIdentTest.cs index 9fe3d7a..8d527b8 100644 --- a/GeneGenie.Gedcom.Tests/GedcomIdentTest.cs +++ b/GeneGenie.Gedcom.Tests/GedcomIdentTest.cs @@ -7,6 +7,7 @@ namespace GeneGenie.Gedcom.Parser { + using System; using System.Linq; using Xunit; @@ -27,11 +28,12 @@ private GedcomRecordReader Read(string file) private void Multiline_note_is_read_when_dodgy_ident_tag_is_used() { var reader = Read("./Data/superfluous-ident-test.ged"); + var expected = $"First line of a note.{Environment.NewLine}Second line of a note.{Environment.NewLine}Third line of a note."; var noteXref = reader.Database.Individuals.Single().Notes.First(); var note = reader.Database.Notes.Single(n => n.XrefId == noteXref); - Assert.Equal("First line of a note.\r\nSecond line of a note.\r\nThird line of a note.", note.Text); + Assert.Equal(expected, note.Text); } [Fact] diff --git a/GeneGenie.Gedcom.Tests/GedcomSimpleTest.cs b/GeneGenie.Gedcom.Tests/GedcomSimpleTest.cs index 8545ab1..01c2bf7 100644 --- a/GeneGenie.Gedcom.Tests/GedcomSimpleTest.cs +++ b/GeneGenie.Gedcom.Tests/GedcomSimpleTest.cs @@ -44,7 +44,7 @@ private void Creator_address() { var reader = GetReader("./Data/simple.ged"); var creatorAddress = reader.Database.Submitters.SingleOrDefault()?.Address.AddressLine; - Assert.Equal("Submitters address\r\naddress continued here", creatorAddress); + Assert.Equal($"Submitters address{Environment.NewLine}address continued here", creatorAddress); } [Fact] diff --git a/GeneGenie.Gedcom.Tests/RecordReaderTests/GedcomRecordCountTest.cs b/GeneGenie.Gedcom.Tests/RecordReaderTests/GedcomRecordCountTest.cs index 1ed573d..f1a87ae 100644 --- a/GeneGenie.Gedcom.Tests/RecordReaderTests/GedcomRecordCountTest.cs +++ b/GeneGenie.Gedcom.Tests/RecordReaderTests/GedcomRecordCountTest.cs @@ -5,6 +5,7 @@ namespace GeneGenie.Gedcom.Parser { + using System; using Xunit; /// @@ -50,11 +51,11 @@ private void Submitter_name_can_be_read(string file, string expectedName) Assert.Equal(expectedName, reader.Database.Header.Submitter.Name); } - [Theory] - [InlineData("./Data/allged.ged", "Corporation address line 1\r\nCorporation address line 2\r\nCorporation address line 3\r\nCorporation address line 4")] - private void Corporation_address_can_be_read(string file, string expected) + [Fact] + private void Corporation_address_can_be_read() { - var reader = GedcomRecordReader.CreateReader(file); + var reader = GedcomRecordReader.CreateReader("./Data/allged.ged"); + var expected = $"Corporation address line 1{Environment.NewLine}Corporation address line 2{Environment.NewLine}Corporation address line 3{Environment.NewLine}Corporation address line 4"; Assert.Equal(expected, reader.Database.Header.CorporationAddress.AddressLine); } From f8daf71b1e757de088a4075119eb55bc654d0959 Mon Sep 17 00:00:00 2001 From: Ryan O'Neill Date: Tue, 20 Dec 2022 16:18:11 +0000 Subject: [PATCH 20/40] Fix another broken cross platform linefeed test. --- .../RecordReaderTests/LineTerminatorTests.cs | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/GeneGenie.Gedcom.Tests/RecordReaderTests/LineTerminatorTests.cs b/GeneGenie.Gedcom.Tests/RecordReaderTests/LineTerminatorTests.cs index 174fcfa..4963666 100644 --- a/GeneGenie.Gedcom.Tests/RecordReaderTests/LineTerminatorTests.cs +++ b/GeneGenie.Gedcom.Tests/RecordReaderTests/LineTerminatorTests.cs @@ -6,6 +6,7 @@ namespace GeneGenie.Gedcom.Tests.RecordReaderTests { using GeneGenie.Gedcom.Parser; + using System; using System.IO; using System.Text; using Xunit; @@ -21,7 +22,6 @@ public class LineTerminatorTests /// /// [Theory] - [InlineData("", "\r\n")] [InlineData("First line. \n Second line.", "\n")] [InlineData("First line. \r Second line.", "\r")] public void Line_delimiter_can_be_parsed(string text, string expectedTerminator) @@ -35,5 +35,21 @@ public void Line_delimiter_can_be_parsed(string text, string expectedTerminator) Assert.Equal(expectedTerminator, newlineTerminator); } } + + /// + /// Tests that an if a line terminator is not found in the text, the default system newline is used. + /// + [Fact] + public void System_default_line_delimiter_is_used() + { + using (var ms = new MemoryStream(Encoding.UTF8.GetBytes(""))) + { + var sr = new StreamReader(ms); + + var newlineTerminator = GedcomRecordReader.DetectNewline(sr); + + Assert.Equal(Environment.NewLine, newlineTerminator); + } + } } } From 6238769c520be715dd156e9fc073b7f781e16133 Mon Sep 17 00:00:00 2001 From: Ryan O'Neill Date: Fri, 23 Dec 2022 18:17:09 +0000 Subject: [PATCH 21/40] Tidy up environment newline detection. --- GeneGenie.Gedcom/Parser/GedcomRecordReader.cs | 41 +++++++++---------- 1 file changed, 19 insertions(+), 22 deletions(-) diff --git a/GeneGenie.Gedcom/Parser/GedcomRecordReader.cs b/GeneGenie.Gedcom/Parser/GedcomRecordReader.cs index 15189ff..dd3dd9c 100644 --- a/GeneGenie.Gedcom/Parser/GedcomRecordReader.cs +++ b/GeneGenie.Gedcom/Parser/GedcomRecordReader.cs @@ -45,9 +45,6 @@ public class GedcomRecordReader private StreamReader stream; - // Newline varies by input file, we scan for it on open so we can preserve for writing. - private string newlineDelimiter; - /// /// Initializes a new instance of the class. /// Create a GedcomRecordReader for reading a GEDCOM file into a GedcomDatabase. @@ -225,7 +222,7 @@ public bool ReadGedcom(string gedcomFile) } } - newlineDelimiter = DetectNewline(gedcomFile, enc); + var newlineDelimiter = DetectNewline(gedcomFile, enc); stream = new StreamReader(gedcomFile, enc); @@ -929,7 +926,7 @@ private bool AddressParse(GedcomAddress address, string tag, string lineValue, G switch (tag) { case "CONT": - address.AddressLine += newlineDelimiter; + address.AddressLine += Environment.NewLine; address.AddressLine += lineValue; done = true; break; @@ -2900,7 +2897,7 @@ private void ReadNoteRecord() switch (tag) { case "CONT": - noteRecord.ParsedText.Append(newlineDelimiter); + noteRecord.ParsedText.Append(Environment.NewLine); noteRecord.ParsedText.Append(lineValue); break; case "CONC": @@ -3235,7 +3232,7 @@ private void ReadSourceRecord() if (!string.IsNullOrEmpty(sourceRecord.Text)) { capacity += sourceRecord.Text.Length; - capacity += newlineDelimiter.Length; + capacity += Environment.NewLine.Length; } sourceRecord.TextText = new StringBuilder(capacity); @@ -3247,7 +3244,7 @@ private void ReadSourceRecord() else { sourceRecord.TextText.Append(sourceRecord.Text); - sourceRecord.TextText.Append(newlineDelimiter); + sourceRecord.TextText.Append(Environment.NewLine); sourceRecord.TextText.Append(lineValue); } } @@ -3307,7 +3304,7 @@ private void ReadSourceRecord() switch (tag) { case "CONT": - sourceRecord.OriginatorText.Append(newlineDelimiter); + sourceRecord.OriginatorText.Append(Environment.NewLine); sourceRecord.OriginatorText.Append(lineValue); break; case "CONC": @@ -3320,7 +3317,7 @@ private void ReadSourceRecord() switch (tag) { case "CONT": - sourceRecord.TitleText.Append(newlineDelimiter); + sourceRecord.TitleText.Append(Environment.NewLine); sourceRecord.TitleText.Append(lineValue); break; case "CONC": @@ -3333,7 +3330,7 @@ private void ReadSourceRecord() switch (tag) { case "CONT": - sourceRecord.PublicationText.Append(newlineDelimiter); + sourceRecord.PublicationText.Append(Environment.NewLine); sourceRecord.PublicationText.Append(lineValue); break; case "CONC": @@ -3348,7 +3345,7 @@ private void ReadSourceRecord() switch (tag) { case "CONT": - sourceRecord.TextText.Append(newlineDelimiter); + sourceRecord.TextText.Append(Environment.NewLine); sourceRecord.TextText.Append(lineValue); break; case "CONC": @@ -3859,7 +3856,7 @@ private void ReadEventRecord() else if (tag == "CONT" && eventRecord.EventType == GedcomEventType.DSCRFact) { - eventRecord.Classification += newlineDelimiter; + eventRecord.Classification += Environment.NewLine; eventRecord.Classification += lineValue; } else if (tag == "CONC" && @@ -4283,7 +4280,7 @@ private void ReadSourceCitationRecord() case "CONT": if (sourceRecord != null) { - sourceRecord.Title += newlineDelimiter; + sourceRecord.Title += Environment.NewLine; sourceRecord.Title += lineValue; } @@ -4304,7 +4301,7 @@ private void ReadSourceCitationRecord() if (!string.IsNullOrEmpty(sourceCitation.Text)) { capacity += sourceCitation.Text.Length; - capacity += newlineDelimiter.Length; + capacity += Environment.NewLine.Length; } sourceCitation.ParsedText = new StringBuilder(capacity); @@ -4312,7 +4309,7 @@ private void ReadSourceCitationRecord() if (!string.IsNullOrEmpty(sourceCitation.Text)) { - sourceCitation.ParsedText.Append(newlineDelimiter); + sourceCitation.ParsedText.Append(Environment.NewLine); } sourceCitation.ParsedText.Append(lineValue); @@ -4383,7 +4380,7 @@ private void ReadSourceCitationRecord() if (!string.IsNullOrEmpty(sourceCitation.Text)) { capacity += sourceCitation.Text.Length; - capacity += newlineDelimiter.Length; + capacity += Environment.NewLine.Length; } sourceCitation.ParsedText = new StringBuilder(capacity); @@ -4391,7 +4388,7 @@ private void ReadSourceCitationRecord() if (!string.IsNullOrEmpty(sourceCitation.Text)) { - sourceCitation.ParsedText.Append(newlineDelimiter); + sourceCitation.ParsedText.Append(Environment.NewLine); } sourceCitation.ParsedText.Append(lineValue); @@ -4410,11 +4407,11 @@ private void ReadSourceCitationRecord() { if (sourceCitation.ParsedText == null) { - int capacity = lineValue.Length + newlineDelimiter.Length; + int capacity = lineValue.Length + Environment.NewLine.Length; sourceCitation.ParsedText = new StringBuilder(capacity); } - sourceCitation.ParsedText.Append(newlineDelimiter); + sourceCitation.ParsedText.Append(Environment.NewLine); sourceCitation.ParsedText.Append(lineValue); } } @@ -4436,11 +4433,11 @@ private void ReadSourceCitationRecord() { if (sourceCitation.ParsedText == null) { - int capacity = lineValue.Length + newlineDelimiter.Length; + int capacity = lineValue.Length + Environment.NewLine.Length; sourceCitation.ParsedText = new StringBuilder(capacity); } - sourceCitation.ParsedText.Append(newlineDelimiter); + sourceCitation.ParsedText.Append(Environment.NewLine); sourceCitation.ParsedText.Append(lineValue); } } From 6ee827f3fe4976648aa4a91886f3022661591915 Mon Sep 17 00:00:00 2001 From: Ryan O'Neill Date: Fri, 23 Dec 2022 18:17:47 +0000 Subject: [PATCH 22/40] Fix issue with calendar not being recognised. --- GeneGenie.Gedcom/GedcomDate.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/GeneGenie.Gedcom/GedcomDate.cs b/GeneGenie.Gedcom/GedcomDate.cs index 50ccf6d..a5abb00 100644 --- a/GeneGenie.Gedcom/GedcomDate.cs +++ b/GeneGenie.Gedcom/GedcomDate.cs @@ -578,7 +578,7 @@ public void ParseDateString(string inputDate) if (dataString.StartsWith("@#")) { dataString = dataString.Substring(2); - int i = dataString.IndexOf("@", 2); // TODO: Subtle bug? Should the 2 be there as already trimmed above? + int i = dataString.IndexOf("@", 2); if (i != -1) { dateType = dataString.Substring(0, i).ToUpper(); @@ -588,19 +588,19 @@ public void ParseDateString(string inputDate) switch (dateType) { - case "@#DGREGORIAN@": + case "DGREGORIAN": DateType = GedcomDateType.Gregorian; break; - case "@#DJULIAN@": + case "DJULIAN": DateType = GedcomDateType.Julian; break; - case "@#DHEBREW@": + case "DHEBREW": DateType = GedcomDateType.Hebrew; break; - case "@#DROMAN@": + case "DROMAN": DateType = GedcomDateType.Roman; break; - case "@#DUNKNOWN@": + case "DUNKNOWN": DateType = GedcomDateType.Unknown; break; default: From cfe2f9a5da85bc1299734073deb68415c4bdd64e Mon Sep 17 00:00:00 2001 From: Ryan O'Neill Date: Wed, 10 May 2023 19:54:49 +0100 Subject: [PATCH 23/40] Remove compile time generated documentation from source. --- .../GeneGenie.Gedcom.Tests.xml | 502 ------------------ 1 file changed, 502 deletions(-) delete mode 100644 GeneGenie.Gedcom.Tests/GeneGenie.Gedcom.Tests.xml diff --git a/GeneGenie.Gedcom.Tests/GeneGenie.Gedcom.Tests.xml b/GeneGenie.Gedcom.Tests/GeneGenie.Gedcom.Tests.xml deleted file mode 100644 index 92b94a8..0000000 --- a/GeneGenie.Gedcom.Tests/GeneGenie.Gedcom.Tests.xml +++ /dev/null @@ -1,502 +0,0 @@ - - - - GeneGenie.Gedcom.Tests - - - - - Tests for equality of addresses. - - - - - Helper functions to create people with names for unit testing. - - - - - Create an individual with a specific name. - - The gedcom database to attach the name and individual to. - The name to place directly into the name field. - The constructed individual. - - - - Create an individual with a specific name. - - The gedcom database to attach the name and individual to. - The given name (first name) to attach to the new individual. - The surname (last name) to attach to the new individual. - The constructed individual. - - - - Rigorous tests to ensure that Ansel files can be can be properly loaded and converted to Unicode. - - - - - Checks that the Ansel encoding is recognised. - - - - - Test to catch the addition of child records so that we can add tests for them. - If this fails, we need to test the characters in the new entries. - - - - - Uses the Ansel test file supplied by Heiner Eichmann to test every character in Ansel can be decoded into Unicode. - The expected test data has been rigorously checked to ensure the Unicode characters match exactly. If your editor - is not Unicode aware updates them, they'll probably fail. - - The name of the child test record in the ANSEL.GED file. - The expected text to find in the birth place field, after translation to Unicode. - The expected text to find in the death place field, after translation to Unicode. - - - - Rigorous tests to ensure that ANSI files can be can be properly loaded and converted to Unicode. - - - - - Checks that the ANSI encoding is recognised. - - - - - Test to catch the addition of child records so that we can add tests for them. - If this fails, we need to test the characters in the new entries. - - - - - Uses the Ansi test file to test every character in ANSI can be decoded into Unicode. - - The name of the child test record in the ansi.ged file. - The expected integer value to find in the birth place field, before any translation. - The expected text to find in the birth place field, after translation to Unicode. - - - - Tests for equality of family records. - - - - - Initializes a new instance of the class. - Comparison tests for event. - - - - - Tests for equality of multimedia files. - - - - - Initializes a new instance of the class. - - - - - Tests for equality of multimedia files. - - - - - Initializes a new instance of the class. - - - - - Tests for equality of multimedia records. - - - - - Initializes a new instance of the class. - - - - - Test suite for equality of GedcomNoteRecord. - - - - - Initializes a new instance of the class. - - - - - Tests for equality of family records. - - - - - Initializes a new instance of the class. - Comparison tests for places. - - - - - Test suite for equality of GedcomRecordedEvent. - - - - - Initializes a new instance of the class. - - - - - Test suite for equality of GedcomRepositoryCitation. - - - - - Initializes a new instance of the class. - - - - - Test suite for equality of GedcomRepositoryRecord. - - - - - Initializes a new instance of the class. - - - - - Test suite for equality of GedcomSourceCitation. - - - - - Initializes a new instance of the class. - - - - - Test suite for equality of GedcomSourceRecord. - - - - - Initializes a new instance of the class. - - - - - Test suite for equality of GedcomSubmissionRecord. - - - - - Initializes a new instance of the class. - - - - - Test suite for equality of GedcomSubmitterRecord. - - - - - Initializes a new instance of the class. - - - - - Class GedComComparisonTests. - - - - - GedCOM comparison gedcom association is equivalent to expect are equal. - - - - - GedCOM comparison gedcom date is equivalent to expect are equal. - - - - - GedCOM comparison gedcom event is equivalent to expect are equal. - - - - - GedCOM comparison gedcom family link is equivalent to expect are equal. - - - - - GedCOM comparison gedcom family record is equivalent to expect are equal. - - - - - GedCOM comparison gedcom header is equivalent to expect are equal. - - - - - GedCOM comparison gedcom individual record is equivalent to expect are equal. - - - - - GedCOM comparison gedcom multimedia record is equivalent to expect are equal. - - - - - GedCOM comparison gedcom name is equivalent to expect are equal. - - - - - GedCOM comparison gedcom note record is equivalent to expect are equal. - - - - - GedCOM comparison gedcom place is equivalent to expect are equal. - - - - - GedCOM comparison gedcom repository citation is equivalent to expect are equal. - - - - - GedCOM comparison gedcom repository record is equivalent to expect are equal. - - - - - GedCOM comparison gedcom source citation is equivalent to expect are equal. - - - - - GedCOM comparison gedcom source record is equivalent to expect are equal. - - - - - GedCOM comparison gedcom submission record is equivalent to expect are equal. - - - - - GedCOM comparison gedcom submitter record is equivalent to expect are equal. - - - - - Tests for ensuring the custom.ged file can be parsed and custom fields found. - - - - - Tests for ensuring the simple.ged file can be parsed as expected. - - - - - All of the tests that need writing, converting from old comments and old unit tests. - - - - - Tests for equality of addresses. - - - - - Tests that source records are read in for the varying record types. - - - - - Compares two lists of records to see if they are equal. - Uses the automated record id from the base class for sorting. - - A class that inherits from and implements Equals/GetHashCode. - The first list of records. - The second list of records. - - - - TODO: More tests and simplify / split the tests that are there. - - - - - Tests for equality of associations. - - - - - Initializes a new instance of the class. - - - - - Tests for equality of family links. - - - - - Tests for equality of family records. - - - - - Initializes a new instance of the class. - Comparison tests for GedcomFamilyRecord. - - - - - Tests that the spousal sealing record can be added, removed and round tripped to storage. - - - - - Checks that the date comparision works, which is complex as GEDCOM dates can have a lot of prefixes. - - - - - Checks the mechanism for testing how similar dates are. - - - - - Null comparison tests for dates, ensuring a real date never matches a null. - - - - - Unit tests and data for ensuring changed dates and times are output in correct format. - - - - - Unit tests and data for ensuring dates can be parsed from GEDCOM files. - - - - - Tests that all date periods are handled and can be parsed. - - - - - Tests for deleting individuals, ensuring that sources etc are also deleted if no longer referenced. - - - - - Checks that the IDENT tag does not muck up the import of a file as shown by - http://www.tamurajones.net/GEDCOMIdentifiersCONCAndCONT.xhtml . - - - - - Tests for ensuring that GEDCOM files can be loaded, saved and reopened without data loss. - - - - - Initializes a new instance of the class. - - A helper class used to log output to the test runner. - - - - To help diagnose file differences, this function logs the contents of the files to the test runner. - - Path to source file to show. - Path to file that has been rewritten. - - - - Ensures that the parser loads a file that contains all known GEDCOM tags. - TODO: Could do with validating that it actually understood every tag in that file. - - - - - File sourced from http://heiner-eichmann.de/gedcom/allged.htm . - - - - - Tests for equality of individuals. - - - - - Initializes a new instance of the class. - - - - - Tests for equality of names and name lists. - - - - - Initializes a new instance of the class. - - - - - Tests for name parsing. - - - - - Initializes a new instance of the class. - - - - - Tests to ensure that the correct number of families and individuals are read. - - - - - Tests the ability to match individuals on user entered data. - - - - - Initializes a new instance of the class. - - - - - Tests that source records are read in for the varying record types. - - - - - Loads the torture test files to test every tag can be read at least without falling over. - - - - From e639a04a25572ced3e59faad9011f6cc19e326d5 Mon Sep 17 00:00:00 2001 From: Ryan O'Neill Date: Wed, 10 May 2023 19:58:56 +0100 Subject: [PATCH 24/40] Don't track JetBrains Rider IDE scratch files. --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 30a8bcf..dbbdb78 100644 --- a/.gitignore +++ b/.gitignore @@ -287,3 +287,6 @@ Icon Network Trash Folder Temporary Items .apdisk + +# JtBrains Rider +**/.idea/** From d51a7c8994a0aa87883379c2d735f4d8508685cf Mon Sep 17 00:00:00 2001 From: Ryan O'Neill Date: Wed, 10 May 2023 20:00:27 +0100 Subject: [PATCH 25/40] Update test runner packages. --- GeneGenie.Gedcom.Tests/GeneGenie.Gedcom.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GeneGenie.Gedcom.Tests/GeneGenie.Gedcom.Tests.csproj b/GeneGenie.Gedcom.Tests/GeneGenie.Gedcom.Tests.csproj index 876fbb4..434e15b 100644 --- a/GeneGenie.Gedcom.Tests/GeneGenie.Gedcom.Tests.csproj +++ b/GeneGenie.Gedcom.Tests/GeneGenie.Gedcom.Tests.csproj @@ -16,7 +16,7 @@ - + all From 67c61a2a313d79970022f0da1266e4ce27badb83 Mon Sep 17 00:00:00 2001 From: mtx500 Date: Sat, 24 Jun 2023 13:38:26 +0200 Subject: [PATCH 26/40] Fixed some typos in comments and strings. (#124) --- .../Equality/GedcomEventTest.cs | 2 +- .../Equality/GedcomHeaderTest.cs | 2 +- .../Equality/GedcomPlaceTest.cs | 2 +- GeneGenie.Gedcom/Data/StaticDateData.cs | 2 +- GeneGenie.Gedcom/Enums/GedcomDatePeriod.cs | 2 +- GeneGenie.Gedcom/Enums/GedcomErrorState.cs | 10 +++---- GeneGenie.Gedcom/GedcomAssociation.cs | 2 +- GeneGenie.Gedcom/GedcomEvent.cs | 6 ++--- GeneGenie.Gedcom/GedcomFamilyLink.cs | 6 ++--- GeneGenie.Gedcom/GedcomFamilyRecord.cs | 6 ++--- GeneGenie.Gedcom/GedcomIndividualRecord.cs | 6 ++--- GeneGenie.Gedcom/GedcomRecord.cs | 2 +- GeneGenie.Gedcom/GedcomSourceCitation.cs | 2 +- GeneGenie.Gedcom/GedcomSourceRecord.cs | 2 +- GeneGenie.Gedcom/GeneGenie.Gedcom.xml | 26 +++++++++---------- GeneGenie.Gedcom/Helpers/EnumHelper.cs | 2 +- GeneGenie.Gedcom/Parser/GedcomParser.cs | 6 ++--- GeneGenie.Gedcom/Parser/GedcomRecordReader.cs | 8 +++--- GeneGenie.Gedcom/Parser/GedcomRecordWriter.cs | 2 +- GeneGenie.Gedcom/Parser/StaticData.cs | 6 ++--- 20 files changed, 51 insertions(+), 51 deletions(-) diff --git a/GeneGenie.Gedcom.Tests/Equality/GedcomEventTest.cs b/GeneGenie.Gedcom.Tests/Equality/GedcomEventTest.cs index 0ff49d7..09c78cd 100644 --- a/GeneGenie.Gedcom.Tests/Equality/GedcomEventTest.cs +++ b/GeneGenie.Gedcom.Tests/Equality/GedcomEventTest.cs @@ -9,7 +9,7 @@ namespace GeneGenie.Gedcom.Tests.Equality using Xunit; /// - /// Tests for equality of family records. + /// Tests for equality of GedcomEvent. /// public class GedcomEventTest { diff --git a/GeneGenie.Gedcom.Tests/Equality/GedcomHeaderTest.cs b/GeneGenie.Gedcom.Tests/Equality/GedcomHeaderTest.cs index 3b22a8b..e33206a 100644 --- a/GeneGenie.Gedcom.Tests/Equality/GedcomHeaderTest.cs +++ b/GeneGenie.Gedcom.Tests/Equality/GedcomHeaderTest.cs @@ -8,7 +8,7 @@ namespace GeneGenie.Gedcom.Tests.Equality using Xunit; /// - /// Tests for equality of multimedia files. + /// Tests for equality of headers. /// public class GedcomHeaderTest { diff --git a/GeneGenie.Gedcom.Tests/Equality/GedcomPlaceTest.cs b/GeneGenie.Gedcom.Tests/Equality/GedcomPlaceTest.cs index 4227164..5261b98 100644 --- a/GeneGenie.Gedcom.Tests/Equality/GedcomPlaceTest.cs +++ b/GeneGenie.Gedcom.Tests/Equality/GedcomPlaceTest.cs @@ -8,7 +8,7 @@ namespace GeneGenie.Gedcom.Tests.Equality using Xunit; /// - /// Tests for equality of family records. + /// Tests for equality of GedcomPlace. /// public class GedcomPlaceTest { diff --git a/GeneGenie.Gedcom/Data/StaticDateData.cs b/GeneGenie.Gedcom/Data/StaticDateData.cs index d7e83fe..79e6cfd 100644 --- a/GeneGenie.Gedcom/Data/StaticDateData.cs +++ b/GeneGenie.Gedcom/Data/StaticDateData.cs @@ -35,7 +35,7 @@ public static class StaticDateData /// Longer strings that match the start of shorter strings should be listed first (ABT. before ABT). /// /// Of particular note; - /// C or CIRCA from BROSKEEP files, C may be due to the date being set from a baptism / christening, but if that is the + /// C or CIRCA from BROSKEEP files, C may be due to the date being set from a baptism / christening, but if that is the /// case estimate is still reasonable to go with. /// /// BROSKEEP seems to be stupid and doesn't make proper use of CAL e.g 'BU.9-6-1825' for a death date means it is really diff --git a/GeneGenie.Gedcom/Enums/GedcomDatePeriod.cs b/GeneGenie.Gedcom/Enums/GedcomDatePeriod.cs index 3c259df..9398425 100644 --- a/GeneGenie.Gedcom/Enums/GedcomDatePeriod.cs +++ b/GeneGenie.Gedcom/Enums/GedcomDatePeriod.cs @@ -8,7 +8,7 @@ namespace GeneGenie.Gedcom.Enums { /// - /// How accurate is the date and what range does it span?. + /// How accurate is the date and what range does it span? /// public enum GedcomDatePeriod { diff --git a/GeneGenie.Gedcom/Enums/GedcomErrorState.cs b/GeneGenie.Gedcom/Enums/GedcomErrorState.cs index 18d8e96..7b436ff 100644 --- a/GeneGenie.Gedcom/Enums/GedcomErrorState.cs +++ b/GeneGenie.Gedcom/Enums/GedcomErrorState.cs @@ -23,7 +23,7 @@ public enum GedcomErrorState LevelExpected, /// - /// Delimeter after level not found + /// Delimiter after level not found /// LevelMissingDelim, @@ -33,7 +33,7 @@ public enum GedcomErrorState LevelInvalid, /// - /// Delimeter after XrefID not found + /// Delimiter after XrefID not found /// XrefIDMissingDelim, @@ -48,7 +48,7 @@ public enum GedcomErrorState TagExpected, /// - /// Delimeter, or newline after the tag was not found + /// Delimiter, or newline after the tag was not found /// TagMissingDelimOrTerm, @@ -58,7 +58,7 @@ public enum GedcomErrorState LineValueExpected, /// - /// newline after line value not found + /// Newline after line value not found /// LineValueMissingTerm, @@ -68,7 +68,7 @@ public enum GedcomErrorState LineValueInvalid, /// - /// Deliminator in GEDCOM is a single space, this error will occur + /// Delimiter in GEDCOM is a single space, this error will occur /// when a multi space delimiter is detected /// InvalidDelim, diff --git a/GeneGenie.Gedcom/GedcomAssociation.cs b/GeneGenie.Gedcom/GedcomAssociation.cs index afa8cca..8ea2a7e 100644 --- a/GeneGenie.Gedcom/GedcomAssociation.cs +++ b/GeneGenie.Gedcom/GedcomAssociation.cs @@ -13,7 +13,7 @@ namespace GeneGenie.Gedcom /// /// How the given individual is associated to another. - /// Each GedcomIndividal contains a list of these. + /// Each GedcomIndividual contains a list of these. /// public class GedcomAssociation : GedcomRecord, IComparable, IComparable, IEquatable { diff --git a/GeneGenie.Gedcom/GedcomEvent.cs b/GeneGenie.Gedcom/GedcomEvent.cs index 54fbd7b..4e210ee 100644 --- a/GeneGenie.Gedcom/GedcomEvent.cs +++ b/GeneGenie.Gedcom/GedcomEvent.cs @@ -75,7 +75,7 @@ public class GedcomEvent : GedcomRecord, IComparable, IComparable, "SSN", "TITL", - // GEDCOM allows custom records, beginging with _ + // GEDCOM allows custom records, beginning with _ "_UNKN", }; @@ -757,7 +757,7 @@ public override void GenerateXML(XmlNode root) } else { - System.Diagnostics.Debug.WriteLine("Pointer to non existant husband"); + System.Diagnostics.Debug.WriteLine("Pointer to non existent husband"); } } @@ -785,7 +785,7 @@ public override void GenerateXML(XmlNode root) } else { - System.Diagnostics.Debug.WriteLine("Pointer to non existant wife"); + System.Diagnostics.Debug.WriteLine("Pointer to non existent wife"); } } diff --git a/GeneGenie.Gedcom/GedcomFamilyLink.cs b/GeneGenie.Gedcom/GedcomFamilyLink.cs index 8e8cafe..396843c 100644 --- a/GeneGenie.Gedcom/GedcomFamilyLink.cs +++ b/GeneGenie.Gedcom/GedcomFamilyLink.cs @@ -11,7 +11,7 @@ namespace GeneGenie.Gedcom using GeneGenie.Gedcom.Enums; /// - /// How an individal is linked to a family. + /// How an individual is linked to a family. /// public class GedcomFamilyLink : GedcomRecord, IComparable, IComparable, IEquatable { @@ -183,10 +183,10 @@ public ChildLinkageStatus Status } /// - /// Gets or sets a value indicating whether [prefered spouse]. + /// Gets or sets a value indicating whether [preferred spouse]. /// /// - /// true if [prefered spouse]; otherwise, false. + /// true if [preferred spouse]; otherwise, false. /// public bool PreferedSpouse { diff --git a/GeneGenie.Gedcom/GedcomFamilyRecord.cs b/GeneGenie.Gedcom/GedcomFamilyRecord.cs index a06e25b..0d6655d 100644 --- a/GeneGenie.Gedcom/GedcomFamilyRecord.cs +++ b/GeneGenie.Gedcom/GedcomFamilyRecord.cs @@ -910,7 +910,7 @@ public override void GenerateXML(XmlNode root) } else { - System.Diagnostics.Debug.WriteLine("Pointer to non existant husband"); + System.Diagnostics.Debug.WriteLine("Pointer to non existent husband"); } } @@ -937,7 +937,7 @@ public override void GenerateXML(XmlNode root) } else { - System.Diagnostics.Debug.WriteLine("Pointer to non existant wife"); + System.Diagnostics.Debug.WriteLine("Pointer to non existent wife"); } } @@ -1016,7 +1016,7 @@ public override void GenerateXML(XmlNode root) } else { - System.Diagnostics.Debug.WriteLine("Pointer to non existant child"); + System.Diagnostics.Debug.WriteLine("Pointer to non existent child"); } } diff --git a/GeneGenie.Gedcom/GedcomIndividualRecord.cs b/GeneGenie.Gedcom/GedcomIndividualRecord.cs index 4de2107..442edee 100644 --- a/GeneGenie.Gedcom/GedcomIndividualRecord.cs +++ b/GeneGenie.Gedcom/GedcomIndividualRecord.cs @@ -899,7 +899,7 @@ public GedcomName GetName() } /// - /// Sets the name of the prefered. + /// Sets the name of the preferred. /// /// The name. public void SetPreferedName(GedcomName name) @@ -1002,7 +1002,7 @@ public GedcomFamilyRecord GetFamily() GedcomFamilyLink link = SpouseIn.FirstOrDefault(f => (f.PreferedSpouse == true)); - // shouldn't need this as we automatically set the prefered on loading + // shouldn't need this as we automatically set the preferred on loading // do the check anyway though just incase. if (link == null && SpouseIn.Count > 0) { @@ -1367,7 +1367,7 @@ public override void GenerateXML(XmlNode root) } else { - System.Diagnostics.Debug.WriteLine("Pointer to non existant associated individual"); + System.Diagnostics.Debug.WriteLine("Pointer to non existent associated individual"); } } diff --git a/GeneGenie.Gedcom/GedcomRecord.cs b/GeneGenie.Gedcom/GedcomRecord.cs index 3eec946..b64900f 100644 --- a/GeneGenie.Gedcom/GedcomRecord.cs +++ b/GeneGenie.Gedcom/GedcomRecord.cs @@ -465,7 +465,7 @@ public void GenerateNoteXML(XmlNode root) } else { - System.Diagnostics.Debug.WriteLine("Pointer to non existant note"); + System.Diagnostics.Debug.WriteLine("Pointer to non existent note"); } } } diff --git a/GeneGenie.Gedcom/GedcomSourceCitation.cs b/GeneGenie.Gedcom/GedcomSourceCitation.cs index 415e23b..2c23be7 100644 --- a/GeneGenie.Gedcom/GedcomSourceCitation.cs +++ b/GeneGenie.Gedcom/GedcomSourceCitation.cs @@ -273,7 +273,7 @@ public override void GenerateXML(XmlNode root) } else { - System.Diagnostics.Debug.WriteLine("Pointer to non existant source"); + System.Diagnostics.Debug.WriteLine("Pointer to non existent source"); } if (!string.IsNullOrEmpty(Page)) diff --git a/GeneGenie.Gedcom/GedcomSourceRecord.cs b/GeneGenie.Gedcom/GedcomSourceRecord.cs index 5a41332..fe648db 100644 --- a/GeneGenie.Gedcom/GedcomSourceRecord.cs +++ b/GeneGenie.Gedcom/GedcomSourceRecord.cs @@ -121,7 +121,7 @@ public GedcomSourceRecord(GedcomDatabase database) public StringBuilder PublicationText { get; set; } /// - /// Gets or sets the text text. TODO: What?. + /// Gets or sets the text text. TODO: What? /// public StringBuilder TextText { get; set; } diff --git a/GeneGenie.Gedcom/GeneGenie.Gedcom.xml b/GeneGenie.Gedcom/GeneGenie.Gedcom.xml index e12e335..0dfd72f 100644 --- a/GeneGenie.Gedcom/GeneGenie.Gedcom.xml +++ b/GeneGenie.Gedcom/GeneGenie.Gedcom.xml @@ -46,7 +46,7 @@ Longer strings that match the start of shorter strings should be listed first (ABT. before ABT). Of particular note; - C or CIRCA from BROSKEEP files, C may be due to the date being set from a baptism / christening, but if that is the + C or CIRCA from BROSKEEP files, C may be due to the date being set from a baptism / christening, but if that is the case estimate is still reasonable to go with. BROSKEEP seems to be stupid and doesn't make proper use of CAL e.g 'BU.9-6-1825' for a death date means it is really @@ -257,7 +257,7 @@ - Delimeter after level not found + Delimiter after level not found @@ -267,7 +267,7 @@ - Delimeter after XrefID not found + Delimiter after XrefID not found @@ -282,7 +282,7 @@ - Delimeter, or newline after the tag was not found + Delimiter, or newline after the tag was not found @@ -292,7 +292,7 @@ - newline after line value not found + Newline after line value not found @@ -302,7 +302,7 @@ - Deliminator in GEDCOM is a single space, this error will occur + Delimiter in GEDCOM is a single space, this error will occur when a multi space delimiter is detected @@ -1343,7 +1343,7 @@ How the given individual is associated to another. - Each GedcomIndividal contains a list of these. + Each GedcomIndividual contains a list of these. @@ -2250,7 +2250,7 @@ - How an individal is linked to a family. + How an individual is linked to a family. @@ -2313,10 +2313,10 @@ - Gets or sets a value indicating whether [prefered spouse]. + Gets or sets a value indicating whether [preferred spouse]. - true if [prefered spouse]; otherwise, false. + true if [preferred spouse]; otherwise, false. @@ -3204,7 +3204,7 @@ - Sets the name of the prefered. + Sets the name of the preferred. The name. @@ -5388,7 +5388,7 @@ - Outputs a string version of an enum by using the attribute. + Outputs a string version of an enum by using the attribute. Fails over to the enum name if the does not exist. The enum to output. @@ -5981,7 +5981,7 @@ - Gets or sets the application version that created the GEDCOME file. + Gets or sets the application version that created the GEDCOM file. diff --git a/GeneGenie.Gedcom/Helpers/EnumHelper.cs b/GeneGenie.Gedcom/Helpers/EnumHelper.cs index c32b9d9..c7556d2 100644 --- a/GeneGenie.Gedcom/Helpers/EnumHelper.cs +++ b/GeneGenie.Gedcom/Helpers/EnumHelper.cs @@ -115,7 +115,7 @@ public static T ParseByDescription(string value, bool ignoreCase, T defaultVa } /// - /// Outputs a string version of an enum by using the attribute. + /// Outputs a string version of an enum by using the attribute. /// Fails over to the enum name if the does not exist. /// /// The enum to output. diff --git a/GeneGenie.Gedcom/Parser/GedcomParser.cs b/GeneGenie.Gedcom/Parser/GedcomParser.cs index 0402035..8b0fa8b 100644 --- a/GeneGenie.Gedcom/Parser/GedcomParser.cs +++ b/GeneGenie.Gedcom/Parser/GedcomParser.cs @@ -20,7 +20,7 @@ namespace GeneGenie.Gedcom.Parser /// public class GedcomParser { - // arbitary magic max level number + // arbitrary magic max level number private const int MaxLevel = 99; private const int MaxXRefLength = 22; @@ -186,7 +186,7 @@ public GedcomErrorState GedcomParse(string data) // Tags are always the same, data.Substring was allocating lots // of memory, instead use a special collection which matches via - // array index, e.g tagCollection[str, index, length] to avoid + // array index, e.g. tagCollection[str, index, length] to avoid // the extra allocations, and caches the resulting string for // use again without having to substring if (TagCollection == null) @@ -503,7 +503,7 @@ public GedcomErrorState GedcomParse(string data) // TODO: no line value, but have hit the terminator // what should this be allowed for? - // Family Tree Maker outputs emtpy CONT (and CONC?) + // Family Tree Maker outputs empty CONT (and CONC?) else if (Tag == "CONT" || Tag == "CONC") { LineValue = " "; diff --git a/GeneGenie.Gedcom/Parser/GedcomRecordReader.cs b/GeneGenie.Gedcom/Parser/GedcomRecordReader.cs index dd3dd9c..dee6d3a 100644 --- a/GeneGenie.Gedcom/Parser/GedcomRecordReader.cs +++ b/GeneGenie.Gedcom/Parser/GedcomRecordReader.cs @@ -56,7 +56,7 @@ public GedcomRecordReader() // we don't care if delims are multiple spaces Parser.IgnoreInvalidDelim = true; - // we don't care if lines are missing delimeters + // we don't care if lines are missing delimiters Parser.IgnoreMissingTerms = true; // apply hack for lines that are just part of the line value @@ -428,7 +428,7 @@ public bool ReadGedcom(string gedcomFile) case GedcomRecordType.Individual: // TODO: don't increase ref count on individuals, // a bit of a hack, only place where it may be - // needed is on assocciations + // needed is on associations break; case GedcomRecordType.Family: // TODO: don't increase ref count on families @@ -4555,7 +4555,7 @@ private void ReadFamilyLinkRecord() } catch { - Debug.WriteLine("Invalid pedegree linkage type: " + lineValue); + Debug.WriteLine("Invalid pedigree linkage type: " + lineValue); childOf.Pedigree = PedigreeLinkageType.Unknown; } @@ -5015,7 +5015,7 @@ private string TagMap(string tag) string ret = tag; switch (tag) { - // we convert _AKA to the admitedly invalid AKA, but we deal + // we convert _AKA to the admittedly invalid AKA, but we deal // with that as a valid tag as it is known to occur in some // files. Ends up adding a name with a type of aka case "_AKA": diff --git a/GeneGenie.Gedcom/Parser/GedcomRecordWriter.cs b/GeneGenie.Gedcom/Parser/GedcomRecordWriter.cs index 108a5a0..68f467d 100644 --- a/GeneGenie.Gedcom/Parser/GedcomRecordWriter.cs +++ b/GeneGenie.Gedcom/Parser/GedcomRecordWriter.cs @@ -41,7 +41,7 @@ public GedcomRecordWriter() public string ApplicationName { get; set; } /// - /// Gets or sets the application version that created the GEDCOME file. + /// Gets or sets the application version that created the GEDCOM file. /// public string ApplicationVersion { get; set; } diff --git a/GeneGenie.Gedcom/Parser/StaticData.cs b/GeneGenie.Gedcom/Parser/StaticData.cs index 62f8b28..326b44c 100644 --- a/GeneGenie.Gedcom/Parser/StaticData.cs +++ b/GeneGenie.Gedcom/Parser/StaticData.cs @@ -22,14 +22,14 @@ public class StaticData "No Error", "Level expected but not found", - "Level needs trailing delimeter", + "Level needs trailing delimiter", "Level is invalid", - "Xref id needs trailing delimeter", + "Xref id needs trailing delimiter", "Xref too long", "Tag expected", - "Tag needs trailing delimeter or newline", + "Tag needs trailing delimiter or newline", "Line value expected", "Line value needs trailing newline", From cdaf9ae30ca18e3c94e83d5ee75a3a6630b5a6ce Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 24 Jun 2023 12:59:56 +0100 Subject: [PATCH 27/40] Bump Microsoft.NET.Test.Sdk from 17.5.0 to 17.6.2 (#123) Bumps [Microsoft.NET.Test.Sdk](https://github.com/microsoft/vstest) from 17.5.0 to 17.6.2. - [Release notes](https://github.com/microsoft/vstest/releases) - [Changelog](https://github.com/microsoft/vstest/blob/main/docs/releases.md) - [Commits](https://github.com/microsoft/vstest/compare/v17.5.0...v17.6.2) --- updated-dependencies: - dependency-name: Microsoft.NET.Test.Sdk dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- GeneGenie.Gedcom.Tests/GeneGenie.Gedcom.Tests.csproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/GeneGenie.Gedcom.Tests/GeneGenie.Gedcom.Tests.csproj b/GeneGenie.Gedcom.Tests/GeneGenie.Gedcom.Tests.csproj index 434e15b..ae42979 100644 --- a/GeneGenie.Gedcom.Tests/GeneGenie.Gedcom.Tests.csproj +++ b/GeneGenie.Gedcom.Tests/GeneGenie.Gedcom.Tests.csproj @@ -1,4 +1,4 @@ - + net7.0 @@ -16,7 +16,7 @@ - + all From 34e004ed948ea749dc4ad8778f3d8865c04b0c18 Mon Sep 17 00:00:00 2001 From: mtx500 Date: Sat, 24 Jun 2023 21:07:34 +0200 Subject: [PATCH 28/40] Generate XML documentation files in output- instead of source-directory (#125) * Fixed some typos in comments and strings. * Generate XML documentation files in output- instead of source-directory. Remove them from repository as they are generated. --- .../GeneGenie.Gedcom.Sample.csproj | 2 +- .../GeneGenie.Gedcom.Sample.xml | 62 - .../GeneGenie.Gedcom.Tests.csproj | 5 +- GeneGenie.Gedcom/GeneGenie.Gedcom.csproj | 3 +- GeneGenie.Gedcom/GeneGenie.Gedcom.xml | 6392 ----------------- 5 files changed, 6 insertions(+), 6458 deletions(-) delete mode 100644 GeneGenie.Gedcom.Sample/GeneGenie.Gedcom.Sample.xml delete mode 100644 GeneGenie.Gedcom/GeneGenie.Gedcom.xml diff --git a/GeneGenie.Gedcom.Sample/GeneGenie.Gedcom.Sample.csproj b/GeneGenie.Gedcom.Sample/GeneGenie.Gedcom.Sample.csproj index 8adaf74..14ca4c0 100644 --- a/GeneGenie.Gedcom.Sample/GeneGenie.Gedcom.Sample.csproj +++ b/GeneGenie.Gedcom.Sample/GeneGenie.Gedcom.Sample.csproj @@ -13,7 +13,7 @@ CS1573: Parameter 'parameter' has no matching param tag in the XML comment for 'parameter' (but other parameters do) CS1591: Missing XML comment for publicly visible type or member 'Type_or_Member' --> - $(OutputPath)$(AssemblyName).xml + True diff --git a/GeneGenie.Gedcom.Sample/GeneGenie.Gedcom.Sample.xml b/GeneGenie.Gedcom.Sample/GeneGenie.Gedcom.Sample.xml deleted file mode 100644 index a47cc30..0000000 --- a/GeneGenie.Gedcom.Sample/GeneGenie.Gedcom.Sample.xml +++ /dev/null @@ -1,62 +0,0 @@ - - - - GeneGenie.Gedcom.Sample - - - - - Sample console app showing how to read, query, change and save a GEDCOM file. - - - - - App entry point. - - - - - Tiny sample class on how to load a GEDCOM file. - - - - - Loads the presidents tree. - - A database reader that can be used to access the parsed database. - - - - Tiny sample class on how to query a GEDCOM file. - - - - - Queries the tree for any individual with a name, just to show how to query. - - The database to query. - - - - Tiny sample class on how to add a person to a database. - - - - - Adds a sample person (well, a cartoon mouse) to the presidents file. The mouse may do a better job if elected president. - - The database to add the individual to. - - - - Tiny sample class on how to save a GEDCOM file. - - - - - Saves the sample database out to a new file. - - The database to save. - - - diff --git a/GeneGenie.Gedcom.Tests/GeneGenie.Gedcom.Tests.csproj b/GeneGenie.Gedcom.Tests/GeneGenie.Gedcom.Tests.csproj index ae42979..dc22bdb 100644 --- a/GeneGenie.Gedcom.Tests/GeneGenie.Gedcom.Tests.csproj +++ b/GeneGenie.Gedcom.Tests/GeneGenie.Gedcom.Tests.csproj @@ -1,4 +1,4 @@ - + net7.0 @@ -7,7 +7,7 @@ - $(OutputPath)$(AssemblyName).xml + @@ -75,6 +75,7 @@ "Unit tests for the GeneGenie.Gedcom library" GeneGenie.Gedcom.Tests" GeneGenie.Gedcom.Tests" + True diff --git a/GeneGenie.Gedcom/GeneGenie.Gedcom.csproj b/GeneGenie.Gedcom/GeneGenie.Gedcom.csproj index 89e56ed..69ce75a 100644 --- a/GeneGenie.Gedcom/GeneGenie.Gedcom.csproj +++ b/GeneGenie.Gedcom/GeneGenie.Gedcom.csproj @@ -12,7 +12,7 @@ CS1573: Parameter 'parameter' has no matching param tag in the XML comment for 'parameter' (but other parameters do) CS1591: Missing XML comment for publicly visible type or member 'Type_or_Member' --> - $(OutputPath)$(AssemblyName).xml + @@ -42,6 +42,7 @@ https://avatars0.githubusercontent.com/u/22330020?s=200&v=4 https://github.com/TheGeneGenieProject/GeneGenie.Gedcom gedcom genegenie gene genie parser genealogy family tree + True diff --git a/GeneGenie.Gedcom/GeneGenie.Gedcom.xml b/GeneGenie.Gedcom/GeneGenie.Gedcom.xml deleted file mode 100644 index 0dfd72f..0000000 --- a/GeneGenie.Gedcom/GeneGenie.Gedcom.xml +++ /dev/null @@ -1,6392 +0,0 @@ - - - - GeneGenie.Gedcom - - - - - General GEDCOM related constants. - - - - - The default name for an individual when they have not been given one. - - - - - The unknown name part. - - - - - The unknown soundex. - - - - - Month and period data used for parsing dates from GEDCOM files. - - - - - All month names that might come up in GEDCOM date formats, abbreviated, non English as well. - - - - - Delimiters that are valid for parsing the date parts of a GEDCOM date record. - - - - - A list of mappings of text prefixes and suffixes to their GEDCOM types. - Not all of these are valid as many tags come from programmes that do not obey the standards. - Longer strings that match the start of shorter strings should be listed first (ABT. before ABT). - - Of particular note; - C or CIRCA from BROSKEEP files, C may be due to the date being set from a baptism / christening, but if that is the - case estimate is still reasonable to go with. - - BROSKEEP seems to be stupid and doesn't make proper use of CAL e.g 'BU.9-6-1825' for a death date means it is really - the burial date that has just been copied to the death date. - Same with birth / baptism. - - - - - Child Linkage Status. - - - - - Unknown - - - - - Challenged - - - - - Disproven - - - - - Proven - - - - - GEDCOM Adoption Type. - - - - - None - - - - - Husband - - - - - Wife - - - - - Husband and Wife - - - - - Indicates the credibility of a piece of information, based upon its supporting evidence. - - - - - Unreliable - - - - - Questionable - - - - - Secondary - - - - - Primary - - - - - Unknown - - - - - The encoding used for the GEDCOM file. - - - - Reserved default / error value. - - - ANSEL encoding. - - - ANSI encoding. - - - ASCII encoding. - - - UTF8 encoding. - - - UTF16, Big Endian. - - - UTF16, Little Endian. - - - UTF32, Big Endian. - - - UTF32, Little Endian. - - - Encoding was not found. We should default to unknown at the top instead and report error. - - - - How accurate is the date and what range does it span?. - - - - A default for dates so that none slip in without being explicitly checked. - - - A single point in time. - - - Any point in time after. - - - Any point in time before. - - - Any point in time between. - - - Roughly near the date. - - - Calculated / reverse engineered from another piece of data. - - - An estimated date, likely to be slightly wrong. - - - What someone thinks the date looks like based on reading old documents. - - - A date range. - - - When parsing date formats dates can be prefixed but are sometimes suffixed. - This defines where to look for specific date period indicators. - - - Error state for uninitialised instances. - - - The text denoting the date period is before the dates. - - - The text denoting the date period is after the dates. - - - - Calendars recognised in GEDCOM format. - - - - Gregorian calendar. - - - Julian calendar. - - - Hebrew calendar. - - - French calendar. - - - Roman calendar. - - - Unknown calendar. - - - - Defines the current error status the parser is in. - - - - - No error has occured - - - - - A level value was expected but not found - - - - - Delimiter after level not found - - - - - The level value is invalid - - - - - Delimiter after XrefID not found - - - - - The ID is too long, can be at most 22 characters - - - - - A GEDCOM tag name (or custom tag name) was expected but not found - - - - - Delimiter, or newline after the tag was not found - - - - - Value expected but not found - - - - - Newline after line value not found - - - - - The line value is invalid - - - - - Delimiter in GEDCOM is a single space, this error will occur - when a multi space delimiter is detected - - - - - An unknown error has occured while parsing - - - - - GEDCOM Event Types. - - - - - Generic Event - - - - - Annulment - - - Declaring a marriage void from the beginning (never existed). - - - - - Census - - - The event of the periodic count of the population for a designated locality, - such as a national or state Census. - - - - - Divorce - - - An event of dissolving a marriage through civil action. - - - - - Divorce Filed - - - An event of filing for a divorce by a spouse. - - - - - Engagement - - - An event of recording or announcing an agreement between two people to become married. - - - - - Marriage Bann - - - An event of an official public notice given that two people intend to marry. - - - - - Marriage Contract - - - An event of recording a formal agreement of marriage, including the prenuptial - agreement in which marriage partners reach agreement about the property rights - of one or both, securing property to their children. - - - - - Marriage - - - A legal, common-law, or customary event of creating a family unit of a man and a woman as husband and wife. - - - - - Marriage License - - - An event of obtaining a legal license to marry. - - - - - Marriage Settlement - - - An event of creating an agreement between two people contemplating marriage, at which time - they agree to release or modify property rights that would otherwise arise from the marriage. - - - - - Residence - - - An address or place of residence that a family or individual resided. - - - - - Birth - - - - - Christening - - - - - Death - - - - - Burial - - - - - Cremation - - - - - Adoption - - - - - Baptism - - - - - Bar Mitzvah - - - - - Bat Mitzvah - - - - - Blessing - - - - - Adult Christening - - - - - Confirmation - - - - - First Communion - - - - - Ordination - - - - - Naturalization - - - - - Emigration - - - - - Immigration - - - - - Census - - - - - Probate - - - - - Will Creation - - - - - Graduation - - - - - Retirement - - - - - Generic Fact - - - - - Caste - - - - - Physical Description - - - - - Education - - - - - National ID Number - - - - - National Or Tribal Origin - - - - - Number of Children - - - - - Number of Marriages - - - - - Occupation - - - - - Possessions - - - - - Religion - - - - - Residence - - - - - Social Security Number - - - - - Nobility Type Title - - - - - Custom - - - - - Line values in GEDCOM can either be a pointer to another record, or the data itself. - - - - - No line value - - - - - Line value is a pointer to another record - - - - - Line value is the actual data - - - - - GEDCOM Record Types. - - - - - Generic Record - - - - - Family - - - - - Individual - - - - - Multimedia - - - - - Note - - - - - Repository - - - - - Source - - - - - Submitter - - - - - Submission - - - - - Event - - - - - Family Event - - - - - Place - - - - - Source Citation - - - - - Latter Day Saints Spouse Sealing record for a married couple. - - - - - Family Link - - - - - Association - - - - - Name - - - - - Individual Event - - - - - Date - - - - - Repository Citation - - - - - Custom Record - - - - - Header - - - - - GEDCOM Restriction Types. - - - Signifies that access to information has been denied or otherwise restricted. - - - - - None - - - - - Confidential - - - - - Locked - - - - - Privacy - - - - - The gender / sex of an individual. - - - - The sex of the individual has not been set yet and is equivalent to null. - - - Undetermined from available records and not quite sure what the sex is./// - - - The individual is male. - - - The individual is female. - - - The individual is both male and female. - - - The individual is neuter. - - - - Defines the parse states for GEDCOM file. - - - - - Reading the current level - - - - - Reading the current ID - - - - - Reading the current tag name - - - - - Reading the value for the current tag - - - - - Marriage Start Status. - - - - - Single - - - - - Private - - - - - Partners - - - - - Other - - - - - Unknown - - - - - Informational, warnings and error codes for the import. - Codes; - 001 - 100 - Informational - 101 - 200 - Warnings - 201 - 300 - Errors. - - - - So that we don't accidentally default to the first id if not initialised, we use unknown. - - - We only received a year as input which is ambiguous. Interpreted as a range, the original date was kept. - - - We only received a year and date as input which is ambiguous. Interpreted as a range, the original date was kept. - - - Parsing a date led to an invalid day of the month which was adjusted. - - - The date could not be turned into a valid date time. - - - - Severity of the messages logged during import. - - - - So that we don't accidentally default to the first id if not initialised, we use unknown. - - - The user can view these, but they should not need to. - - - The user needs to know something and / or make a decision. - - - We couldn't automatically import something, the user needs to intervene. - - - - Indicates the child-to-family relationship for pedigree navigation purposes. - - - - - Unknown - - - - - Adopted - - - - - Biological - - - - - Foster - - - - - Sealing - - - - - Father Adopted - - - - - Mother Adopted - - - - - Source Media Type. - - - - - None - - - - - Audio - - - - - Book - - - - - Card - - - - - Electronic - - - - - Fiche - - - - - Film - - - - - Magazine - - - - - Manuscript - - - - - Map - - - - - Newspaper - - - - - Photo - - - - - Tombstone - - - - - Video - - - - - Civil Registry - - - - - Family Archive CD - - - - - Microfilm - - - - - Census - - - - - Letter - - - - - Official Document - - - - - Microfiche - - - - - Other - - - - - Status of a spouse sealing at a specific date. - - - - - Status not set, record should not be output to GEDCOM file. - - - - - Canceled and considered invalid. - - - - - Completed but the date is not known. - - - - - Patron excluded this ordinance from being cleared in this submission. - - - - - This ordinance is not authorized. - - - - - This ordinance is not authorized, previous sealing cancelled. - - - - - Ordinance is likely completed, another ordinance for this person was converted - from temple records of work completed before 1970, therefore this ordinance is - assumed to be complete until all records are converted. - - - - - Ordinance was previously submitted. - - - - - Data for clearing ordinance request was insufficient. - - - - - Stores details of an address. - - - - - Initializes a new instance of the class. - - - - - Gets or sets a complete address as a single line. - - - - - Gets or sets the first line in an address. - - - - - Gets or sets the second line in an address. - - - - - Gets or sets the third line in an address. - - - - - Gets or sets the date the address was changed. - - - - - Gets or sets the city for the address. - - - - - Gets or sets the country the address is in. - - - - - Gets or sets the database the address is in. - - - - - Gets or sets the main email address. - - - - - Gets or sets the secondary email address. - - - - - Gets or sets the tertiary email address. - - - - - Gets or sets the main fax number. - - - - - Gets or sets the secondary fax number. - - - - - Gets or sets the tertiary fax number. - - - - - Gets or sets the main phone number. - - - - - Gets or sets secondary phone number. - - - - - Gets or sets the tertiary phone number. - - - - - Gets or sets the PostCode / zip code for the address. - - - - - Gets or sets the state or county for the address. - - - - - Gets or sets the main website URI. - - - - - Gets or sets the secondary website URI. - - - - - Gets or sets the tertiary website URI. - - - - - Compares the current and passed-in address to see if they are the same. - - The address to compare the current instance against. - - A 32-bit signed integer that indicates whether this instance precedes, follows, or appears in the same position in the sort order as the value parameter. - - - - - Compares the current and passed-in address to see if they are the same. - - The object to compare the current instance against. - - A 32-bit signed integer that indicates whether this instance precedes, follows, or appears in the same position in the sort order as the value parameter. - - - - - Compares the current and passed-in address to see if they are the same. - - The address to compare the current instance against. - - True if they match, False otherwise. - - - - - Compares the current and passed-in address to see if they are the same. - - The address to compare the current instance against. - - true if the specified is equal to this instance; otherwise, false. - - - - - - - - Add the GEDCOM 6 XML elements for the data in this object as child - nodes of the given root. - - - A . - - - - - Get the GEDCOM 5.5 lines for the data in this object. - Lines start at the given level. - - - A . - - - A . - - - - - Used for holding the age of an individual for a given event, - this is an object rather than it just being a straight forward - number to allow for vague values to be given, e.g. < 10. - - - - - Initializes a new instance of the class. - - - - - Gets or sets the date on which the age of an individual changed. - - - - - Gets or sets. - - TODO: Docs - - - - Gets a value indicating whether the individual is considered stillborn. - - - - - Gets a value indicating whether the individual is considered an infant. - - - - - Gets a value indicating whether the individual is considered a child. - - - - - Gets or sets the year portion of the individual's age. - - - - - Gets or sets the month portion of the individual's age. - - - - - Gets or sets the day portion of the individual's age. - - - - - Parses a string for a GEDCOM format date. - - The string to parse. - The database to associate the result of the parsing with. - The parsed age or a null if the date is not recognised. - - - - Output GEDCOM formatted text representing the age. - - The writer to output to. - The GEDCOM level. - - - - Called after one of the date elements for this instance is changed. - - - - - How the given individual is associated to another. - Each GedcomIndividual contains a list of these. - - - - - Initializes a new instance of the class. - - - - - Gets the record type for an association. - - - - - Gets the GEDCOM tag for an association. - - - - - Gets or sets the description for this association. - - - - - Gets or sets the individual for this association. - - - - - Outputs a GEDCOM format version of this instance. - - The writer to output to. - - - - Compare the user-entered data against the passed instance for similarity. - - The object to compare this instance against. - - True if instance matches user data, otherwise false. - - - - - Compares the current and passed-in object to see if they are the same. - - The object to compare the current instance against. - - A 32-bit signed integer that indicates whether this instance precedes, follows, or appears in the same position in the sort order as the value parameter. - - - - - Compares the current and passed-in association to see if they are the same. - - The association to compare the current instance against. - - A 32-bit signed integer that indicates whether this instance precedes, follows, or appears in the same position in the sort order as the value parameter. - - - - - Compares the current and passed-in association to see if they are the same. - - The association to compare the current instance against. - - True if they match, False otherwise. - - - - - Compares the current and passed-in object to see if they are the same. - - The object to compare the current instance against. - True if they match, False otherwise. - - - - - - - The date on which a GEDCOM record was changed. - - - - - Initializes a new instance of the class. - - The GEDCOM database to associate this date with. - - - - - - - GEDCOM allows for custom tags to be added by applications. - This is essentially a dummy object. - - - - - Initializes a new instance of the class. - - - - - - - - - - - Gets or sets the tag associated with this custom record. - - - - - Placeholder for GEDCOM output code, does not actually output any data. - - The writer to output to. - - - - The database for all the GEDCOM records. - This is currently just in memory. To implement a "real" - database you should derive from this class and override - the necessary methods / properties. - - - - - Initializes a new instance of the class. - - - - - Gets or sets the header for a GEDCOM file. - - - - - Gets or sets hashtable of all top level GEDCOM records, key is the XRef. - Top level records are Individuals, Families, Sources, Repositories, and Media. - - - - - Gets total number of top level GEDCOM records in the database. - Top level records are Individuals, Families, Sources, Repositories, and Media. - - - - - Gets the current GedcomRecord when enumerating the database. - - - - - Gets a list of all the Individuals in the database. - - - - - Gets a list of all the Families in the database. - - - - - Gets a list of all the sources in the database. - - - - - Gets a list of all the repositories in the database. - - - - - Gets a list of all the media items in the database. - - - - - Gets a list of all the notes in the database. - - - - - Gets a list of all the submitters in the database. - - - - - Gets or sets the name of the database, this is currently the full filename - of the GEDCOM file the database was read from / saved to, - but could equally be a connection string for a real backend database. - - - - - Gets all the names used in the database, used primarily to save - memory by storing names only once. - - - - - Gets all the place names used in the database, used primarily to save - memory by storing names only once. - - - - - Gets or sets utility property providing all the surnames in the database, along with - a count of how many people have that surname. - - - - - Gets or sets a value indicating whether the database is being loaded. - - - - - Gets or sets the GedcomRecord associated with the given XRef. - - TODO: Doc. - - - - Determines whether the specified , is equal (in contents, not structure) to this instance. - - The to compare with this instance. - - true if the specified is equal to this instance; otherwise, false. - - - - - - - - - - - Add the given record to the database with the given XRef. - - - A . - - - A . - - - - - Builds up the surname list for use with the Surnames property. - - - - - Remove the given record with the given XRef from the database. - - - A . - - - A . - - - - - Does the database contain a record with the given XRef. - - - A . - - - A . - - - - - Advances the enumerator to the next element of the collection. - - - True if the enumerator was successfully advanced to the next element; - False if the enumerator has passed the end of the collection. - - - - - Sets the enumerator to its initial position, which is before the first element in the collection. - - - - - TODO: Doc. - - TODO: Doc 2. - - - - Create a new XRef. - - - A . - - - A TODO: Doc. - - - - - Combines the given database with this one. - This is literally what it says, no duplicate removal is performed - combine will not take place if there are duplicate xrefs. - - - A . - - - A . - - - - - Add the given individual to the surnames list. - - - A . - - - - - Defines a date, allowing partial dates, date ranges etc. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The database to associate the date with. - - - - - - - - - - Gets or sets the calendar type. - - - - - Gets or sets the date period. - - - - - Gets or sets the time. - - - - - Gets or sets the date, or the first date in a date range. - - - - - Gets the DateTime, or the first DateTime in a date range. - - - - - Gets or sets the second date in a date range. - - - - - Gets the second DateTime in a date range. - - - - - Gets. - - TODO: Doc - TODO: cache this value, clear cache when _DatePeriod / _Date1 / _Date2 / _Time change - - - - Gets a text representation of the date period and date. - TODO: Seems wrongly named, returns original value as well as period. - - - - - Compare two dates to see if first is greater than the second. - - First date to compare. - Second date to compare. - bool. - - - - Compare two dates to see if first is less than the second. - - First date to compare. - Second date to compare. - bool. - - - - Compare two dates to see if they are not equal. - - First date to compare. - Second date to compare. - bool. - - - - Compare two dates to see if they are equal. - - First date to compare. - Second date to compare. - bool. - - - - Compare two GEDCOM format dates. - - First date to compare. - Second date to compare. - 0 if equal, -1 if datea less than dateb, else 1. - - - - Compare the user entered data against the passed instance for similarity. - - The object to compare this instance against. - - True if instance matches user data, otherwise false. - - - - - Determines whether the specified , is equal to this instance. - - The to compare with this instance. - - true if the specified is equal to this instance; otherwise, false. - - - - - Compares the current and passed-in object to see if they are the same. - - The object to compare the current instance against. - A 32-bit signed integer that indicates whether this instance precedes, follows, or appears in the same position in the sort order as the value parameter. - - - - Compares the current and passed-in date to see if they are the same. - - The date to compare the current instance against. - A 32-bit signed integer that indicates whether this instance precedes, follows, or appears in the same position in the sort order as the value parameter. - - - - Compares the current and passed-in date to see if they are the same. - - The date to compare the current instance against. - True if they match, False otherwise. - - - - - - - Returns a percentage based score on how similar the passed record is to the current instance. - - The date to compare this instance against. - A score from 0 to 100 representing the percentage match. - - - - Extracts the date period from raw text and attempts to guess if the date period is not present. - - The data string. - A object with the period and the text removed from the input string. - - - - Parse passed date into instance properties. - - The date to parse as a text string. - - - - Output GEDCOM format for this instance. - - Where to output the data to. - - - - Compare two possibly null dates. - - First date to compare. - Second date to compare. - 0 if dates match, -1 if dateaDate is less than datebDate, otherwise 1. - - - - Fuzzy matching of dates. TODO: Unit test coverage, no idea how well this works. - - First date to compare. - Second date to compare. - Returns a float rather than an int to allow for some fuzziness - e.g. 10-11-2000 is 10 NOV 2000 or 11 OCT 2000. - - - - - Split a date string into parts. - - The date to split. - Array of strings representing parts of a date. - - - - Get DateTime information from an array representing parts of a date. - - The parts of a valid date. - The first element in the array that contains a valid date part. - The number of elements in the array that contain valid date parts. - The calendar for the given date. - The original date string, used for feedback to the user if the date cannot be parsed. - Return a DateTime if the passed-in values could be parsed into a valid DateTime; otherwise null. - - - The result of parsing and extracting a date period from a string. - - - Gets or sets the string that shows the parsed data with the date period extracted. - - - Gets or sets the date period that has been parsed from the raw text. - - - - Maps a date / date range indicator from the GEDCOM file to it's enum. - - - - Gets or sets the date period that this element maps to. - - - Gets or sets the text that is searched for in the GEDCOM date line. - - - Gets or sets the position of the text that is searched for. - - - - Defines a generic event or fact. - - - - - The GEDCOM event type. - - - - - The classification. - - - - - The certainty. - - - - - The record. - - - - - Used for Gedcom 6 XML output. - - - - - The event name. - - - - - The date. - - - - - The place. - - - - - The address. - - - - - The responsible agency. - - - - - The religious affiliation. - - - - - The cause. - - - - - Initializes a new instance of the class. - - - - - Gets the type of the record. - - - The type of the record. - - - - - Gets the gedcom tag. - - - The gedcom tag. - - - - - Gets or sets the type of the event. - - - The type of the event. - - - - - Gets or sets the name of the event. - - - The name of the event. - - - - - Gets or sets the classification. - - - The classification. - - - - - Gets or sets the date. - - - The date. - - - - - Gets or sets the place. - - - The place. - - - - - Gets or sets the address. - - - The address. - - - - - Gets or sets the responsible agency. - - - The responsible agency. - - - - - Gets or sets the religious affiliation. - - - The religious affiliation. - - - - - Gets or sets the cause. - - - The cause. - - - - - Gets or sets the certainty. - - - The certainty. - - - - - Gets or sets the event x reference identifier. - - - The event x reference identifier. - - - - - Gets or sets the record. - - - The record. - - - - - Gets or sets the change date. - - - The change date. - - - - - Get the user-friendly textual description for a GedcomEventType. - - A GEDCOM event type. - - The textual description for a given GedcomEventType. - - - - - Get the tag for a GedcomEventType. - - A GEDCOM event type. - - The tag for a given GedcomEventType. - - - - - Attempts to determine a standard event type from a textual - description. Always returns GenericEvent if one can't be found - even though where the string came from maybe a FACT. - - The type name as a string. - - A GedcomEventType matching the textual description, or GenericEvent if no match was found. - - - - - Deletes this instance. - - - - - Compares two events to see if the date and place are the same. - - The event instance to compare against. - Relative position in the sort order. - - - - Compares two events to see if the date and place are the same. - - The event instance to compare against. - Relative position in the sort order. - - - - Returns a percentage based score on how similar the passed record is to the current instance. - - The event to compare against this instance. - A score from 0 to 100 representing the percentage match. - - - - Generates the XML. - - The root. - - - - Outputs the specified sw. - - The sw. - - - - Compare the user entered data against the passed instance for similarity. - - The object to compare this instance against. - - True if instance matches user data, otherwise false. - - - - - Compare the user entered data against the passed instance for similarity. - - The GedcomEvent to compare this instance against. - - True if instance matches user data, otherwise false. - - - - - An event relating to a given family. - - - - - Initializes a new instance of the class. - - - - - Gets the type of the record. - - - The type of the record. - - - - - Gets or sets the husband age. - - - The husband age. - - - - - Gets or sets the wife age. - - - The wife age. - - - - - Gets or sets the family record. - - - The family record. - - Must set a GedcomFamilyRecord on a GedcomFamilyEvent. - - - - Gets or sets the change date. - - - The change date. - - - - - Output GEDCOM format for this family event. - - Where to output the data to. - - - - - - - How an individual is linked to a family. - - - - - Initializes a new instance of the class. - - - - - Gets the type of the record. - - - The type of the record. - - - - - Gets or sets the family. - - - The family. - - - - - Gets or sets the individual being linked in this family record. - - - - - Gets or sets the pedigree. - - - The pedigree. - - - - - Gets or sets the father pedigree. - - - The father pedigree. - - - - - Gets or sets the mother pedigree. - - - The mother pedigree. - - - - - Gets or sets the status. - - - The status. - - - - - Gets or sets a value indicating whether [preferred spouse]. - - - true if [preferred spouse]; otherwise, false. - - - - - Compares the current and passed family link to see if they are the same. - - The object to compare the current instance against. - True if they match, False otherwise. - - - - Compares the current and passed family link to see if they are the same. - - The family link to compare the current instance against. - A 32-bit signed integer that indicates whether this instance precedes, follows, or appears in the same position in the sort order as the value parameter. - - - - Compares the current and passed family link to see if they are the same. - - The object to compare the current instance against. - A 32-bit signed integer that indicates whether this instance precedes, follows, or appears in the same position in the sort order as the value parameter. - - - - Compares the current and passed family link to see if they are the same. - - The GedcomFamilyLink to compare the current instance against. - True if they match, False otherwise. - - - - Compares the current and passed-in object to see if they are the same. - - The object to compare the current instance against. - True if they match, False otherwise. - - - - - - - Defines a family, consisting of husband/wife and children, and - family events. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The database to associate with this record. - The first individual. - The second individual. - - - - Gets the type of the record. - - - The type of the record. - - - - - Gets the gedcom tag for a family record. - - - The gedcom tag for a family record. - - - - - Gets the family events. - - - The family events. - - - - - Gets or sets the husband. - - - The husband. - - - - - Gets or sets the wife. - - - The wife. - - - - - Gets the children. - - - The children. - - - - - Gets or sets the number of children. - - - The number of children. - - - - - Gets the submitter records. - - - The submitter records. - - - - - Gets the marriage. - - - The marriage. - - - - - Gets or sets the start status. - - - The start status. - - - - - Gets or sets the spousal sealing record for this family or null if one does not exist. - - - - - Gets or sets the change date. - - - The change date. - - - - - Deletes this instance. - - - - - Add a new family event for a given event type. - - The event type. - - The new family event based on the given event type. - - - - - Add a child. - - The child. - - Returns True if a new child record is added; otherwise False. - - - - - Add a new child. - - - The child's record. - - - - - Remove a child. - - The child. - - - - Changes the husband. - - The husband. - - - - Changes the wife. - - The wife. - - - - Removes the husband. - - The husband. - - - - Removes the wife. - - The wife. - - - - Clears the linkage types. - - - - - Sets the type of the linkage. - - The child xref identifier. - The pedigree linkage type. - - - - Sets the type of the linkage. - - The child xref identifier. - The pedigree linkage type. - The adoption type. - - - - Gets the type of the husband linkage. - - The child xref identifier. - - Pedigree linkage type for husband. - - - - - Gets the type of the wife linkage. - - The child xref identifier. - - Pedigree linkage type for wife. - - - - - Gets the type of the linkage. - - The child xref identifier. - - Pedigree linkage type. - - - - - Generates the XML. - - The root node. - - - - Output GEDCOM format for this instance. - - Where to output the data to. - - - - Compare the user entered data against the passed instance for similarity. - - The object to compare this instance against. - - True if instance matches user data, otherwise false. - - - - - Compare the user entered data against the passed instance for similarity. - - The GedcomFamilyRecord to compare this instance against. - - True if instance matches user data, otherwise false. - - - - - Compares the current and passed-in object to see if they are the same. - - The object to compare the current instance against. - True if they match, False otherwise. - - - - - - - Compares two objects for equality. - - - - - Compares two records to see if they are equal. - Safely handles one or both being null. - The records must implement IComparable. - - A type that implements IComparable. - The first record. - The second record. - - Returns an integer that indicates their relative position in the sort order. - - - - - Compares two records to see if they are equal. - Safely handles one or both being null. - The records must implement IComparable. - - A type that implements IComparable. - The first record. - The second record. - - Returns an integer that indicates their relative position in the sort order. - - - - - Compares two lists of objects that inherit from GedcomRecord for equality. - - - - - Compares two lists of records to see if they are equal. - Uses the automated record id from the base class for sorting. - - A class that inherits from and implements Equals/GetHashCode. - The first list of records. - The second list of records. - - True if they match, otherwise false. - - - - - Compares two lists to see if they are equal. - Relies on the sorting of the generic type used. - - Any old object that can be compared. - The first list of records. - The second list of records. - - True if they match, otherwise false. - - - - - Compares two lists of records to see if they are equal. - The records must implement IComparable and inherit from GedcomRecord. - - A type that inherits from GedcomRecord and implements IComparable. - The first list of records. - The second list of records. - - Returns an integer that indicates their relative position in the sort order. - - - - - Compares two lists of records to see if they are equal. - The records must implement IComparable. - - A type that implements IComparable. - The first list of records. - The second list of records. - - Returns an integer that indicates their relative position in the sort order. - - - - - The header from / for a GEDCOM file. - - - - - Initializes a new instance of the class. - - - - - Gets or sets the database. - - - The database. - - Database can only have one header. - - - - Gets or sets the name of the application. - - - The name of the application. - - - - - Gets or sets the application version. - - - The application version. - - - - - Gets or sets the application system identifier. - - - The application system identifier. - - - - - Gets or sets the corporation. - - - The corporation. - - - - - Gets or sets the corporation address. - - - The corporation address. - - - - - Gets or sets the content description. - - - The content description. - - - - - Gets or sets the submitter x reference identifier. - - - The submitter x reference identifier. - - - - - Gets or sets the submitter. - - - The submitter. - - - - - Gets or sets the transmission date. - - - The transmission date. - - - - - Gets or sets the copyright. - - - The copyright. - - - - - Gets or sets the language. - - - The language. - - - - - Gets or sets the filename. - - - The filename. - - - - - Gets or sets the name of the source. - - - The name of the source. - - - - - Gets or sets the source date. - - - The source date. - - - - - Gets or sets the source copyright. - - - The source copyright. - - - - - Gets the type of the record. - - - The type of the record. - - - - - Output GEDCOM format for this instance. - - Where to output the data to. - - - - Checks if the passed header is equal in terms of user content to the current instance. - If new fields are added to the header they should also be added in here for comparison. - - The object to compare against this instance. - Returns true if headers match in user entered content, otherwise false. - - - - Checks if the passed header is equal in terms of user content to the current instance. - If new fields are added to the header they should also be added in here for comparison. - - The GedcomHeader to compare against this instance. - Returns true if headers match in user entered content, otherwise false. - - - - - - - An event relating to a given individual. - - - - - Initializes a new instance of the class. - - - - - Gets the type of the record. - - - The type of the record. - - - - - Gets or sets the age. - - - The age. - - - - - Gets or sets the family in which an individual appears as a child. - - - - - Gets or sets the adoption type. - - - - - Gets or sets the individual's record. - - Must set a GedcomIndividualRecord on a GedcomIndividualEvent. - - - - Gets or sets the change date. - - - The change date. - - - - - Output GEDCOM format for this instance. - - Where to output the data to. - - - - Details about a given individual. - - - - - The ancestral file number. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The database to associate with this record. - - - - Initializes a new instance of the class. - - The database to associate with this record. - The surname. - - - Gets or sets the list of entries found when parsing an individual. - - - - Gets the type of the record. - - - The type of the record. - - - - - Gets the GEDCOM tag for an individual. - - - The GEDCOM tag. - - - - - Gets the individual's names. - - - The names of the individual. - - - - - Gets a single letter representing the individual's gender. - - - The gender character. - - - - - Gets or sets the sex. - - - The sex. - - - - - Gets the events. - - - The events. - - - - - Gets the list of events. - - - The list of events. - - - - - Gets the child in. - - - The child in. - - - - - Gets the spouse in. - - - The spouse in. - - - - - Gets the submitter records. - - - The submitter records. - - - - - Gets this individual's associations to others. - - - The associations. - - - - - Gets the list of aliases. - - - The list of aliases. - - - - - Gets the anci. - - - The anci. - - - - - Gets the desi. - - - The desi. - - - - - Gets or sets the permanent record file number. - - - The permanent record file number. - - - - - Gets or sets the ancestral file number. - - - The ancestral file number. - - - - - Gets or sets the address. - This is a hack, not according to the spec, but Family Tree Maker sticks - an address under an individual. - GedcomRecordReader will build the address up here, then create a RESI record from it. - - - The address. - - - - - Gets the birth. - - - The birth. - - - - - Gets the death. - - - The death. - - - - - Gets the height. - - - The height. - - - - - Gets the weight. - - - The weight. - - - - - Gets the medical event. - - - The medical event. - - - - - Gets a value indicating whether this is dead. - - - true if dead; otherwise, false. - - - - - Gets or sets the change date. - - - The change date. - - - - - - - - Compares the current and passed individual to see if they are the same. - Compares using user submitted data, not the internal ids which may change. - - The object to compare the current individual instance against. - True if they match, false otherwise. - - - - Compares the current and passed individual to see if they are the same. - Compares using user submitted data, not the internal ids which may change. - - The individual to compare the current instance against. - A 32-bit signed integer that indicates whether this instance precedes, follows, or appears in the same position in the sort order as the value parameter. - - - - Compares the current individual against the passed individual to see if they are - essentially the same. Compares the content, not the structure. - For example, names are compared but internal xref ids are not. - - The second person to compare against. - TODO: Doc. - - - - Compares the current and passed individual to see if they are the same. - Compares using user submitted data, not the internal ids which may change. - - The other individual to compare the current individual against. - True if they match, false otherwise. - - - - Deletes this instance. - - - - - Gets the preferred name (if set) or the first name if no preferred name is set. - - A GedcomName or null if no names found. - - - - Sets the name of the preferred. - - The name. - - - - Determine whether a spouse is in the family. - - The family. - - True if spouse is in the family; otherwise False. - - - - - Determine whether a spouse is in the family. - - The family. - The family link. - - True if spouse is in the family; otherwise False. - - - - - Determine whether a child is in the family. - - The family. - - True if child is in the family; otherwise False. - - - - - Determines whether a child is in the family. - - The family. - The fam link. - - True if child is in the family; otherwise False. - - - - - Gets the family. - - - Family. - - - - - Sets the preferred spouse. - - The xref identifier. - - - - Finds the event. - - Type of the event. - - The event if found; otherwise null. - - - - - Matches the surname. - - The prefix. - if set to true [soundex]. - - True if the surname starts with prefix; otherwise False. - - - - - Matches the firstname. - - The prefix. - if set to true [soundex]. - - True if the firstname starts with prefix; otherwise False. - - - - - Determines whether the passed individual is a match for the current instance - based on key user entered data. - - The individual to compare this instance against. - A score from 0 to 100 representing the percentage match. - - - - Gets a "fake" family record that contains all of this individual's children. - The record will only contain children. - - - A . - - - - - Outputs this instance of an individual as a GEDCOM record. - - The textwriter to output to. - - - - A multimedia file. - - - - - Initializes a new instance of the class. - - - - - Gets or sets the database. - - - The database. - - - - - Gets or sets the filename. - - - The filename. - - - - - Gets or sets the format. - - - The format. - - - - - Gets or sets the type of the source media. - - - The type of the source media. - - - - - Gets or sets the change date. - - - The change date. - - - - - Compares an object to this GedcomMultimediaFile to determine sort order. - - The object to compare to the current instance. - Returns a value determine the sort order of the compared objects. - - - - Compares two GedcomMultimediaFile instances to determine sort order. - - The GedcomMultimediaFile to compare to the current instance. - Returns a value determine the sort order of the compared GedcomMultimediaFile objects. - - - - Compares two instances of GedcomMultimediaFile to determine equality. - - The GedcomMultimediaFile to compare to the current instance. - True if equal, otherwise False. - - - - Compares an object to this GedcomMultimediaFile to determine equality. - - The object to compare to the current instance. - True if equal, otherwise False. - - - - - - - Updates the change date and time. - - - - - A multimedia record, this can consist of any number of files - of varying types. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The database to associate with this record. - - - - Gets the type of the record. - - - The type of the record. - - - - - Gets the GEDCOM tag for a multimedia record. - - - The GEDCOM tag. - - - - - Gets the multimedia files. - - - The multimedia files. - - - - - Gets or sets the title. - - - The title. - - - - - Gets or sets the change date. - - - The change date. - - - - - Compares the two passed records by title. - - The first multimedia record. - The second multimedia record. - - <0 if the first record's title precedes the second in the sort order; - >0 if the second record's title precedes the first; - 0 if the titles are equal. - - - - - Adds the multimedia file. - - The filename. - - - - Outputs this instance as a GEDCOM record. - - The writer to output to. - - - - Compare the user entered data against the passed instance for similarity. - - The object to compare this instance against. - - True if instance matches user data, otherwise false. - - - - - Compare the user entered data against the passed instance for similarity. - - The GedcomMultimediaRecord to compare this instance against. - - True if instance matches user data, otherwise false. - - - - - Compare the user entered data against the passed instance for similarity. - - The object to compare this instance against. - - True if instance matches user data, otherwise false. - - - - - - - - A name for a given individual, allowing different variations to be - stored. - - - - - Initializes a new instance of the class. - - - - - Gets the type of the record. - - - The type of the record. - - - - - Gets the GEDCOM tag. - - - The GEDCOM tag. - - - - - Gets or sets the name. - - - The name. - - - - - Gets or sets the type. - - - The type. - - - - - Gets the phonetic variations. - - - The phonetic variations. - - - - - Gets the romanized variations. - - - The romanized variations. - - - - - Gets or sets the surname. - - - The surname. - - - - - Gets the surname soundex. - - - The surname soundex. - - - - - Gets the firstname soundex. - - - The firstname soundex. - - - - - Gets or sets the prefix. - - - The prefix. - - - - - Gets or sets the given. - - - The given. - - - - - Gets or sets the surname prefix. - - - The surname prefix. - - - - - Gets or sets the suffix. - - - The suffix. - - - - - Gets or sets the nick. - - - The nick. - - - - - Gets or sets the change date. - - - The change date. - - - - - Gets or sets a value indicating whether this is the individuals preferred name. - - - true if [preferred name]; otherwise, false. - - - - - Compares two GedcomName instances by using the full name. - - The name to compare against this instance. - An integer specifying the relative sort order. - - - - Compares two GedcomName instances by using the full name. - - The name to compare against this instance. - An integer specifying the relative sort order. - - - - Compare the user-entered data against the passed instance for similarity. - - The GedcomName to compare this instance against. - - True if instance matches user data, otherwise False. - - - - - Compare the user-entered data against the passed instance for similarity. - - The object to compare this instance against. - - True if instance matches user data, otherwise False. - - - - - Returns a percentage based score on how similar the passed record is to the current instance. - - The event to compare against this instance. - A score from 0 to 100 representing the percentage match. - - - - Outputs this instance as a GEDCOM record. - - The writer to output to. - - - - GEDCOM Note Record. - - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The database to associate with this record. - - - - Gets or sets the parsed text. HACK. - - - - - Gets the type of the record. - - - The type of the record. - - - - - Gets the GEDCOM tag for a note record. - - - The GEDCOM tag. - - - - - Gets or sets the text. - - - The text. - - - - - Generates the XML. - - The root node. - - - - Outputs this instance as a GEDCOM record. - - The writer to output to. - - - - Compare the user entered data against the passed instance for similarity. - - The object to compare this instance against. - - True if instance matches user data, otherwise false. - - - - - Compare the user entered data against the passed instance for similarity. - - The GedcomNoteRecord to compare this instance against. - - True if instance matches user data, otherwise false. - - - - - A message generated by the GEDCOM file parsing process to provide feedback to the user on warnings, errors and information. - - - - - Initializes a new instance of the class. - - The message identifier, from the master list of enums. - A bunch of context parameters that are relevant to this message id. - - - - Gets the additional data that was logged with the message for context. - - - - - Gets or sets the message id uniquely identifying where this message was generated from in code. - - - - - Gets the severity of the message. This is fixed here for now as it is very simple. - - - - - Represents a place or location. - - - - - - Initializes a new instance of the class. - - - - - Gets the type of the record. - - - The type of the record. - - - - - Gets the GEDCOM tag for a place. - - - The GEDCOM tag. - - - - - Gets or sets the name. - - - The name. - - - - - Gets or sets the form. - - - The form. - - - - - Gets the phonetic variations. - - - The phonetic variations. - - - - - Gets the romanized variations. - - - The romanized variations. - - - - - Gets or sets the latitude. - - - The latitude. - - - - - Gets or sets the longitude. - - - The longitude. - - - - - Gets or sets the change date. - - - The change date. - - - - - Outputs this instance as a GEDCOM record. - - The writer to output to. - - - - Compare the user entered data against the passed instance for similarity. - - The object to compare this instance against. - - True if instance matches user data, otherwise false. - - - - - Compare the user entered data against the passed instance for similarity. - - The GedcomPlace to compare this instance against. - - True if instance matches user data, otherwise false. - - - - - Compares this place record to another record. - - A place record. - - <0 if the this record precedes the other in the sort order; - >0 if the other record precedes this one; - 0 if the records are equal. - - - - - Compare the user entered data against the passed instance for similarity. - - The GedcomRepositoryRecord to compare this instance against. - - True if instance matches user data, otherwise False. - - - - - GEDCOM Record. - - - - - The level. - - - - - The user reference number. - - - - - The user reference type. - - - - - The automated record identifier. - - - - - The change date. - - - - - The notes. - - - - - The multimedia. - - - - - The sources. - - - - - Initializes a new instance of the class. - - - - - Gets or sets a backpointer to know which database this record is in. - - - - - Gets or sets the xref identifier. - - - - - Gets the type of the record. - - - The type of the record. - - - - - Gets the GEDCOM tag. - - - The GEDCOM tag. - - - - - Gets or sets the level. - - - The level. - - - - - Gets or sets the parsing level. - When we are removing inline note records etc. the new - record is set to level 0, this breaks the parsing mechanism, - so we need to record the level the record used to occur on - TODO: this is a bit of a hack as it adds parsing related code to non - parsing data. - - - - - Gets or sets the x reference identifier. - - - The x reference identifier. - - - - - Gets or sets the user reference number. - - - The user reference number. - - - - - Gets or sets the type of the user reference. - - - The type of the user reference. - - - - - Gets or sets the automated record identifier. - - - The automated record identifier. - - - - - Gets or sets the change date. - - - The change date. - - MISSING DATABASE: " + this.RecordType.ToString(). - - - - Gets a list of cross references to notes for this record. - - - - - Gets the multimedia. - - - The multimedia. - - - - - Gets the sources. - - - The sources. - - - - - Gets or sets the reference count. - - - The reference count. - - - - - Gets or sets the restriction notice. - - - Not standard GEDCOM, but no reason not to put a restriction notice at this level. - - - The restriction notice. - - - - - Gets the list of informational, warning and error messages generated when parsing this record. - - - - - Deletes this instance. - - Ref Count already 0. - - - - Generates the XML. - - The root node. - - - - Generates the note XML. - - The root node. - - - - Generates the citations XML. - - The record node. - - - - Generates the multimedia XML. - - The record node. - - - - Generates the change date XML. - - The record node. - - - - Outputs this instance as a GEDCOM record. - - The writer to output to. - - - - Must be overridden in derived classes to compare the user entered data for that instance. - Called from the method before it checks common - data elements (notes, sources etc.). - We use the word equivalent so that we avoid using the word equals. This is because we are - checking user entered data only and as far as the end user cares, two records can be equivalent - (matching) but they might be two different individuals / families etc. - - The object to compare this instance against. - True if instance matches user data, otherwise False. - - - - Compares the inheriting instance user entered data against the passed GedcomRecord. - If that matches, will then compare the common elements of the passed GedcomRecord - against this instance (Source etc. which are common to all inheritors). - - The GedcomRecord to compare against. - True if the core base properties match, otherwise False. - - - - - - - - - - Splits the text. - - The streamwriter. - The line. - The level. - - - - Adds a warning, information or error message for the user to review after parsing. - - The warning identifier. - An array of additional data for context on the error. - - - - Update the GedcomChangeDate for this record. - - The sender. - The instance containing the event data. - - - - Update the GedcomChangeDate for this record. - - - - - Splits the text. - - The stream writer. - The line. - - - - Outputs the standard. - - The writer. - - - - TODO: Doc. - - - - - Initializes a new instance of the class. - - - - - Gets or sets the date that this record was changed. - - - The date of the change. - - - - - Gets or sets the database. - - - The database. - - - - - Gets or sets the types. - - - The types. - - - - - Gets or sets the date. - - - The date. - - - - - Gets or sets the place. - - - The place. - - - - - Compares this event to another record. - - A recorded event. - - <0 if the first event precedes the second in the sort order; - >0 if the second event precedes the first; - 0 if the events are equal. - - - - - Compares this event to another record. - - A recorded event. - - <0 if the first event precedes the second in the sort order; - >0 if the second event precedes the first; - 0 if the events are equal. - - - - - Compare the GedcomRecordedEvent against the passed instance for similarity. - - The other instance to compare this instance against. - - True if other instance matches this instance, otherwise False. - - - - - Compare the GedcomRecordedEvent against the passed instance for similarity. - - The other instance to compare this instance against. - - True if other instance matches this instance, otherwise False. - - - - - - - - Updates the changed date and time. - - - - - TODO: Doc + i think we might be able to use an ObservableList instead. - - TODO: Not sure what uses this yet. - - - - - - - - TODO: Doc. - - - - - - Initializes a new instance of the class. - - - - - Gets the type of the record. - - - The type of the record. - - - - - Gets the GEDCOM tag for a repository citation. - - - The GEDCOM tag. - - - - - Gets or sets the repository. - - - The repository. - - - - - Gets the call numbers. - - - The call numbers. - - - - - Gets the media types. - - - The media types. - - - - - Gets or sets the other media types. - - - The other media types. - - - - - Deletes this instance. - - - - - Generates the XML. - - The root. - The number. - - - - Outputs this repository citation as a GEDCOM record. - - The writer to output to. - - - - Compare the user entered data against the passed instance for similarity. - - The object to compare this instance against. - - True if instance matches user data, otherwise false. - - - - - - - - Compare the user entered data against the passed instance for similarity. - - The object to compare this instance against. - - True if instance matches user data, otherwise false. - - - - - - - - An institution or person that has the specified item as part of their collection(s). - - - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The database to associate with this record. - - - - Gets the type of the record. - - - The type of the record. - - - - - Gets the GEDCOM tag for a repository record. - - - The GEDCOM tag. - - - - - Gets or sets the name. - - - The name. - - - - - Gets or sets the address. - - - The address. - - - - - Gets the citations. - - - The citations. - - - - - Gets or sets the change date. - - - The change date. - - - - - Compares the names of the passed records. - - The first repository record. - The second repository record. - - <0 if the first record's name precedes the second in the sort order; - >0 if the second record's name precedes the first; - 0 if the names are equal. - - - - - Compares this repository record to another record. - - A repository record. - - <0 if this record precedes the other in the sort order; - >0 if the other record precedes this one; - 0 if the records are equal. - - - - - Generates the XML. - - The root node. - - - - Outputs this repository record as a GEDCOM record. - - The writer to output to. - - - - Compare the user entered data against the passed instance for similarity. - - The object to compare this instance against. - - True if instance matches user data, otherwise False. - - - - - Compares this repository record to another record. - - A repository record. - - <0 if this record precedes the other in the sort order; - >0 if the other record precedes this one; - 0 if the records are equal. - - - - - Compare the user entered data against the passed instance for similarity. - - The GedcomRepositoryRecord to compare this instance against. - - True if instance matches user data, otherwise False. - - - - - TODO: Doc. - - - - - - Initializes a new instance of the class. - - - - - Gets or sets the parsed text. HACK. - - - - - Gets the type of the record. - - - The type of the record. - - - - - Gets the GEDCOM tag for a source citation. - - - The GEDCOM tag. - - - - - Gets or sets the source. - - - The source. - - - - - Gets or sets the page. - - - The page. - - - - - Gets or sets the type of the event. - - - The type of the event. - - - - - Gets or sets the role. - - - The role. - - - - - Gets or sets the certainty. - - - The certainty. - - - - - Gets or sets the date. - - - The date. - - - - - Gets or sets the text. - - - The text. - - - - - Deletes this instance. - - - - - Generates the XML. - - The root node. - - - - Outputs this source citation as a GEDCOM record. - - The writer to output to. - - - - Compare the user entered data against the passed instance for similarity. - - The object to compare this instance against. - - True if instance matches user data, otherwise false. - - - - - Compare the user entered data against the passed instance for similarity. - - The GedcomSourceCitation to compare this instance against. - - True if instance matches user data, otherwise false. - - - - - Compare the user entered data against the passed instance for similarity. - - The object to compare this instance against. - - True if instance matches user data, otherwise false. - - - - - Compares another source citation to the current instance. - - A citation. - - <0 if this citation precedes the other in the sort order; - >0 if the other citation precedes this one; - 0 if the citations are equal. - - - - - Compares another object to the current instance. - - A citation. - - <0 if this object precedes the other in the sort order; - >0 if the other object precedes this one; - 0 if the objects are equal. - - - - - - - - TODO: Doc. - - - - - - - The events recorded. - - - - - The agency. - - - - - The data notes. - - - - - The originator. - - - - - The title. - - - - - The filed by. - - - - - The publication facts. - - - - - The text. - - - - - The repository citations. - - - - - The citations. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The database to associate with this record. - - - - Gets or sets the originator text. HACK. - - - - - Gets or sets the title text. - - - - - Gets or sets the publication text. - - - - - Gets or sets the text text. TODO: What?. - - - - - Gets the type of the record. - - - The type of the record. - - - - - Gets the GEDCOM tag for a source record. - - - The GEDCOM tag. - - - - - Gets the events recorded. - - - The events recorded. - - - - - Gets or sets the agency. - - - The agency. - - - - - Gets the data notes. - - - The data notes. - - - - - Gets or sets the originator. - - - The originator. - - - - - Gets or sets the title. - - - The title. - - - - - Gets or sets the filed by. - - - The filed by. - - - - - Gets or sets the publication facts. - - - The publication facts. - - - - - Gets or sets the text. - - - The text. - - - - - Gets the repository citations. - - - The repository citations. - - - - - Gets the citations. - - - The citations. - - - - - Gets or sets the change date. - - - The change date. - - - - - Compares two source records by title. - - The first source record. - The second source record. - - <0 if the first record's title precedes the second in the sort order; - >0 if the second record's title precedes the first; - 0 if the titles are equal. - - - - - Compares this source record to another record. - - A source record. - - <0 if the first record precedes the second in the sort order; - >0 if the second record precedes the first; - 0 if the records are equal. - - - - - Deletes this instance. - - - - - Generates the XML. - - The root node. - - - - Outputs this source record as a GEDCOM record. - - The writer to output to. - - - - Compare the user entered data against the passed instance for similarity. - - The object to compare this instance against. - - True if instance matches user data, otherwise false. - - - - - Compares this source record to another record. - - A source record. - - <0 if the first record precedes the second in the sort order; - >0 if the second record precedes the first; - 0 if the records are equal. - - - - - Compare the user entered data against the passed instance for similarity. - - The GedcomSourceRecord to compare this instance against. - - True if instance matches user data, otherwise false. - - - - - Compare the user entered data against the passed instance for similarity. - - The GedcomSourceRecord to compare this instance against. - - True if instance matches user data, otherwise false. - - - - - - - - Details the spouse sealing event which can occur between a husband and wife. - Sealing is a ritual performed by Latter Day Saint temples to seal familial relationships and - the promise of family relationships throughout eternity. - - - - - The date that this sealing occurred on. - - - - - The description for this sealing event. - - - - - The place at which this sealing occurred. - - - - - The status of this sealing. - - - - - The date that the status was last changed. - - - - - The temple code. - - - - - Gets or sets the date that this sealing occurred on. - - - - - Gets or sets the description for this sealing event. - - - - - Gets or sets the place that this sealing occurred at. - - - - - Gets or sets the status of this sealing at a point in time. - - - - - Gets or sets the date that the status was last changed. - - - - - Gets or sets the temple code. - - - - - Gets the type of the record. - - - - - Gets the GEDCOM tag for a spouse sealing record. - - - - - Compare two GEDCOM spouse sealing records. - - First record to compare. - Second record to compare. - 0 if equal, -1 if recorda less than recordb, else 1. - - - - Compare the user entered data against the passed instance for similarity. - - The object to compare this instance against. - - True if instance matches user data, otherwise false. - - - - - Determines whether the specified , is equal to this instance. - - The to compare with this instance. - - true if the specified is equal to this instance; otherwise, false. - - - - - Compares the current and passed-in object to see if they are the same. - - The object to compare the current instance against. - A 32-bit signed integer that indicates whether this instance precedes, follows, or appears in the same position in the sort order as the value parameter. - - - - Compares the current and passed-in sealing record to see if they are the same. - - The sealing record to compare the current instance against. - A 32-bit signed integer that indicates whether this instance precedes, follows, or appears in the same position in the sort order as the value parameter. - - - - Compares the current and passed-in sealing record to see if they are the same. - - The sealing record to compare the current instance against. - True if they match, False otherwise. - - - - - - - Outputs this instance as a GEDCOM record. - - The writer to output to. - - - - TODO: Doc. - - - - - - The submitter. - - - - - The family file. - - - - - The temple code. - - - - - The generations of ancestors. - - - - - The generations of decendants. - - - - - The ordinance process flag. - - - - - Initializes a new instance of the class. - - - - - Gets the type of the record. - - - The type of the record. - - - - - Gets the GEDCOM tag for a submission record. - - - The GEDCOM tag. - - - - - Gets or sets the submitter. - - - The submitter. - - - - - Gets or sets the family file. - - - The family file. - - - - - Gets or sets the temple code. - - - The temple code. - - - - - Gets or sets the generations of ancestors. - - - The generations of ancestors. - - - - - Gets or sets the generations of decendants. - - - The generations of decendants. - - - - - Gets or sets a value indicating whether [ordinance process flag]. - - - true if [ordinance process flag]; otherwise, false. - - - - - Compare the user entered data against the passed instance for similarity. - - The object to compare this instance against. - - True if instance matches user data, otherwise false. - - - - - Compare the user entered data against the passed instance for similarity. - - The GedcomSubmissionRecord to compare this instance against. - - True if instance matches user data, otherwise false. - - - - - An individual or organization who contributes genealogical data to a file or transfers it to someone else. - - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The database to associate with this record. - - - - Gets the type of the record. - - - The type of the record. - - - - - Gets the GEDCOM tag for a submitter record. - - - The GEDCOM tag. - - - - - Gets or sets the name. - - - The name. - - - - - Gets or sets the address. - - - The address. - - - - - Gets or sets the language preferences. - - - The language preferences. - - - - - Gets or sets the registered RFN. - - - The registered RFN. - - - - - Gets or sets the change date. - - - The change date. - - - - - Outputs this submitter record as a GEDCOM record. - - The writer to output to. - - - - Compare the user entered data against the passed instance for similarity. - - The object to compare this instance against. - - True if instance matches user data, otherwise false. - - - - - Compare the user entered data against the passed instance for similarity. - - The GedcomSubmitterRecord to compare this instance against. - - True if instance matches user data, otherwise false. - - - - - Used by a stack to store a tag and level for tracking the parsing process. - - - - Gets or sets the current tag name. - - - Gets or sets the current tag level. - - - - Enum helper class for parsing an enum. - - - - Parses the specified value. - The enum type to parse. - The text value to parse. - The enum equivalent of the passed text. - - - Parses the specified value. - The enum type to parse. - The text value to parse. - if set to true the parsing will not be case sensitive. - The enum equivalent of the passed text. - - - Parses the specified value. - The enum type to parse. - The text value to parse. - if set to true the parsing will not be case sensitive. - The default value if all else fails. - The enum equivalent of the passed text. - - - Parses a string into an enum by comparing against the description attribute of the enum. - The type of the enum to parse to, normally inferred by the compiler. - The text value to parse. - if set to true the parsing will not be case sensitive. - The enum equivalent of the passed text or a default value if parsing does not succeed. - - - Parses a string into an enum by comparing against the description attribute of the enum. - The type of the enum to parse to, normally inferred by the compiler. - The text value to parse. - if set to true the parsing will not be case sensitive. - The default value if all else fails. - The enum equivalent of the passed text or a default value if parsing does not succeed. - - - - Outputs a string version of an enum by using the attribute. - Fails over to the enum name if the does not exist. - - The enum to output. - A string representation of the enum. - - - - Used to track the cross references that are parsed from the GEDCOM file. - This seems like quite a complex class and I'd like to see if we can benchmark - and unit test it. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The size. - - - - Gets or sets the strings which form the collection. - - - - - Gets the with the specified key from the xref collection. - - The key for looking up the xref. - The xref as a string. - - - - Gets the with the specified key from the xref collection. - - The key for looking up the xref. - The start index. - The length. - - The xref as a string. - - ERROR FINDING EXISTING KEY:" + insert. - - - - Returns a that represents this instance. - - - A that represents this instance. - - - - - Finds the specified string. - - The string. - The start index. - The length. - The position the string was found at. - True if string found, false otherwise. - - - - TODO: Doc. - - - - - Initializes a new instance of the class. - - - - - Gets or sets the database. - - - The database. - - - - - Gets or sets the value. - - - The value. - - - - - Gets or sets the type of the variation. - - - The type of the variation. - - - - - Gets or sets the change date. - - - The change date. - - - - - Compares the current and passed-in GedcomVariation to see if they are the same. - - The GedcomVariation to compare the current instance against. - A 32-bit signed integer that indicates whether this instance precedes, follows, or appears in the same position in the sort order as the value parameter. - - - - Compares the current and passed-in object to see if they are the same. - - The object to compare the current instance against. - A 32-bit signed integer that indicates whether this instance precedes, follows, or appears in the same position in the sort order as the value parameter. - - - - Compares the current and passed-in GedcomVariation to see if they are the same. - - The GedcomVariation to compare the current instance against. - True if they match, False otherwise. - - - - Compares the current and passed-in object to see if they are the same. - - The object to compare the current instance against. - True if they match, False otherwise. - - - - - - - Changeds this instance. - - - - - Decodes ANSEL characters into Unicode decomposed characters. - - - - - When overridden in a derived class, calculates the number of characters produced by decoding a sequence of bytes from the specified byte array. - - The byte array containing the sequence of bytes to decode. - The index of the first byte to decode. - The number of bytes to decode. - - The number of characters produced by decoding the specified sequence of bytes and any bytes in the internal buffer. - - - - - When overridden in a derived class, decodes a sequence of bytes from the specified byte array and any bytes in the internal buffer into the specified character array. - - The byte array containing the sequence of bytes to decode. - The index of the first byte to decode. - The number of bytes to decode. - The character array to contain the resulting set of characters. - The index at which to start writing the resulting set of characters. - - The actual number of characters written into . - - - - - Decode the ANSEL Code point into the Unicode code point. - - The ansel code point. - The Unicode character (or diacritic) mapped from the passed Ansel code point. - - - - An encoder/decoder for the the ANSEL/US-MARC character set. - - - - - Gets the code page of ANSEL. - - The code page identifier of the current . - - Windows Latin-1 (close enough!). - - - - - Gets the human-readable name of the character set. - - The human-readable description of the current . - - - - Returns a decoder for the ANSEL character set. - - - A that converts an encoded sequence of bytes into a sequence of characters. - - - - - When overridden in a derived class, calculates the maximum number of characters produced by decoding the specified number of bytes. - - The number of bytes to decode. - - The maximum number of characters produced by decoding the specified number of bytes. - - - - - When overridden in a derived class, calculates the number of characters produced by decoding a sequence of bytes from the specified byte array. - - The byte array containing the sequence of bytes to decode. - The index of the first byte to decode. - The number of bytes to decode. - - The number of characters produced by decoding the specified sequence of bytes. - - - - - When overridden in a derived class, decodes a sequence of bytes from the specified byte array into the specified character array. - - The byte array containing the sequence of bytes to decode. - The index of the first byte to decode. - The number of bytes to decode. - The character array to contain the resulting set of characters. - The index at which to start writing the resulting set of characters. - - The actual number of characters written into . - - - - - Not Implemented. - - The character array containing the set of characters to encode. - The index of the first character to encode. - The number of characters to encode. - - The number of bytes produced by encoding the specified characters. - - This function is not needed and should not be called. - - - - When overridden in a derived class, calculates the maximum number of bytes produced by encoding the specified number of characters. - - The number of characters to encode. - - The maximum number of bytes produced by encoding the specified number of characters. - - - - - When overridden in a derived class, encodes a set of characters from the specified character array into the specified byte array. - - The character array containing the set of characters to encode. - The index of the first character to encode. - The number of characters to encode. - The byte array to contain the resulting sequence of bytes. - The index at which to start writing the resulting sequence of bytes. - - The actual number of bytes written into . - - This function is not needed and should not be called. - - - - Used by unit tests and benchmarks to load and parse GEDCOM files. - - - - - Loads the GEDCOM file and parses it. - - The file. - The last error during parsing. - - - - GedcomParser is responsible for parsing GEDCOM files. - This class implements GEDCOM 5.5 grammar rules. - This is probably not the class you want to use unless writing a - validator application. GedcomRecordReader makes use of this - class for building up a GedcomDatabase. - - - - - Initializes a new instance of the class. - - - - - Fired if the parser encounters an error. - - - - - Fired whenever a full GEDCOM line has been parsed. - - - - - Gets the current state the parser is in. - - - - - Gets or sets the error state, if any, the parser is in. - - - - - Gets the level of the current GEDCOM tag. - - - - - Gets the Xref of the current GEDCOM tag (if any). - - - - - Gets the current GEDCOM tag. - - - - - Gets the value of the current GEDCOM tag, or a pointer to - another record. - - - - - Gets the type of the line value, data or pointer. - - - - - Gets or sets the collection of xrefs used in the gedcom file. - This is used as a cache to lower memory consumption. - If not set one will be created when parsing. - - - - - Gets or sets the collection of xrefs used in the gedcom file. - This is used as a cache to lower memory consumption. - Setting this to an XRefIndexedKeyCollection will - allow on the fly replacement of xrefs. - If not set one will be created when parsing. - - - - - Gets or sets the character set used to encode the GEDCOM file. - - - - - Gets or sets a value indicating whether invalid delimiters cause errors. - If set to true invalid GEDCOM files that use multiple spaces - to separate level / xrefid / tags will be processed without - generating an error. royal.ged from Gedcom.pm (http://www.pjcj.net) - needs this as the tags are indented presumably for readability. - - - - - Gets or sets a value indicating whether missing terminators cause an error. - If set to true GEDCOM lines that do not contain a terminator - on tags / line values will not cause the parser to generate an error. - - - - - Gets or sets a value indicating whether to leave newlines in. - Some broken apps (Reunion for instance) omit - CONT (and maybe CONC) values, leading to broken GEDCOM. - When set to true the parser will deal with this by converting - the broken line to another CONC. - - - - - Gets or sets a value indicating whether to allow tabs as OtherChar. - - - - - Gets or sets a value indicating whether to allow line tabs as OtherChar. - - - - - Gets or sets a value indicating whether to allow Information Separator One (0x1f) as OtherChar. - - - - - Gets or sets a value indicating whether to allow - or _ in tag names. - - - - - Obtain a human readable error message for the given error state. - - The error state. - A friendlier string for the error. - - - - Parses the given data, which should be 1 or more lines, multiple - calls can be made with multiple lines. - Events are triggered upon reading a line, or on an error. - If TagCollection and XrefTagCollection haven't been set - prior to calling default IndexedKeyCollection objects will be - used. To support replacing XRefs you need to set XrefTagCollection - to an instance of XRefIndexedKeyCollection before calling. - - Data to parse, expected to be unicode. - The last error encountered. - - - - Resets the parser states, use this if the same GedcomParser is - ready to parse a different gedcom file, or if recovering from - an error the parser has hit. - - - - - GedcomParseState is used to maintain the current parser status - for GedcomRecordReader. - - - - - Initializes a new instance of the class. - - - - - Gets the previous tag name. - - - - - Gets the level of the previous tag. - - - - - Gets or sets the stack of previous tag names / levels. - - - - - Gets or sets the parse stack of current records, back to the last level 0 record. - - - - - Gets or sets the current database the GedcomRecordReader is working with. - - - - - Obtain the name of the parent GEDCOM tag. - - - A . The level of the current tag. - - - A . The name of the parent GEDCOM tag. - - - - - Adds the previous tag. - - The name. - The level. - Only 99 levels supported, as per GEDCOM spec. - - - - GedcomRecordReader will read in a given gedcom file - producing a GedcomDatabase and related objects. - This is generally what you want to use to read in a GEDCOM - file for manipulation. - - - - - Initializes a new instance of the class. - Create a GedcomRecordReader for reading a GEDCOM file into a GedcomDatabase. - - - - - Fired as each line is parsed from the given file in GedcomRead - - - - - Gets or sets the parser to be used when reading the GEDCOM file. - - - - - Gets or sets the GEDCOM file being read. - - - - - Gets the database the records will be added to. - - - - - Gets or sets a value indicating whether xrefs are replaced. - When reading GEDCOM files into a database the - xref ids may already exist, settings this to true - will cause new ids to be generated created for the - records being read. - - - - - Gets percentage progress of GedcomRead. - - - - - A static helper for reading a gedcom file and returning the reader in one go. - - The gedcom file path. - The value indicating whether [replace x refs]. - The reader used to load the file. - - - - Starts reading the gedcom file currently set via the GedcomFile property. - - bool indicating if the file was successfully read. - - - - Starts reading the specified gedcom file. - - Filename to read. - bool indicating if the file was successfully read. - - - - Used to save a GedcomDatabase to a GEDCOM file. - - - - - Initializes a new instance of the class. - Create a GEDCOM writer for saving a database to a GEDCOM file. - - - - - Gets or sets the name of the GEDCOM file being written. - - - - - Gets or sets the database for the file being written. - - - - - Gets or sets the name of the application that created the GEDCOM file. - - - - - Gets or sets the application version that created the GEDCOM file. - - - - - Gets or sets the application system identifier. - - - - - Gets or sets the owner name for the software that created the GEDCOM. - - - - - Gets or sets the corporation address. - - - The corporation address. - - - - - Gets or sets a value indicating whether to use the information separator when saving. - - - true if [allow information separator on save]; otherwise, false. - - - - - Gets or sets a value indicating whether [allow line tabs save]. - - - true if [allow line tabs save]; otherwise, false. - - - - - Gets or sets a value indicating whether [allow tabs save]. - - - true if [allow tabs save]; otherwise, false. - - - - - Helper method to output a standard GEDCOM file without needing to create a writer. - - The database to output. - The file path to output to. - - - - Helper method to output a standard GEDCOM file without needing to create a writer. - - The database to output. - The stream to write to. - - - - Outputs the currently set GedcomDatabase to the currently set file. - - - - - Outputs a GedcomDatabase to the given file. - - The GedcomDatabase to write. - The filename to write to. - - - - Outputs a GedcomDatabase to the passed stream. - - The GedcomDatabase to write. - The stream to write to. - - - - Writes the specified database to the passed writer. - Not for use outside this class as the writer must be - responsibly disposed in a using block by the caller. - - The database to write. - The writer to use for outputting the database. - - - - Stream writer for outputting GEDCOM files. Can be used to output to both memory and files. - - - - - - Initializes a new instance of the class. - - The stream to write to. - - - - Initializes a new instance of the class. - - The complete file path to write to. can be a file name. - - - - Initializes a new instance of the class. - - The stream to write to. - The character encoding to use. - - - - Initializes a new instance of the class. - - The complete file path to write to. - true to append data to the file; false to overwrite the file. If the specified file does not exist, this parameter has no effect, and the constructor creates a new file. - - - - Initializes a new instance of the class. - - The stream to write to. - The character encoding to use. - The buffer size, in bytes. - true to leave the stream open after the object is disposed; otherwise, false. - - - - Initializes a new instance of the class. - - The complete file path to write to. - true to append data to the file; false to overwrite the file. If the specified file does not exist, this parameter has no effect, and the constructor creates a new file. - The character encoding to use. - - - - Initializes a new instance of the class. - - The complete file path to write to. - true to append data to the file; false to overwrite the file. If the specified file does not exist, this parameter has no effect, and the constructor creates a new file. - The character encoding to use. - The buffer size, in bytes. - - - - Gets or sets a value indicating whether to allow the ASCII information separator character to be written. - - - - - Gets or sets a value indicating whether to replace line tabs (ASCII vertical tabs) as spaces when written. - - - - - Gets or sets a value indicating whether to replace tabs (ASCII horizontal tabs) as spaces when written. - - - - - Writes a character to the stream. - - The character to write to the stream. - - - - Writes a subarray of characters to the stream. - - A character array that contains the data to write. - The character position in the buffer at which to start reading data. - The maximum number of characters to write. - - - - Writes the text representation of an object to the text string or stream by calling the ToString method on that object. - - The object to write. - - - - Writes a string to the stream. - - The string to write to the stream. If is null, nothing is written. - - - - Writes a formatted string to the text string or stream, using the same semantics as the method. - - A composite format string (see Remarks). - The object to format and write. - - - - Writes a formatted string to the text string or stream, using the same semantics as the method. - - A composite format string (see Remarks). - The first object to format and write. - The second object to format and write. - - - - Writes a formatted string to the text string or stream, using the same semantics as the method. - - A composite format string (see Remarks). - The first object to format and write. - The second object to format and write. - The third object to format and write. - - - - Writes a character followed by a line terminator to the text string or stream. - - The character to write to the text stream. - - - - Writes a subarray of characters followed by a line terminator to the text string or stream. - - The character array from which data is read. - The character position in at which to start reading data. - The maximum number of characters to write. - - - - Writes the text representation of an object by calling the ToString method on that object, followed by a line terminator to the text string or stream. - - The object to write. If is null, only the line terminator is written. - - - - Writes a string followed by a line terminator to the text string or stream. - - The string to write. If is null, only the line terminator is written. - - - - Writes a formatted string and a new line to the text string or stream, using the same semantics as the method. - - A composite format string (see Remarks). - The object to format and write. - - - - Writes a formatted string and a new line to the text string or stream, using the same semantics as the method. - - A composite format string (see Remarks). - The first object to format and write. - The second object to format and write. - - - - Writes out a formatted string and a new line, using the same semantics as . - - A composite format string (see Remarks). - The first object to format and write. - The second object to format and write. - The third object to format and write. - - - - Lists of error strings etc that don't change. - - - - - Descriptions for each parse error. - - - - - Used to wrap DateTime.Now() so that it can be replaced for unit testing. - - - - - Gets the current time or the time under test for unit tests. - - - - - Used to set the time to return when SystemTime.Now() is called. - - The time you want to return for the unit test. - - - - Resets SystemTime.Now() to return the real time via DateTime.Now. - - - - - TODO: Doc. - - - - - Generates a soundex string for the passed value. - - The string. - A string of characters representing the soundex value. - - - - Encodes the passed character to it's soundex value. - - The c. - The soundex character (as a string). - - - - Escapes "at" sign. - - The string. - - The input string with the @ symbol escaped, or the original string if no @ symbol present. - - - - - Returns the position of the escaped character in the passed string. - - The string. - - A count of the total number of escaped characters (the "at" sign) found in the passed string, or 0 if none. - - - - - Splits the line text. - - The writer. - The text. - The level. - The maximum length. - - - - Splits the line text. - - The writer. - The text. - The level. - The maximum length. - The maximum splits. - if set to true [cont]. - - - - Splits the text. - - The writer. - The line. - The level. - The maximum length. - - - - Splits the text. - - The writer. - The line. - The level. - The maximum length. - The maximum splits. - if set to true [cont]. - - - - TODO: Doc. - - - - - - Initializes a new instance of the class. - - - - - Gets or sets the database. - - - The database. - - - - - Gets or sets a value indicating whether [replace x refs]. - - - true if [replace x refs]; otherwise, false. - - - - - Gets the TODO: Doc. - - - The . - - The string. - The start index. - The length. - TODO: Doc. - - - From 0f251bfe7333c3f32ede6c56bad55e54079efe6d Mon Sep 17 00:00:00 2001 From: mtx500 Date: Sun, 25 Jun 2023 19:34:56 +0200 Subject: [PATCH 29/40] Store the record change dates that are read in from GED file (#126) * Fixed some typos in comments and strings. * Generate XML documentation files in output- instead of source-directory. Remove them from repository as they are generated. * Store the record change dates that are read in from GED file --- GeneGenie.Gedcom.Tests/Data/changedate.ged | 87 +++++++++++++++++++ .../GeneGenie.Gedcom.Tests.csproj | 3 + .../GedcomChangeDateReadTest.cs | 48 ++++++++++ GeneGenie.Gedcom/Parser/GedcomRecordReader.cs | 8 ++ 4 files changed, 146 insertions(+) create mode 100644 GeneGenie.Gedcom.Tests/Data/changedate.ged create mode 100644 GeneGenie.Gedcom.Tests/RecordReaderTests/GedcomChangeDateReadTest.cs diff --git a/GeneGenie.Gedcom.Tests/Data/changedate.ged b/GeneGenie.Gedcom.Tests/Data/changedate.ged new file mode 100644 index 0000000..4b2c08d --- /dev/null +++ b/GeneGenie.Gedcom.Tests/Data/changedate.ged @@ -0,0 +1,87 @@ +0 HEAD +1 CHAR ASCII +1 SOUR ID_OF_CREATING_FILE +1 GEDC +2 VERS 5.5 +2 FORM Lineage-Linked +1 SUBM @SUBMITTER@ +1 NOTE Small example file containing all types of records, each with a CHANge date +0 @SUBMISSION@ SUBN +1 SUBM @SUBMITTER@ +1 FAMF NameOfFamilyFile +1 TEMP Abreviated temple code +1 ANCE 1 +1 DESC 1 +1 ORDI yes +1 CHAN +2 DATE 01 JUN 2023 +3 TIME 10:11:11 +0 @SUBMITTER@ SUBM +1 NAME /Submitter/ +1 ADDR Submitters address +2 CONT address continued here +1 CHAN +2 DATE 02 JUN 2023 +3 TIME 10:11:12 +0 @FATHER@ INDI +1 NAME /Father/ +1 SEX M +1 BIRT +2 PLAC birth place +2 DATE 1 JAN 1899 +1 DEAT +2 PLAC death place +2 DATE 31 DEC 1990 +1 FAMS @FAMILY@ +2 SOUR @SOURCE1@ +3 PAGE 42 +1 CHAN +2 DATE 03 JUN 2023 +3 TIME 10:11:13 +0 @MOTHER@ INDI +1 NAME /Mother/ +1 SEX F +1 BIRT +2 PLAC birth place +2 DATE 1 JAN 1899 +1 DEAT +2 PLAC death place +2 DATE 31 DEC 1990 +1 FAMS @FAMILY@ +0 @FAMILY@ FAM +1 HUSB @FATHER@ +1 WIFE @MOTHER@ +1 CHAN +2 DATE 04 JUN 2023 +3 TIME 10:11:14 +0 @SOURCE1@ SOUR +1 TITL Some source +1 CHAN +2 DATE 05 JUN 2023 +3 TIME 10:11:15 +0 @R1@ REPO +1 NAME Some repository +1 PHON +1-800-000-0000 +1 CHAN +2 DATE 06 JUN 2023 +3 TIME 10:11:16 +0 @N1@ NOTE +1 CONC Some note +1 CHAN +2 DATE 07 JUN 2023 +3 TIME 10:11:17 +0 @M1@ OBJE +1 TITL Some multimedia +1 FORM PICT +1 BLOB +2 CONT .HM.......k.1..F.jwA.Dzzzzw............A....1.........0U.66..E.8 +2 CONT .......A..k.a6.A.......A..k.........../6....G.......0../..U..... +2 CONT .w1/m........HC0..../...zzzzzzzz..5zzk..AnA..U..W6U....2rRrRrRrR +2 CONT .Dw...............k.1.......1..A...5ykE/zzzx/.g//.Hxzk6/.Tzy/.k1 +2 CONT /Dw/.Tvz.E5zzUE9/kHz.Tw2/DzzzEEA.kE2zk5yzk2/zzs21.U2/Dw/.Tw/.Tzy +2 CONT /.fy/.HzzkHzzzo21Ds00.E2.UE2.U62/.k./Ds0.UE0/Do0..E8/UE2.U62.U9w +2 CONT /.Tx/.20.jg2/jo2..9u/.0U.6A.zk +1 CHAN +2 DATE 08 JUN 2023 +3 TIME 10:11:18 +0 TRLR diff --git a/GeneGenie.Gedcom.Tests/GeneGenie.Gedcom.Tests.csproj b/GeneGenie.Gedcom.Tests/GeneGenie.Gedcom.Tests.csproj index dc22bdb..8bc7d7d 100644 --- a/GeneGenie.Gedcom.Tests/GeneGenie.Gedcom.Tests.csproj +++ b/GeneGenie.Gedcom.Tests/GeneGenie.Gedcom.Tests.csproj @@ -44,6 +44,9 @@ Always + + Always + Always diff --git a/GeneGenie.Gedcom.Tests/RecordReaderTests/GedcomChangeDateReadTest.cs b/GeneGenie.Gedcom.Tests/RecordReaderTests/GedcomChangeDateReadTest.cs new file mode 100644 index 0000000..35e2834 --- /dev/null +++ b/GeneGenie.Gedcom.Tests/RecordReaderTests/GedcomChangeDateReadTest.cs @@ -0,0 +1,48 @@ +// +// Copyright (c) GeneGenie.com. All Rights Reserved. +// Licensed under the GNU Affero General Public License v3.0. See LICENSE in the project root for license information. +// +// Copyright (C) 2023 Herbert Oppmann gith@memotech.franken.de + +namespace GeneGenie.Gedcom +{ + using System; + using System.Linq; + using GeneGenie.Gedcom.Parser; + using Xunit; + + /// + /// Tests that the change dates are read in for the varying record types. + /// + public class GedcomChangeDateReadTest + { + [Fact] + private void Read_sample_and_check_changed_dates() + { + var reader = GedcomRecordReader.CreateReader("./Data/changedate.ged"); + + // TODO: Submission records are parsed but not stored in the DataBase, so can't check this currently + + GedcomChangeDate Submitter_ChangeDate = reader.Database.Submitters.Single().ChangeDate; + Assert.Equal("02 JUN 2023 10:11:12", Submitter_ChangeDate?.DateString); + + var father = reader.Database.Individuals.SingleOrDefault(x => x.GetName().Name == "/Father/"); + Assert.Equal("03 JUN 2023 10:11:13", father?.ChangeDate?.DateString); + + GedcomChangeDate Family_ChangeDate = reader.Database.Families.Single().ChangeDate; + Assert.Equal("04 JUN 2023 10:11:14", Family_ChangeDate?.DateString); + + GedcomChangeDate Source_ChangeDate = reader.Database.Sources.Single().ChangeDate; + Assert.Equal("05 JUN 2023 10:11:15", Source_ChangeDate?.DateString); + + GedcomChangeDate Repository_ChangeDate = reader.Database.Repositories.Single().ChangeDate; + Assert.Equal("06 JUN 2023 10:11:16", Repository_ChangeDate?.DateString); + + GedcomChangeDate Note_ChangeDate = reader.Database.Notes.Single().ChangeDate; + Assert.Equal("07 JUN 2023 10:11:17", Note_ChangeDate?.DateString); + + GedcomChangeDate Media_ChangeDate = reader.Database.Media.Single().ChangeDate; + Assert.Equal("08 JUN 2023 10:11:18", Media_ChangeDate?.DateString); + } + } +} diff --git a/GeneGenie.Gedcom/Parser/GedcomRecordReader.cs b/GeneGenie.Gedcom/Parser/GedcomRecordReader.cs index dee6d3a..2c37c78 100644 --- a/GeneGenie.Gedcom/Parser/GedcomRecordReader.cs +++ b/GeneGenie.Gedcom/Parser/GedcomRecordReader.cs @@ -1644,6 +1644,7 @@ private void ReadFamilyRecord() break; case "CHAN": GedcomChangeDate date = new GedcomChangeDate(Database); + familyRecord.ChangeDate = date; date.Level = level; parseState.Records.Push(date); break; @@ -2001,6 +2002,7 @@ private void ReadIndividualRecord() break; case "CHAN": GedcomChangeDate date = new GedcomChangeDate(Database); + individualRecord.ChangeDate = date; date.Level = level; parseState.Records.Push(date); break; @@ -2812,6 +2814,7 @@ private void ReadMultimediaRecord() break; case "CHAN": GedcomChangeDate date = new GedcomChangeDate(Database); + multimediaRecord.ChangeDate = date; date.Level = level; parseState.Records.Push(date); break; @@ -2919,6 +2922,7 @@ private void ReadNoteRecord() break; case "CHAN": GedcomChangeDate date = new GedcomChangeDate(Database); + noteRecord.ChangeDate = date; date.Level = level; parseState.Records.Push(date); break; @@ -3125,6 +3129,7 @@ private void ReadRepositoryRecord() break; case "CHAN": GedcomChangeDate date = new GedcomChangeDate(Database); + repositoryRecord.ChangeDate = date; date.Level = level; parseState.Records.Push(date); break; @@ -3279,6 +3284,7 @@ private void ReadSourceRecord() break; case "CHAN": GedcomChangeDate date = new GedcomChangeDate(Database); + sourceRecord.ChangeDate = date; date.Level = level; parseState.Records.Push(date); break; @@ -3661,6 +3667,7 @@ private void ReadSubmitterRecord() break; case "CHAN": GedcomChangeDate date = new GedcomChangeDate(Database); + submitterRecord.ChangeDate = date; date.Level = level; parseState.Records.Push(date); break; @@ -3762,6 +3769,7 @@ private void ReadSubmissionRecord() break; case "CHAN": GedcomChangeDate date = new GedcomChangeDate(Database); + submissionRecord.ChangeDate = date; date.Level = level; parseState.Records.Push(date); break; From bbe976ca5253317ec47abad1aebe6def69702ba1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 23 Jul 2023 11:41:22 +0100 Subject: [PATCH 30/40] Bump Microsoft.NET.Test.Sdk from 17.6.2 to 17.6.3 (#127) Bumps [Microsoft.NET.Test.Sdk](https://github.com/microsoft/vstest) from 17.6.2 to 17.6.3. - [Release notes](https://github.com/microsoft/vstest/releases) - [Changelog](https://github.com/microsoft/vstest/blob/main/docs/releases.md) - [Commits](https://github.com/microsoft/vstest/compare/v17.6.2...v17.6.3) --- updated-dependencies: - dependency-name: Microsoft.NET.Test.Sdk dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- GeneGenie.Gedcom.Tests/GeneGenie.Gedcom.Tests.csproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/GeneGenie.Gedcom.Tests/GeneGenie.Gedcom.Tests.csproj b/GeneGenie.Gedcom.Tests/GeneGenie.Gedcom.Tests.csproj index 8bc7d7d..a7cc34c 100644 --- a/GeneGenie.Gedcom.Tests/GeneGenie.Gedcom.Tests.csproj +++ b/GeneGenie.Gedcom.Tests/GeneGenie.Gedcom.Tests.csproj @@ -1,4 +1,4 @@ - + net7.0 @@ -16,7 +16,7 @@ - + all From 4b6c54cc9d114a64f3d2e01adbccb98c619380bb Mon Sep 17 00:00:00 2001 From: mtx500 Date: Sun, 23 Jul 2023 12:41:54 +0200 Subject: [PATCH 31/40] Fix exception when reading ChangeDate when file contains bad submitter reference. (#128) * Fixed some typos in comments and strings. * Generate XML documentation files in output- instead of source-directory. Remove them from repository as they are generated. * Store the record change dates that are read in from GED file * Fix exception when reading ChangeDate when file contains bad submitter reference. --- .../Data/SubmitterReference.ged | 55 +++++++++++++++++++ .../GeneGenie.Gedcom.Tests.csproj | 3 + .../GedcomSurviveMalformedTest.cs | 42 ++++++++++++++ GeneGenie.Gedcom/GedcomFamilyRecord.cs | 1 + GeneGenie.Gedcom/GedcomIndividualRecord.cs | 1 + 5 files changed, 102 insertions(+) create mode 100644 GeneGenie.Gedcom.Tests/Data/SubmitterReference.ged create mode 100644 GeneGenie.Gedcom.Tests/RecordReaderTests/GedcomSurviveMalformedTest.cs diff --git a/GeneGenie.Gedcom.Tests/Data/SubmitterReference.ged b/GeneGenie.Gedcom.Tests/Data/SubmitterReference.ged new file mode 100644 index 0000000..6718be4 --- /dev/null +++ b/GeneGenie.Gedcom.Tests/Data/SubmitterReference.ged @@ -0,0 +1,55 @@ +0 HEAD +1 FILE SubmitterReference.ged +1 COPR (c) Some person +2 DATE 19 Mrz 2016 +3 TIME 12:42:09 +1 CHAR UTF-8 +1 LANG German +1 GEDC +2 VERS 5.5.1 +1 PLAC +2 FORM Town , Region , Country +1 SUBM @S1@ +1 SOUR PhpGedView +2 NAME PhpGedView Online Genealogy +2 VERS 3.3.8 final +1 DATE 4 Mar 2006 +0 @S1@ SUBM +1 NAME First Submitter +1 ADDR +2 POST 90425 +2 CITY Nrnberg +2 CTRY Deutschland +0 @S2@ SUBM +1 NAME Second Submitter +1 ADDR +2 POST 9100 +2 CITY Zrich +2 CTRY Schweiz +0 @I19@ INDI +1 SEX F +1 NAME Elisabeth /Example-Name/ +2 GIVN Elisabeth +2 SURN Example +2 _MARNM Example-Name +1 RELI +1 ADDR +2 POST 9103 +2 CITY Altenstadt +2 STAE SG +2 CTRY CH, Europa +1 BIRT +2 DATE 1928 +2 _BURG +1 DEAT +2 DATE 1957 +1 NOTE +1 SUBM @S@ +1 CHAN +2 DATE 1 FEB 2016 +0 @F3@ FAM +1 WIVE @I19@ +1 MARR +2 DATE unbekannt +1 SUBM @S@ +0 TRLR diff --git a/GeneGenie.Gedcom.Tests/GeneGenie.Gedcom.Tests.csproj b/GeneGenie.Gedcom.Tests/GeneGenie.Gedcom.Tests.csproj index a7cc34c..4046079 100644 --- a/GeneGenie.Gedcom.Tests/GeneGenie.Gedcom.Tests.csproj +++ b/GeneGenie.Gedcom.Tests/GeneGenie.Gedcom.Tests.csproj @@ -71,6 +71,9 @@ Always + + Always + diff --git a/GeneGenie.Gedcom.Tests/RecordReaderTests/GedcomSurviveMalformedTest.cs b/GeneGenie.Gedcom.Tests/RecordReaderTests/GedcomSurviveMalformedTest.cs new file mode 100644 index 0000000..afa3ee7 --- /dev/null +++ b/GeneGenie.Gedcom.Tests/RecordReaderTests/GedcomSurviveMalformedTest.cs @@ -0,0 +1,42 @@ +// +// Copyright (c) GeneGenie.com. All Rights Reserved. +// Licensed under the GNU Affero General Public License v3.0. See LICENSE in the project root for license information. +// +// Copyright (C) 2023 Herbert Oppmann gith@memotech.franken.de + + +namespace GeneGenie.Gedcom +{ + using System; + using GeneGenie.Gedcom.Parser; + using Xunit; + + /// + /// Tests to ensure that malformed GEDCOM files are survived. + /// + public class GedcomSurviveMalformedTest + { + [Fact] + private void SubmitterReferenceWithWrongId() + { + var reader = GedcomRecordReader.CreateReader("./Data/SubmitterReference.ged"); + GedcomChangeDate LatestChangeDate = null; + foreach (GedcomIndividualRecord indi in reader.Database.Individuals) + { + if ((LatestChangeDate == null) || + ((indi.ChangeDate != null) && (indi.ChangeDate > LatestChangeDate))) + { + LatestChangeDate = indi.ChangeDate; + } + } + foreach (GedcomFamilyRecord fam in reader.Database.Families) + { + if ((LatestChangeDate == null) || + ((fam.ChangeDate != null) && (fam.ChangeDate > LatestChangeDate))) + { + LatestChangeDate = fam.ChangeDate; + } + } + } + } +} diff --git a/GeneGenie.Gedcom/GedcomFamilyRecord.cs b/GeneGenie.Gedcom/GedcomFamilyRecord.cs index 0d6655d..9f7e696 100644 --- a/GeneGenie.Gedcom/GedcomFamilyRecord.cs +++ b/GeneGenie.Gedcom/GedcomFamilyRecord.cs @@ -338,6 +338,7 @@ public override GedcomChangeDate ChangeDate foreach (string submitterID in SubmitterRecords) { record = Database[submitterID]; + if (record == null) continue; childChangeDate = record.ChangeDate; if (childChangeDate != null && realChangeDate != null && childChangeDate > realChangeDate) { diff --git a/GeneGenie.Gedcom/GedcomIndividualRecord.cs b/GeneGenie.Gedcom/GedcomIndividualRecord.cs index 442edee..8ca8a98 100644 --- a/GeneGenie.Gedcom/GedcomIndividualRecord.cs +++ b/GeneGenie.Gedcom/GedcomIndividualRecord.cs @@ -620,6 +620,7 @@ public override GedcomChangeDate ChangeDate foreach (string submitterID in SubmitterRecords) { record = Database[submitterID]; + if (record == null) continue; childChangeDate = record.ChangeDate; if (childChangeDate != null && realChangeDate != null && childChangeDate > realChangeDate) { From 92c6136fb030d1292006f1598c086cb8b16a3ab5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 23 Jul 2023 11:42:51 +0100 Subject: [PATCH 32/40] Bump xunit from 2.4.2 to 2.5.0 (#129) Bumps [xunit](https://github.com/xunit/xunit) from 2.4.2 to 2.5.0. - [Commits](https://github.com/xunit/xunit/compare/2.4.2...2.5.0) --- updated-dependencies: - dependency-name: xunit dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Ryan O'Neill --- GeneGenie.Gedcom.Tests/GeneGenie.Gedcom.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GeneGenie.Gedcom.Tests/GeneGenie.Gedcom.Tests.csproj b/GeneGenie.Gedcom.Tests/GeneGenie.Gedcom.Tests.csproj index 4046079..09ed533 100644 --- a/GeneGenie.Gedcom.Tests/GeneGenie.Gedcom.Tests.csproj +++ b/GeneGenie.Gedcom.Tests/GeneGenie.Gedcom.Tests.csproj @@ -17,7 +17,7 @@ - + all runtime; build; native; contentfiles; analyzers From 451d9f367a9fe2f7ca7719522f2ac15dc6926fc8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 23 Jul 2023 11:43:45 +0100 Subject: [PATCH 33/40] Bump xunit.runner.visualstudio from 2.4.5 to 2.5.0 (#130) Bumps [xunit.runner.visualstudio](https://github.com/xunit/visualstudio.xunit) from 2.4.5 to 2.5.0. - [Release notes](https://github.com/xunit/visualstudio.xunit/releases) - [Commits](https://github.com/xunit/visualstudio.xunit/compare/v2.4.5...2.5.0) --- updated-dependencies: - dependency-name: xunit.runner.visualstudio dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Ryan O'Neill --- GeneGenie.Gedcom.Tests/GeneGenie.Gedcom.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GeneGenie.Gedcom.Tests/GeneGenie.Gedcom.Tests.csproj b/GeneGenie.Gedcom.Tests/GeneGenie.Gedcom.Tests.csproj index 09ed533..dbebb56 100644 --- a/GeneGenie.Gedcom.Tests/GeneGenie.Gedcom.Tests.csproj +++ b/GeneGenie.Gedcom.Tests/GeneGenie.Gedcom.Tests.csproj @@ -18,7 +18,7 @@ - + all runtime; build; native; contentfiles; analyzers From ba9363623a00eb70c8e4c0c204dee1e85b478325 Mon Sep 17 00:00:00 2001 From: mtx500 Date: Mon, 1 Jan 2024 16:13:08 +0100 Subject: [PATCH 34/40] Add support for custom records on event records. (#144) * Fixed some typos in comments and strings. * Generate XML documentation files in output- instead of source-directory. Remove them from repository as they are generated. * Store the record change dates that are read in from GED file * Fix exception when reading ChangeDate when file contains bad submitter reference. * Add support for custom records on event records. --- GeneGenie.Gedcom.Tests/Data/UidAndBurg.ged | 20 ++++++++ .../GeneGenie.Gedcom.Tests.csproj | 3 ++ .../GecomCustomRecordTest.cs | 46 +++++++++++++++++++ GeneGenie.Gedcom/GedcomEvent.cs | 3 ++ GeneGenie.Gedcom/Parser/GedcomRecordReader.cs | 2 +- 5 files changed, 73 insertions(+), 1 deletion(-) create mode 100644 GeneGenie.Gedcom.Tests/Data/UidAndBurg.ged create mode 100644 GeneGenie.Gedcom.Tests/RecordReaderTests/GecomCustomRecordTest.cs diff --git a/GeneGenie.Gedcom.Tests/Data/UidAndBurg.ged b/GeneGenie.Gedcom.Tests/Data/UidAndBurg.ged new file mode 100644 index 0000000..d761a50 --- /dev/null +++ b/GeneGenie.Gedcom.Tests/Data/UidAndBurg.ged @@ -0,0 +1,20 @@ +0 HEAD +1 SOUR PhpGedView +2 NAME PhpGedView Online Genealogy +2 VERS 3.3.8 final +1 DATE 1 Apr 2006 +0 @I1@ INDI +1 _UID A5A812A4C0FE44C9A98F8D4627073B69AB88 +1 NAME TestGivenName /TestSurname/ +2 SURN TestSurname +2 GIVN TestGivenName +1 SEX M +1 BIRT +2 DATE 9 OCT 1990 +2 _BURG unbekannt +1 CHAN +2 DATE 28 DEC 2023 +3 TIME 11:21:46 +0 @SUBM@ SUBM +1 NAME Test for GeneGenie +0 TRLR diff --git a/GeneGenie.Gedcom.Tests/GeneGenie.Gedcom.Tests.csproj b/GeneGenie.Gedcom.Tests/GeneGenie.Gedcom.Tests.csproj index dbebb56..49bfdbc 100644 --- a/GeneGenie.Gedcom.Tests/GeneGenie.Gedcom.Tests.csproj +++ b/GeneGenie.Gedcom.Tests/GeneGenie.Gedcom.Tests.csproj @@ -74,6 +74,9 @@ Always + + Always + diff --git a/GeneGenie.Gedcom.Tests/RecordReaderTests/GecomCustomRecordTest.cs b/GeneGenie.Gedcom.Tests/RecordReaderTests/GecomCustomRecordTest.cs new file mode 100644 index 0000000..555fc91 --- /dev/null +++ b/GeneGenie.Gedcom.Tests/RecordReaderTests/GecomCustomRecordTest.cs @@ -0,0 +1,46 @@ +// +// Copyright (c) GeneGenie.com. All Rights Reserved. +// Licensed under the GNU Affero General Public License v3.0. See LICENSE in the project root for license information. +// +// Copyright (C) 2023 Herbert Oppmann gith@memotech.franken.de + + +namespace GeneGenie.Gedcom.Tests.RecordReaderTests +{ + using GeneGenie.Gedcom.Parser; + using System; + using Xunit; + + /// + /// Tests to ensure that custom records are correctly read in. + /// + public class GedcomCustomRecordTest + { + /// + /// Test for custom record '_UID' in individual record. + /// + [Fact] + public void Record_UID() + { + var reader = GedcomRecordReader.CreateReader("./Data/UidAndBurg.ged"); + GedcomIndividualRecord indi = reader.Database.Individuals[0]; + GedcomCustomRecord cr = indi.Custom[0]; + Assert.Equal("_UID", cr.Tag); + Assert.Equal("A5A812A4C0FE44C9A98F8D4627073B69AB88", cr.Classification); + } + + /// + /// Test for custom record '_BURG' in event record. + /// + [Fact] + public void Record_BURG() + { + var reader = GedcomRecordReader.CreateReader("./Data/UidAndBurg.ged"); + GedcomIndividualRecord indi = reader.Database.Individuals[0]; + GedcomEvent er = indi.Events[0]; + GedcomCustomRecord cr = er.Custom[0]; + Assert.Equal("_BURG", cr.Tag); + Assert.Equal("unbekannt", cr.Classification); + } + } +} diff --git a/GeneGenie.Gedcom/GedcomEvent.cs b/GeneGenie.Gedcom/GedcomEvent.cs index 4e210ee..9415fdc 100644 --- a/GeneGenie.Gedcom/GedcomEvent.cs +++ b/GeneGenie.Gedcom/GedcomEvent.cs @@ -212,6 +212,9 @@ public override GedcomRecordType RecordType get { return GedcomRecordType.Event; } } + /// Gets or sets the list of entries found when parsing an event. + public GedcomRecordList Custom { get; set; } = new GedcomRecordList(); + /// /// Gets the gedcom tag. /// diff --git a/GeneGenie.Gedcom/Parser/GedcomRecordReader.cs b/GeneGenie.Gedcom/Parser/GedcomRecordReader.cs index 2c37c78..a17630d 100644 --- a/GeneGenie.Gedcom/Parser/GedcomRecordReader.cs +++ b/GeneGenie.Gedcom/Parser/GedcomRecordReader.cs @@ -3807,7 +3807,7 @@ private void ReadEventRecord() custom.Classification = lineValue; } - // TODO: may want to use customs at some point + eventRecord.Custom.Add(custom); parseState.Records.Push(custom); break; } From ebfaa5e2c78f7e49174d143a5747b6e9628b5a38 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Jan 2024 15:14:15 +0000 Subject: [PATCH 35/40] Bump xunit from 2.5.0 to 2.6.0 (#141) Bumps [xunit](https://github.com/xunit/xunit) from 2.5.0 to 2.6.0. - [Commits](https://github.com/xunit/xunit/compare/2.5.0...2.6.0) --- updated-dependencies: - dependency-name: xunit dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- GeneGenie.Gedcom.Tests/GeneGenie.Gedcom.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GeneGenie.Gedcom.Tests/GeneGenie.Gedcom.Tests.csproj b/GeneGenie.Gedcom.Tests/GeneGenie.Gedcom.Tests.csproj index 49bfdbc..ba99f84 100644 --- a/GeneGenie.Gedcom.Tests/GeneGenie.Gedcom.Tests.csproj +++ b/GeneGenie.Gedcom.Tests/GeneGenie.Gedcom.Tests.csproj @@ -17,7 +17,7 @@ - + all runtime; build; native; contentfiles; analyzers From d8bc719c210245fba7a48af9446826e180d3d44a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Jan 2024 15:16:03 +0000 Subject: [PATCH 36/40] Bump xunit.runner.visualstudio from 2.5.0 to 2.5.3 (#138) Bumps [xunit.runner.visualstudio](https://github.com/xunit/visualstudio.xunit) from 2.5.0 to 2.5.3. - [Release notes](https://github.com/xunit/visualstudio.xunit/releases) - [Commits](https://github.com/xunit/visualstudio.xunit/compare/2.5.0...2.5.3) --- updated-dependencies: - dependency-name: xunit.runner.visualstudio dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Ryan O'Neill --- GeneGenie.Gedcom.Tests/GeneGenie.Gedcom.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GeneGenie.Gedcom.Tests/GeneGenie.Gedcom.Tests.csproj b/GeneGenie.Gedcom.Tests/GeneGenie.Gedcom.Tests.csproj index ba99f84..3f1aa3a 100644 --- a/GeneGenie.Gedcom.Tests/GeneGenie.Gedcom.Tests.csproj +++ b/GeneGenie.Gedcom.Tests/GeneGenie.Gedcom.Tests.csproj @@ -18,7 +18,7 @@ - + all runtime; build; native; contentfiles; analyzers From f36e4e8b5e0ddbfd2f80c2deb39192a117acde32 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Jan 2024 15:18:50 +0000 Subject: [PATCH 37/40] Bump Microsoft.NET.Test.Sdk from 17.6.3 to 17.8.0 (#145) Bumps [Microsoft.NET.Test.Sdk](https://github.com/microsoft/vstest) from 17.6.3 to 17.8.0. - [Release notes](https://github.com/microsoft/vstest/releases) - [Changelog](https://github.com/microsoft/vstest/blob/main/docs/releases.md) - [Commits](https://github.com/microsoft/vstest/compare/v17.6.3...v17.8.0) --- updated-dependencies: - dependency-name: Microsoft.NET.Test.Sdk dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- GeneGenie.Gedcom.Tests/GeneGenie.Gedcom.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GeneGenie.Gedcom.Tests/GeneGenie.Gedcom.Tests.csproj b/GeneGenie.Gedcom.Tests/GeneGenie.Gedcom.Tests.csproj index 3f1aa3a..241bea2 100644 --- a/GeneGenie.Gedcom.Tests/GeneGenie.Gedcom.Tests.csproj +++ b/GeneGenie.Gedcom.Tests/GeneGenie.Gedcom.Tests.csproj @@ -16,7 +16,7 @@ - + all From 67141ccd9a62840798b1320d472c3901f07cf111 Mon Sep 17 00:00:00 2001 From: Ryan O'Neill Date: Mon, 1 Jan 2024 15:20:17 +0000 Subject: [PATCH 38/40] Update to .Net 8. --- GeneGenie.Gedcom.Sample/GeneGenie.Gedcom.Sample.csproj | 2 +- GeneGenie.Gedcom.Tests/GeneGenie.Gedcom.Tests.csproj | 2 +- GeneGenie.Gedcom/GeneGenie.Gedcom.csproj | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/GeneGenie.Gedcom.Sample/GeneGenie.Gedcom.Sample.csproj b/GeneGenie.Gedcom.Sample/GeneGenie.Gedcom.Sample.csproj index 14ca4c0..cfc704d 100644 --- a/GeneGenie.Gedcom.Sample/GeneGenie.Gedcom.Sample.csproj +++ b/GeneGenie.Gedcom.Sample/GeneGenie.Gedcom.Sample.csproj @@ -2,7 +2,7 @@ Exe - net7.0 + net8.0 diff --git a/GeneGenie.Gedcom.Tests/GeneGenie.Gedcom.Tests.csproj b/GeneGenie.Gedcom.Tests/GeneGenie.Gedcom.Tests.csproj index 241bea2..cd55b65 100644 --- a/GeneGenie.Gedcom.Tests/GeneGenie.Gedcom.Tests.csproj +++ b/GeneGenie.Gedcom.Tests/GeneGenie.Gedcom.Tests.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 false 0.6 diff --git a/GeneGenie.Gedcom/GeneGenie.Gedcom.csproj b/GeneGenie.Gedcom/GeneGenie.Gedcom.csproj index 69ce75a..7d0a3b6 100644 --- a/GeneGenie.Gedcom/GeneGenie.Gedcom.csproj +++ b/GeneGenie.Gedcom/GeneGenie.Gedcom.csproj @@ -1,7 +1,7 @@  - net7.0 + net8.0 From 083c2b79857c35a5dcb29941c538a668007c459a Mon Sep 17 00:00:00 2001 From: Ryan O'Neill Date: Mon, 1 Jan 2024 15:21:06 +0000 Subject: [PATCH 39/40] Update all packages to latest. --- GeneGenie.Gedcom.Tests/GeneGenie.Gedcom.Tests.csproj | 4 ++-- GeneGenie.Gedcom/GeneGenie.Gedcom.csproj | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/GeneGenie.Gedcom.Tests/GeneGenie.Gedcom.Tests.csproj b/GeneGenie.Gedcom.Tests/GeneGenie.Gedcom.Tests.csproj index cd55b65..4076cc6 100644 --- a/GeneGenie.Gedcom.Tests/GeneGenie.Gedcom.Tests.csproj +++ b/GeneGenie.Gedcom.Tests/GeneGenie.Gedcom.Tests.csproj @@ -17,8 +17,8 @@ - - + + all runtime; build; native; contentfiles; analyzers diff --git a/GeneGenie.Gedcom/GeneGenie.Gedcom.csproj b/GeneGenie.Gedcom/GeneGenie.Gedcom.csproj index 7d0a3b6..9bd4d4b 100644 --- a/GeneGenie.Gedcom/GeneGenie.Gedcom.csproj +++ b/GeneGenie.Gedcom/GeneGenie.Gedcom.csproj @@ -24,8 +24,8 @@ - - + + @@ -54,7 +54,7 @@ - + From cd1e268e74653a40306cb063ee65ae05e71122dc Mon Sep 17 00:00:00 2001 From: Ryan O'Neill Date: Mon, 1 Jan 2024 15:31:54 +0000 Subject: [PATCH 40/40] Attempt to fix Sonar Cloud analysis. --- .github/workflows/sonar.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/sonar.yml b/.github/workflows/sonar.yml index be604af..70404dd 100644 --- a/.github/workflows/sonar.yml +++ b/.github/workflows/sonar.yml @@ -13,20 +13,20 @@ jobs: runs-on: ubuntu-latest steps: - name: Set up JDK 11 - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: 'zulu' - java-version: '11' + java-version: '21' java-package: jdk # optional (jdk or jre) - defaults to jdk - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis - - name: Setup .Net SDK (v7.0) + - name: Setup .Net SDK (v8.0) uses: actions/setup-dotnet@v3 with: - dotnet-version: '7.0.x' + dotnet-version: '8.0.x' - name: Install dotnet global tools run: |