>;
5 |
--------------------------------------------------------------------------------
/docs/reference/css/ja-JP.css:
--------------------------------------------------------------------------------
1 | /* ja-JP locale-specific CSS */
2 | body
3 | {
4 | font-family: Segoe UI, Verdana, Arial, MS Pゴシック;
5 | }
6 | pre
7 | {
8 | font-family: Consolas, Courier, monospace, MS ゴシック;
9 | }
10 | span.tt
11 | {
12 | font-family: Consolas, Courier, monospace, MS ゴシック;
13 | }
14 | span.code
15 | {
16 | font-family: Consolas, Courier, monospace, MS ゴシック;
17 | }
18 |
--------------------------------------------------------------------------------
/docs/reference/css/zh-TW.css:
--------------------------------------------------------------------------------
1 | /* zh-TW locale-specific CSS */
2 | body
3 | {
4 | font-family: MS JhengHei, MingLiU, Segoe UI, Verdana, Arial;
5 | }
6 | pre
7 | {
8 | font-family: Consolas, Courier, monospace, 細明體;
9 | }
10 | span.tt
11 | {
12 | font-family: Consolas, Courier, monospace, 細明體;
13 | }
14 | span.code
15 | {
16 | font-family: Consolas, Courier, monospace, 細明體;
17 | }
18 |
--------------------------------------------------------------------------------
/src/FolkerKinzel.VCards.Tests/Intls/Converters/LanguageConverterTests.cs:
--------------------------------------------------------------------------------
1 | namespace FolkerKinzel.VCards.Intls.Converters.Tests;
2 |
3 | [TestClass]
4 | public class LanguageConverterTests
5 | {
6 | [DataTestMethod]
7 | [DataRow("en")]
8 | [DataRow("de")]
9 | public void ToStringTest1(string input) => Assert.AreEqual(input, LanguageConverter.ToString(input.AsSpan()));
10 | }
11 |
--------------------------------------------------------------------------------
/src/FolkerKinzel.VCards/Enums/VCdVersion.cs:
--------------------------------------------------------------------------------
1 | namespace FolkerKinzel.VCards.Enums;
2 |
3 | /// Named constants to indicate the VCF version.
4 | public enum VCdVersion
5 | {
6 | /// vCard 2.1
7 | V2_1 = 2,
8 |
9 | /// vCard 3.0
10 | V3_0 = 3,
11 |
12 | /// vCard 4.0
13 | V4_0 = 4
14 | }
15 |
--------------------------------------------------------------------------------
/docs/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | FolkerKinzel.VCards - Project Reference
7 |
8 |
9 | If you are not redirected automatically, follow this link to the project reference .
10 |
11 |
12 |
--------------------------------------------------------------------------------
/src/FolkerKinzel.VCards.Tests/CodeCoverage2.bat:
--------------------------------------------------------------------------------
1 | dotnet test /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura /p:CoverletOutput=./reports/ /p:ExcludeByAttribute=\"Obsolete,GeneratedCode,ExcludeFromCodeCoverage\" /p:SkipAutoProps=true /p:DoesNotReturnAttribute="DoesNotReturnAttribute"
2 | reportgenerator -reports:./reports/coverage.net7.0.cobertura.xml -targetdir:./reports/html/
3 | cd reports/html/
4 | index.htm
--------------------------------------------------------------------------------
/docs/reference/css/ko-KR.css:
--------------------------------------------------------------------------------
1 | /* ko-KR locale-specific CSS */
2 | body
3 | {
4 | font-family: Malgun Gothic, Segoe UI, Verdana, Arial;
5 | font-size: 0.75em; /*9pt*/
6 | }
7 | pre
8 | {
9 | font-family: Consolas, Courier, monospace, 돋움체;
10 | }
11 | span.tt
12 | {
13 | font-family: Consolas, Courier, monospace, 돋움체;
14 | }
15 | span.code
16 | {
17 | font-family: Consolas, Courier, monospace, 돋움체;
18 | }
19 |
--------------------------------------------------------------------------------
/docs/reference/fti/FTI_55.json:
--------------------------------------------------------------------------------
1 | {"7e93":[2686980,3538948,4849668,6881284,8257540,8388612,11862020,17170436,17629188,18481156,18939908,19464196,19595268,19922948,21495812,21823492,23265284,24051716,29163524,29491204,32505860,33292292,37879812,42336260,42532868,50331652,51511300,53542916,53805060,54067204,54460420,55508996,56295428,58785796,60293124,61603844,64290820,64749572,65404932,67436548,68288516,69664772],"768":[9502721,28049409]}
--------------------------------------------------------------------------------
/src/FolkerKinzel.VCards/Intls/XNameValidator.cs:
--------------------------------------------------------------------------------
1 | namespace FolkerKinzel.VCards.Intls;
2 |
3 | internal static class XNameValidator
4 | {
5 | internal static bool IsXName(string? xName)
6 | {
7 | ReadOnlySpan span = xName.AsSpan();
8 | return span.Length >= 3 &&
9 | span.StartsWith("X-", StringComparison.OrdinalIgnoreCase) &&
10 | !span.Contains(' ');
11 | }
12 | }
--------------------------------------------------------------------------------
/src/FolkerKinzel.VCards/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Runtime.InteropServices;
2 |
3 | [assembly: CLSCompliant(true)]
4 | [assembly: InternalsVisibleTo("FolkerKinzel.VCards.Tests")]
5 | [assembly: InternalsVisibleTo("BenchmarksCurrentVersion")]
6 | [assembly: InternalsVisibleTo("Experiments")]
7 |
8 |
9 | [assembly: ComVisible(false)]
10 |
11 | [assembly: Guid("ff5979fd-0623-4b33-9755-2584b761bf40")]
12 |
13 |
14 |
--------------------------------------------------------------------------------
/src/FolkerKinzel.VCards.Tests/Intls/Converters/EMailConverterTests.cs:
--------------------------------------------------------------------------------
1 | namespace FolkerKinzel.VCards.Intls.Converters.Tests;
2 |
3 | [TestClass]
4 | public class EMailConverterTests
5 | {
6 | [DataTestMethod]
7 | [DataRow("internet")]
8 | [DataRow("x400")]
9 | [DataRow("OTHER")]
10 | public void ParseTest1(string input) => Assert.AreEqual(input.ToUpperInvariant(), EMailConverter.ToString(input.AsSpan()));
11 | }
12 |
--------------------------------------------------------------------------------
/src/FolkerKinzel.VCards/Enums/Access.cs:
--------------------------------------------------------------------------------
1 | namespace FolkerKinzel.VCards.Enums;
2 |
3 | /// Named constants to indicate in vCard 3.0 which level of confidentiality
4 | /// applies to the vCard.
5 | public enum Access
6 | {
7 | /// Public
8 | Public,
9 |
10 | /// Private
11 | Private,
12 |
13 | /// Confidential
14 | Confidential
15 | }
16 |
--------------------------------------------------------------------------------
/src/FolkerKinzel.VCards/Enums/EMail.cs:
--------------------------------------------------------------------------------
1 | namespace FolkerKinzel.VCards.Enums;
2 |
3 | /// Named constants to describe the type of an e-mail address.
4 | public static class EMail
5 | {
6 | /// Internet addressing type
7 | public const string SMTP = "INTERNET";
8 |
9 | /// X.400 addressing type (e.g. "BusinessMail X.400")
10 | public const string X400 = "X400";
11 | }
12 |
--------------------------------------------------------------------------------
/docs/reference/css/zh-CN.css:
--------------------------------------------------------------------------------
1 | /* zh-CN locale-specific CSS */
2 | body
3 | {
4 | font-family: "Microsoft YaHei UI","Microsoft YaHei","SimSun","Segoe UI","Lucida Grande",Verdana,Arial,Helvetica,sans-serif
5 | }
6 | pre
7 | {
8 | font-family: Consolas, Courier, monospace!important;
9 | }
10 | span.tt
11 | {
12 | font-family: Consolas, Courier, monospace;
13 | }
14 | span.code
15 | {
16 | font-family: Consolas, Courier, monospace;
17 | }
18 |
--------------------------------------------------------------------------------
/src/FolkerKinzel.VCards/Intls/Extensions/IntExtension.cs:
--------------------------------------------------------------------------------
1 | namespace FolkerKinzel.VCards.Intls.Extensions;
2 |
3 | internal static class IntExtension
4 | {
5 | [MethodImpl(MethodImplOptions.AggressiveInlining)]
6 | internal static bool ValidateID(this int id) => id > 0;
7 |
8 | [MethodImpl(MethodImplOptions.AggressiveInlining)]
9 | internal static bool ValidateID(this int? id) => !id.HasValue || id.Value.ValidateID();
10 |
11 | }
12 |
--------------------------------------------------------------------------------
/src/Experiments/GlobalSuppressions.cs:
--------------------------------------------------------------------------------
1 | // This file is used by Code Analysis to maintain SuppressMessage
2 | // attributes that are applied to this project.
3 | // Project-level suppressions either have no target or are given
4 | // a specific target and scoped to a namespace, type, member, etc.
5 |
6 | using System.Diagnostics.CodeAnalysis;
7 |
8 | [assembly: SuppressMessage("Globalization", "CA1303:Do not pass literals as localized parameters", Justification = "")]
9 |
--------------------------------------------------------------------------------
/docs/reference/fti/FTI_121.json:
--------------------------------------------------------------------------------
1 | {"yahoo":[4390913,15597569,28049409],"yield":[65011713],"yields":[2818049,4259841,4784129,7405569,9895937,10354689,20250625,21692417,25100289,30474241,30867457,33947649,35127297,37945345,38797313,42663937,43450369,48168961,49545217,52035585,52494337,53936129,54001665,55050241,59047937,61145089,61341697,63897601,65011713,66387969,67895297],"year":[2752517,2883585,18612228,31522820,40239105,41418756,50987009,54067206,59375618,59899908,64880641,65011716,65798148]}
--------------------------------------------------------------------------------
/src/FolkerKinzel.VCards.Tests/Intls/Converters/StringArrayConverterTests.cs:
--------------------------------------------------------------------------------
1 | namespace FolkerKinzel.VCards.Intls.Converters.Tests;
2 |
3 | [TestClass]
4 | public class StringArrayConverterTests
5 | {
6 | [TestMethod]
7 | public void ToStringArrayTest1() => Assert.IsNotNull(StringArrayConverter.ToStringArray(["Hello"]));
8 |
9 |
10 | [TestMethod]
11 | public void ToStringArrayTest2() => Assert.IsNotNull(StringArrayConverter.ToStringArray([" "]));
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/src/Experiments/Program.cs:
--------------------------------------------------------------------------------
1 | // See https://aka.ms/new-console-template for more information
2 |
3 | using BenchmarkDotNet.Running;
4 | using Experiments;
5 |
6 | //var bench = new FrozenDictionaryBench();
7 |
8 | //var frozen = Enumerable.Range(1,2).ToFrozenDictionary(x => x);
9 |
10 | //BenchmarkDotNet.Reports.Summary report = BenchmarkRunner.Run();
11 | BenchmarkDotNet.Reports.Summary report = BenchmarkRunner.Run();
12 |
13 |
14 | Console.WriteLine(report);
--------------------------------------------------------------------------------
/src/BenchmarksCurrentVersion/QuotedPrintableBench.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using BenchmarkDotNet.Attributes;
3 | using FolkerKinzel.VCards.Intls.Encodings;
4 |
5 | namespace Benchmarks;
6 |
7 | public class QuotedPrintableBench
8 | {
9 | [Benchmark]
10 | public void Decode()
11 | {
12 | string quoted = $"1=0D=0AFirmenstra=C3=9Fe=0D=0AOrt Firma, Bundesland Firma PLZFirma=0D=0ALand=\r\n Firma";
13 |
14 | _ = QuotedPrintable.Decode(quoted.AsSpan(), null);
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/src/IncVersion/README.txt:
--------------------------------------------------------------------------------
1 | IncVersion 1.2
2 | ==============
3 |
4 | IncVersion is a very small platform-independent .NetCore-3.1-dll, witch increments the the property in the Visual Studio Project File automatically after every build.
5 | It can be used in Visual Studio 2019 projects on Sdk-style project files.
6 |
7 | Detailed informations and updates can be found:
8 |
9 | https://github.com/FolkerKinzel/IncVersion
10 |
11 |
12 | Don't move it, don't delete it and don't rename it!
--------------------------------------------------------------------------------
/src/FolkerKinzel.VCards/Intls/Encodings/Base64Helper.cs:
--------------------------------------------------------------------------------
1 | namespace FolkerKinzel.VCards.Intls.Encodings;
2 |
3 | internal static class Base64Helper
4 | {
5 | internal static byte[]? GetBytesOrNull(ReadOnlySpan base64)
6 | {
7 | try
8 | {
9 | return Base64.GetBytes(base64,
10 | Base64ParserOptions.AcceptMissingPadding);
11 | }
12 | catch
13 | {
14 | return null;
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/FolkerKinzel.VCards.Tests/Intls/Converters/AdrConverterTests.cs:
--------------------------------------------------------------------------------
1 | using FolkerKinzel.VCards.Enums;
2 |
3 | namespace FolkerKinzel.VCards.Intls.Converters.Tests;
4 |
5 | [TestClass]
6 | public class AdrConverterTests
7 | {
8 | [TestMethod]
9 | [ExpectedException(typeof(ArgumentOutOfRangeException))]
10 | public void ToVcfStringTest() => _ = AdrConverter.ToVcfString((Adr)4711);
11 |
12 | [TestMethod]
13 | public void ParseTest() => Assert.IsNull(AdrConverter.Parse(null));
14 | }
15 |
16 |
--------------------------------------------------------------------------------
/src/FolkerKinzel.VCards/Intls/Extensions/StringArrayExtension.cs:
--------------------------------------------------------------------------------
1 | namespace FolkerKinzel.VCards.Intls.Extensions;
2 |
3 | internal static class StringArrayExtension
4 | {
5 | internal static bool ContainsData([NotNullWhen(true)] this string?[]? arr)
6 | {
7 | foreach (string? str in arr.AsSpan())
8 | {
9 | if (!string.IsNullOrWhiteSpace(str))
10 | {
11 | return true;
12 | }
13 | }
14 |
15 | return false;
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/docs/reference/toc/Root.xml:
--------------------------------------------------------------------------------
1 | Docs
--------------------------------------------------------------------------------
/src/BenchmarksCurrentVersion/HasFlagBench.cs:
--------------------------------------------------------------------------------
1 | using BenchmarkDotNet.Attributes;
2 | using FolkerKinzel.VCards.Enums;
3 | using FolkerKinzel.VCards.Extensions;
4 |
5 | namespace Benchmarks;
6 |
7 |
8 | [MemoryDiagnoser]
9 | public class HasFlagBench
10 | {
11 | private readonly Adr? _value = Adr.Dom | Adr.Intl | Adr.Postal;
12 |
13 |
14 | [Benchmark]
15 | public bool IsSet() => _value.IsSet(Adr.Parcel);
16 |
17 |
18 | [Benchmark]
19 | public bool HasFlag() => _value!.Value.HasFlag(Adr.Parcel);
20 | }
21 |
--------------------------------------------------------------------------------
/src/FolkerKinzel.VCards.Tests/TestFiles/Cropped_2_1.vcf:
--------------------------------------------------------------------------------
1 | BEGIN:VCARD
2 | VERSION:2.1
3 | N:Mustermann;Max;Middle Name;Dr.
4 | FN:Maxl
5 | NICKNAME:Maxl
6 | ORG;CHARSET=utf-8;ENCODING=QUOTED-PRINTABLE:Firma;F=C3=BChrungsetage
7 | TITLE:Position
8 | NOTE;CHARSET=utf-8;ENCODING=QUOTED-PRINTABLE:Kommentar =C3=84=C3=84=C3=84=C3=84=C3=84=C3=84 =C3=A4=C3=A4=C3=A4=C3=A4=C3=
9 |
10 | =A4=C3=A4 =C3=96=C3=96=C3=96=C3=96=C3=96=C3=96 =C3=B6=C3=B6=C3=B6=C3=B6=C3=
11 |
12 | =B6=C3=B6 =C3=9C=C3=9C=C3=9C=C3=9C=C3=9C=C3=9C =C3=BC=C3=BC=C3=BC=C3=BC=C3=
13 |
--------------------------------------------------------------------------------
/src/FolkerKinzel.VCards/Intls/Converters/EMailConverter.cs:
--------------------------------------------------------------------------------
1 | using FolkerKinzel.VCards.Enums;
2 |
3 | namespace FolkerKinzel.VCards.Intls.Converters;
4 |
5 | internal static class EMailConverter
6 | {
7 | internal static string ToString(ReadOnlySpan value)
8 | {
9 | const StringComparison comp = StringComparison.OrdinalIgnoreCase;
10 |
11 | return value.Equals(EMail.SMTP, comp) ? EMail.SMTP
12 | : value.Equals(EMail.X400, comp) ? EMail.X400
13 | : value.ToString();
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/src/Namespaces/Namespaces.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net9.0
6 | enable
7 | enable
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/src/BenchmarksCurrentVersion/GlobalSuppressions.cs:
--------------------------------------------------------------------------------
1 | // This file is used by Code Analysis to maintain SuppressMessage
2 | // attributes that are applied to this project.
3 | // Project-level suppressions either have no target or are given
4 | // a specific target and scoped to a namespace, type, member, etc.
5 |
6 | using System.Diagnostics.CodeAnalysis;
7 |
8 | [assembly: SuppressMessage("Globalization", "CA1303:Do not pass literals as localized parameters", Justification = "", Scope = "member", Target = "~M:Benchmarks.QuotedPrintableBench.Decode")]
9 |
--------------------------------------------------------------------------------
/src/FolkerKinzel.VCards.Tests/Models/GenderTests.cs:
--------------------------------------------------------------------------------
1 | using FolkerKinzel.VCards.Enums;
2 |
3 | namespace FolkerKinzel.VCards.Models.Tests;
4 |
5 | [TestClass]
6 | public class GenderTests
7 | {
8 | [DataTestMethod]
9 | [DataRow(null, null, true)]
10 | [DataRow(null, "Other", false)]
11 | [DataRow(Sex.Unknown, null, false)]
12 | public void IsEmptyTest1(Sex? gender, string? identity, bool expected)
13 | {
14 | var info = Gender.Create(gender, identity);
15 | Assert.AreEqual(expected, info.IsEmpty);
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/FolkerKinzel.VCards/Intls/Converters/VCdVersionConverter.cs:
--------------------------------------------------------------------------------
1 | using FolkerKinzel.VCards.Enums;
2 |
3 | namespace FolkerKinzel.VCards.Intls.Converters;
4 |
5 | internal static class VCdVersionConverter
6 | {
7 | internal static VCdVersion Parse(ReadOnlySpan value)
8 | {
9 | return value.IsEmpty
10 | ? VCdVersion.V2_1
11 | : value[0] switch
12 | {
13 | '4' => VCdVersion.V4_0,
14 | '3' => VCdVersion.V3_0,
15 | _ => VCdVersion.V2_1
16 | };
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/src/FolkerKinzel.VCards.Tests/Intls/Serializers/TimeZoneIDSerializerTests.cs:
--------------------------------------------------------------------------------
1 | using System.Text;
2 | using FolkerKinzel.VCards.Intls.Serializers;
3 | using FolkerKinzel.VCards.Models;
4 |
5 | namespace FolkerKinzel.VCards.Tests.Intls.Serializers;
6 |
7 | [TestClass]
8 | public class TimeZoneIDSerializerTests
9 | {
10 | [TestMethod]
11 | public void AppendToTest1()
12 | {
13 | var sb = new StringBuilder();
14 | TimeZoneIDSerializer.AppendTo(sb, TimeZoneID.Empty, Enums.VCdVersion.V4_0, null, false);
15 | Assert.AreEqual(0, sb.Length);
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/BenchmarksCurrentVersion/AddressOrderBench.cs:
--------------------------------------------------------------------------------
1 | using BenchmarkDotNet.Attributes;
2 | using FolkerKinzel.VCards.Intls.Formatters;
3 | using FolkerKinzel.VCards.Models;
4 | using FolkerKinzel.VCards.Models.PropertyParts;
5 |
6 | namespace Benchmarks;
7 |
8 | [MemoryDiagnoser]
9 | [RyuJitX64Job]
10 | public class AddressOrderBench
11 | {
12 | private readonly Address _address = new AddressProperty(null, null, null, null, country: "Germany", autoLabel: false).Value;
13 |
14 | [Benchmark]
15 | public object? GetAddressOrder() => AddressOrderConverter.ParseAddress(_address);
16 | }
17 |
--------------------------------------------------------------------------------
/src/FolkerKinzel.VCards/Intls/Deserializers/StringDeserializer.cs:
--------------------------------------------------------------------------------
1 | using FolkerKinzel.VCards.Enums;
2 | using FolkerKinzel.VCards.Intls.Extensions;
3 |
4 | namespace FolkerKinzel.VCards.Intls.Deserializers;
5 |
6 | internal static class StringDeserializer
7 | {
8 | internal static string Deserialize(VcfRow vcfRow, VCdVersion version)
9 | {
10 | return vcfRow.Parameters.Encoding == Enc.QuotedPrintable
11 | ? vcfRow.Value.Span.UnMaskAndDecodeValue(vcfRow.Parameters.CharSet)
12 | : vcfRow.Value.Span.UnMaskValue(version);
13 | }
14 | }
15 |
16 |
17 |
--------------------------------------------------------------------------------
/docs/reference/fti/FTI_120.json:
--------------------------------------------------------------------------------
1 | {"xfn":[9502721],"x400":[10289153,39518209,67567624],"xml":[5242882,11862018,18939906,26738690,30605317,57475074,68091906],"xmlns":[30605313],"xd4qgmembcudkc2dls72ggvwn":[2686977,3538945,4849665,6881281,8257537,8388609,11862017,17170433,17629185,18481153,18939905,19464193,19595265,19922945,21495809,21823489,23265281,24051713,29163521,29491201,32505857,33292289,37879809,42336257,42532865,50331649,51511297,53542913,53805057,54067201,54460417,55508993,56295425,58785793,60293121,61603841,64290817,64749569,65404929,67436545,68288513,69664769],"xmls":[5242881,11862017,18939905,26738693,30605317,57475073,68091905]}
--------------------------------------------------------------------------------
/src/FolkerKinzel.VCards/Intls/ArrayPoolHelper.cs:
--------------------------------------------------------------------------------
1 | using System.Buffers;
2 |
3 | namespace FolkerKinzel.VCards.Intls;
4 |
5 | internal static class ArrayPoolHelper
6 | {
7 | internal static SharedArray Rent(int minimumLength) => new(minimumLength);
8 |
9 | internal readonly struct SharedArray : IDisposable
10 | {
11 | internal SharedArray(int minimumLength)
12 | => Array = ArrayPool.Shared.Rent(minimumLength);
13 |
14 | internal T[] Array { get; }
15 |
16 | public void Dispose() => ArrayPool.Shared.Return(Array, Confidentiality.IsConfidential);
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/src/FolkerKinzel.VCards/Enums/Enc.cs:
--------------------------------------------------------------------------------
1 | namespace FolkerKinzel.VCards.Enums;
2 |
3 | /// Named constants to specify the encoding of the value of a vCard property.
4 | public enum Enc
5 | {
6 | /// B , BASE64 : Base64 (2,3)
7 | Base64,
8 |
9 | /// QUOTED-PRINTABLE : Quoted Printable (2)
10 | QuotedPrintable,
11 |
12 | /// 8BIT : 8-Bit charset (2)
13 | Ansi,
14 |
15 | // Ascii (7-Bit) is the standard encoding in vCard 2.1 and does not have to be indicated.
16 | // Ascii
17 | }
18 |
--------------------------------------------------------------------------------
/docs/PackageReleaseNotes/5.0.0-beta.1/ReleaseNotes.md:
--------------------------------------------------------------------------------
1 | # FolkerKinzel.VCards 5.0.0-beta.1
2 | ## Package Release Notes
3 | - Introduces two new helper classes: `AnsiFilter` and `MultiAnsiFilter`, which support you to load VCF files automatically with the right encoding.
4 | - Fixes a bug, which sometimes occurred with the assignment of labels to addresses.
5 | - Fixes an issue that the CHARSET parameter of vCard 2.1 LABEL properties was not preserved.
6 | - Fixes an issue that the `VCard.LoadVcf`, `VCard.ParseVcf` and `VCard.DeserializeVcf` did catch too many exceptions.
7 | - `ParameterSection.Charset` had been renamed to `ParameterSection.CharSet`.
8 |
--------------------------------------------------------------------------------
/docs/reference/css/vs.min.css:
--------------------------------------------------------------------------------
1 | pre code.hljs{display:block;overflow-x:auto;padding:0}code.hljs{padding:3px 5px}.hljs{background:#fff;color:#000}.hljs-comment,.hljs-quote,.hljs-variable{color:green}.hljs-built_in,.hljs-keyword,.hljs-name,.hljs-selector-tag,.hljs-tag{color:#00f}.hljs-addition,.hljs-attribute,.hljs-literal,.hljs-section,.hljs-string,.hljs-template-tag,.hljs-template-variable,.hljs-title,.hljs-type{color:#a31515}.hljs-deletion,.hljs-meta,.hljs-selector-attr,.hljs-selector-pseudo{color:#2b91af}.hljs-doctag{color:grey}.hljs-attr{color:red}.hljs-bullet,.hljs-link,.hljs-symbol{color:#00b0e8}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700}
--------------------------------------------------------------------------------
/src/Experiments/Experiments.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net9.0
6 | 13.0
7 | enable
8 | enable
9 | en
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/src/FolkerKinzel.VCards/Intls/DebugWriter.cs:
--------------------------------------------------------------------------------
1 | namespace FolkerKinzel.VCards.Intls;
2 |
3 | internal static class DebugWriter
4 | {
5 | [Conditional("DEBUG")]
6 | [ExcludeFromCodeCoverage]
7 | [DebuggerStepThrough]
8 | internal static void WriteMethodHeader(string? MethodName)
9 | {
10 | const int HEADER_LENGTH = 40;
11 |
12 | Debug.WriteLine("");
13 | Debug.WriteLine(new string('/', HEADER_LENGTH));
14 | Debug.WriteLine("");
15 | Debug.WriteLine("", " " + MethodName);
16 | Debug.WriteLine("");
17 | Debug.WriteLine(new string('/', HEADER_LENGTH));
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/docs/reference/fti/FTI_113.json:
--------------------------------------------------------------------------------
1 | {"qualifier":[2621441,5898241,38469633,60751873],"qualifiers":[2621441,3145729,5898241,37421057,38469633,38862849,55640065],"quadrant":[6291458,21364737,23855105,27721729,33357826,38731777,64684034,67239937],"quotedprintable":[54853633],"quoted":[2686981,3538949,4849669,6881285,8257541,8388613,11862021,17170437,17629189,18481157,18939909,19464197,19595269,19922949,21495813,21823493,23265285,24051717,29163525,29491205,32505861,33292293,37879813,42336261,42532869,50331653,51511301,53542917,53805061,54067205,54460421,54853634,55508997,56295429,57212929,58785797,60293125,61603845,64290821,64749573,65404933,67436549,68288517,69664773]}
--------------------------------------------------------------------------------
/docs/reference/toc/IDABAA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards Address Formatter Properties Default
--------------------------------------------------------------------------------
/docs/reference/toc/IDAFAA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards Name Formatter Properties Default
--------------------------------------------------------------------------------
/src/FolkerKinzel.VCards/Formatters/ICompoundProperty.cs:
--------------------------------------------------------------------------------
1 | using FolkerKinzel.VCards.Models.Properties;
2 | using FolkerKinzel.VCards.Models.Properties.Parameters;
3 |
4 | namespace FolkerKinzel.VCards.Formatters;
5 |
6 | ///
7 | /// Interface implemented by instances containing a compound value.
8 | ///
9 | ///
10 | ///
11 | public interface ICompoundProperty : ICompoundModel
12 | {
13 | /// Gets the data of the parameter section of a vCard property.
14 | ParameterSection Parameters { get; }
15 | }
16 |
17 |
18 |
--------------------------------------------------------------------------------
/src/FolkerKinzel.VCards/Intls/Formatters/NameOrder.cs:
--------------------------------------------------------------------------------
1 | namespace FolkerKinzel.VCards.Intls.Formatters;
2 |
3 | internal enum NameOrder
4 | {
5 | ///
6 | /// Prefixes + GivenNames + AdditionalNames + Surnames2 + FamilyNames + Generations + Suffixes
7 | ///
8 | Default,
9 |
10 | ///
11 | /// FamilyNames + GivenNames
12 | ///
13 | Hungarian,
14 |
15 | ///
16 | /// GivenNames + FamilyNames + Surnames2
17 | ///
18 | Spanish,
19 |
20 | ///
21 | /// FamilyNames + AdditionalNames + GivenNames
22 | ///
23 | Vietnamese
24 | }
--------------------------------------------------------------------------------
/src/FolkerKinzel.VCards/Enums/Sex.cs:
--------------------------------------------------------------------------------
1 | namespace FolkerKinzel.VCards.Enums;
2 |
3 | /// Named Constants to specify the gender of the object the
4 | /// represents.
5 | public enum Sex
6 | {
7 | /// U : Unknown. (4)
8 | Unknown,
9 |
10 | /// F : Female. (4)
11 | Female,
12 |
13 | /// M : Male. (4)
14 | Male,
15 |
16 | /// N : None or not applicable. (4)
17 | NonOrNotApplicable,
18 |
19 | /// O : Other. (4)
20 | Other
21 | }
22 |
--------------------------------------------------------------------------------
/docs/reference/toc/IDAGAA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards Sync Operation Properties Current App ID
--------------------------------------------------------------------------------
/docs/reference/toc/IDAAEA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards. Formatters IAddress Formatter Methods To Label
--------------------------------------------------------------------------------
/docs/reference/toc/IDACEA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards. Formatters ICompound Property Properties Parameters
--------------------------------------------------------------------------------
/docs/reference/toc/IDAEEA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards. Formatters JSComps Formatter Methods Try Format
--------------------------------------------------------------------------------
/src/FolkerKinzel.VCards.Tests/Intls/Converters/VCdVersionConverterTests.cs:
--------------------------------------------------------------------------------
1 | using FolkerKinzel.VCards.Enums;
2 |
3 | namespace FolkerKinzel.VCards.Intls.Converters.Tests;
4 |
5 | [TestClass()]
6 | public class VCdVersionConverterTests
7 | {
8 | [DataTestMethod()]
9 | [DataRow(null, VCdVersion.V2_1)]
10 | [DataRow("bla", VCdVersion.V2_1)]
11 | [DataRow("", VCdVersion.V2_1)]
12 | [DataRow("2.1", VCdVersion.V2_1)]
13 | [DataRow("3.0", VCdVersion.V3_0)]
14 | [DataRow("4.0", VCdVersion.V4_0)]
15 | public void ParseTest(string? input, VCdVersion expected)
16 | => Assert.AreEqual(expected, VCdVersionConverter.Parse(input.AsSpan()));
17 | }
18 |
--------------------------------------------------------------------------------
/docs/reference/toc/IDADEA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards. Formatters IName Formatter Methods To Display Name
--------------------------------------------------------------------------------
/src/FolkerKinzel.VCards.Tests/MethodNotFoundIssue.cs:
--------------------------------------------------------------------------------
1 | namespace FolkerKinzel.VCards.Tests;
2 |
3 | [TestClass]
4 | public class MethodNotFoundIssue
5 | {
6 | [TestMethod]
7 | public void MethodNotFound()
8 | {
9 | string vCard = """
10 | BEGIN:VCARD
11 | VERSION:3.0
12 | FN:Folker
13 | END:VCARD
14 | """;
15 |
16 | using TextReader stringReader = new StringReader(vCard);
17 | using var vcfReader = new VcfReader(stringReader);
18 |
19 | IEnumerable result = vcfReader.ReadToEnd();
20 |
21 | var parsedVCards = result.ToList();
22 |
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/src/FolkerKinzel.VCards/Enums/Expertise.cs:
--------------------------------------------------------------------------------
1 | using FolkerKinzel.VCards.Models.Properties.Parameters;
2 |
3 | namespace FolkerKinzel.VCards.Enums;
4 |
5 | ///
6 | /// Named constants to specify the parameter
7 | /// in the property VCard.Expertises . (RFC 6715)
8 | ///
9 | public enum Expertise
10 | {
11 | // CAUTION: If the enum is expanded, ExpertiseConverter
12 | // must be adjusted!
13 |
14 | /// Beginner
15 | Beginner,
16 |
17 | /// Average
18 | Average,
19 |
20 | /// Expert
21 | Expert
22 | }
23 |
--------------------------------------------------------------------------------
/src/Namespaces/Program.cs:
--------------------------------------------------------------------------------
1 | // Publish this namespace - it contains the VCard class
2 | // and the VCardBuilder class:
3 | using FolkerKinzel.VCards;
4 |
5 | // It's recommended to publish also this namespace -
6 | // it contains useful extension methods:
7 |
8 | // This namespace contains often used enums. Decide
9 | // yourself whether to publish this namespace or to use
10 | // a namespace alias.
11 |
12 |
13 | // Since VCardBuilder exists, the model classes normally
14 | // don't need to be instantiated in own code:
15 | // using FolkerKinzel.VCards.Models;
16 |
17 | // Application registration:
18 | VCard.RegisterApp(new Uri("urn:uuid:53e374d9-337e-4727-8803-a1e9c14e0556"));
19 |
20 |
--------------------------------------------------------------------------------
/src/FolkerKinzel.VCards/Intls/Converters/StringArrayConverter.cs:
--------------------------------------------------------------------------------
1 | namespace FolkerKinzel.VCards.Intls.Converters;
2 |
3 | internal static class StringArrayConverter
4 | {
5 | internal static string[] ToStringArray(IEnumerable coll)
6 | {
7 | string?[] arr = coll.ToArray();
8 | Span span = arr;
9 |
10 | for (int i = 0; i < span.Length; i++)
11 | {
12 | if (span[i] is null)
13 | {
14 | span[i] = "";
15 | }
16 | }
17 |
18 | return arr!;
19 | }
20 |
21 | internal static string[] ToStringArray(string? s)
22 | => string.IsNullOrEmpty(s) ? [] : [s];
23 | }
24 |
--------------------------------------------------------------------------------
/docs/reference/toc/IDADAA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards ITime Zone IDConverter Methods Try Convert To Utc Offset
--------------------------------------------------------------------------------
/src/FolkerKinzel.VCards/md/Name order.md:
--------------------------------------------------------------------------------
1 | # Source: Interpol (UK) : A Guide To Names And Naming Practices
2 |
3 | ## Default
4 | Prefixes + GivenNames + AdditionalNames + Surnames2 + FamilyNames + Generations + Suffixes
5 |
6 | ## FamilyNames + GivenNames:
7 |
8 | | Language | |
9 | | -------- | ---- |
10 | |HUNGARIAN | hu- |
11 | |BOSNIAN | bs- |
12 | |SERBIAN | sr- |
13 | |CROATIAN | hr- |
14 | |CHINESE | zh- |
15 | |KOREAN | ko- |
16 |
17 |
18 |
19 | ## FamilyNames + AdditionalNames + GivenNames:
20 |
21 | |VIETNAMESE | vi- |
22 | | --------- | --- |
23 |
24 |
25 | ## GivenNames + FamilyNames + Surnames2
26 | |SPANISH | es- |
27 | | ------ | --- |
28 |
29 |
--------------------------------------------------------------------------------
/src/FolkerKinzel.VCards.Tests/VcfReaderTests.cs:
--------------------------------------------------------------------------------
1 | namespace FolkerKinzel.VCards.Tests;
2 |
3 | [TestClass]
4 | public class VcfReaderTests
5 | {
6 | [TestMethod]
7 | [ExpectedException(typeof(ArgumentNullException))]
8 | public void VcfReaderTest() => _ = new VcfReader(null!);
9 |
10 | [TestMethod]
11 | public void ReadToEndTest1()
12 | {
13 | VCard.SyncTestReset();
14 | VCard.RegisterApp(null);
15 |
16 | using var textReader = new StreamReader(TestFiles.LargeFileVcf);
17 | using var reader = new VcfReader(textReader);
18 | IEnumerable result = reader.ReadToEnd();
19 |
20 | Assert.AreEqual(1000, result.Count());
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature_request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Feature request
3 | about: Suggest an idea for this project
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Is your feature request related to a problem? Please describe.**
11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12 |
13 | **Describe the solution you'd like**
14 | A clear and concise description of what you want to happen.
15 |
16 | **Describe alternatives you've considered**
17 | A clear and concise description of any alternative solutions or features you've considered.
18 |
19 | **Additional context**
20 | Add any other context or screenshots about the feature request here.
21 |
--------------------------------------------------------------------------------
/src/FolkerKinzel.VCards/Enums/Interest.cs:
--------------------------------------------------------------------------------
1 | using FolkerKinzel.VCards.Models.Properties.Parameters;
2 |
3 | namespace FolkerKinzel.VCards.Enums;
4 |
5 | ///
6 | /// Named constants to specify the parameter in the properties VCard.Hobbies and VCard.Interests . (RFC 6715)
9 | ///
10 | public enum Interest
11 | {
12 | // CAUTION: If the enum is expanded, InterestConverter
13 | // must be adjusted!
14 |
15 | /// High
16 | High,
17 |
18 | /// Medium
19 | Medium,
20 |
21 | /// Low
22 | Low
23 | }
24 |
--------------------------------------------------------------------------------
/src/FolkerKinzel.VCards/Intls/Formatters/DefaultAddressFormatter.cs:
--------------------------------------------------------------------------------
1 | using FolkerKinzel.VCards.Formatters;
2 | using FolkerKinzel.VCards.Models.Properties;
3 |
4 | namespace FolkerKinzel.VCards.Intls.Formatters;
5 |
6 | internal sealed class DefaultAddressFormatter : IAddressFormatter
7 | {
8 | public string? ToLabel(AddressProperty addressProperty)
9 | {
10 | _ArgumentNullException.ThrowIfNull(addressProperty, nameof(addressProperty));
11 | return addressProperty.Value.IsEmpty
12 | ? null
13 | : JSCompsFormatter.TryFormat(addressProperty, out string? formatted)
14 | ? formatted
15 | : AddressLabelFormatter.ToLabel(addressProperty);
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/BenchmarksCurrentVersion/ListConcatBench.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using BenchmarkDotNet.Attributes;
4 | using FolkerKinzel.VCards.Intls.Extensions;
5 |
6 | namespace Benchmarks;
7 |
8 | public class ListConcatBench
9 | {
10 | private readonly List> _shortList = [];
11 |
12 | [Params(1, 2, 3, 4, 5)]
13 | public int N { get; set; }
14 |
15 | public void GlobalSetup()
16 | {
17 | _shortList.Clear();
18 |
19 | for (int i = 0; i < N; i++)
20 | {
21 | _shortList.Add(ReadOnlyMemory.Empty);
22 | }
23 | }
24 |
25 | [Benchmark]
26 | public int ConcatShortListBench() => _shortList.Concat().Length;
27 | }
28 |
--------------------------------------------------------------------------------
/docs/reference/toc/IDADCA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards. Enums EMail Fields SMTP X400
--------------------------------------------------------------------------------
/docs/reference/toc/IDDHAA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards VCard Fields Default Calendar New Line
--------------------------------------------------------------------------------
/docs/reference/toc/IDJAA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards Vcf
--------------------------------------------------------------------------------
/src/FolkerKinzel.VCards.Tests/Intls/Converters/SexConverterTests.cs:
--------------------------------------------------------------------------------
1 | using FolkerKinzel.VCards.Enums;
2 |
3 | namespace FolkerKinzel.VCards.Intls.Converters.Tests;
4 |
5 | [TestClass]
6 | public class SexConverterTests
7 | {
8 | [TestMethod()]
9 | public void Roundtrip()
10 | {
11 | foreach (Sex sex in (Sex[])Enum.GetValues(typeof(Sex)))
12 | {
13 | Sex? sex2 = SexConverter.Parse(sex.ToString()[0]);
14 | Assert.AreEqual(sex, sex2);
15 | Sex? sex3 = SexConverter.Parse(SexConverter.ToVcfString(sex)![0]);
16 | Assert.AreEqual(sex, sex3);
17 | }
18 |
19 | // Test auf nicht definiert
20 | Assert.AreEqual(null, ((Sex?)4711).ToVcfString());
21 | }
22 |
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/docs/reference/toc/IDBKAA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards Vcf Reader Methods Dispose Read To End
--------------------------------------------------------------------------------
/docs/reference/toc/IDABEA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards. Formatters ICompound Model Properties Count Item
--------------------------------------------------------------------------------
/src/FolkerKinzel.VCards/Enums/Phonetic.cs:
--------------------------------------------------------------------------------
1 | namespace FolkerKinzel.VCards.Enums;
2 |
3 | ///
4 | /// Named constants to specify the phonetic system. (4 - RFC 9554)
5 | ///
6 | public enum Phonetic
7 | {
8 | // CAUTION: If the enum is expanded, PhoneticConverter must be updated
9 |
10 | /// ipa International Phonetic Alphabet (4 - RFC 9554)
11 | Ipa,
12 |
13 | /// jyut Cantonese romanization system "Jyutping" (4 - RFC 9554)
14 | Jyut,
15 |
16 | /// piny Standard Mandarin romanization system "Hanyu Pinyin" (4 - RFC 9554)
17 | Piny,
18 |
19 | /// script Unknown phonetic system (4 - RFC 9554)
20 | Script
21 | }
22 |
--------------------------------------------------------------------------------
/docs/reference/toc/IDBGAA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards Sync Operation Methods Reset Set Property IDs
--------------------------------------------------------------------------------
/docs/reference/toc/IDDCA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards. Enums EMail
--------------------------------------------------------------------------------
/docs/reference/toc/IDEAA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards Name Builder
--------------------------------------------------------------------------------
/docs/reference/toc/IDAAA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards Address Builder
--------------------------------------------------------------------------------
/docs/reference/toc/IDBBAFA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards. Models Namespaces Folker Kinzel. VCards. Models App ID Methods To String
--------------------------------------------------------------------------------
/docs/reference/toc/IDBCAA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards Ansi Filter Properties Fallback Encoding Used Encoding
--------------------------------------------------------------------------------
/docs/reference/toc/IDCHAFA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards. Models Namespaces Folker Kinzel. VCards. Models Organization Methods To String
--------------------------------------------------------------------------------
/docs/reference/toc/IDFAA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards Name Formatter
--------------------------------------------------------------------------------
/src/Examples/VcfReaderExample.cs:
--------------------------------------------------------------------------------
1 | using FolkerKinzel.VCards;
2 |
3 | namespace Examples;
4 |
5 | public static class VcfReaderExample
6 | {
7 | // Reads a very large VCF file whose contents cannot be
8 | // completely held in memory.
9 | public static void Example(string filePath)
10 | {
11 | using var textReader = new StreamReader(filePath);
12 | using var reader = new VcfReader(textReader);
13 |
14 | IEnumerable result = reader.ReadToEnd();
15 |
16 | Console.WriteLine("The file \"{0}\" contains {1} vCards.",
17 | Path.GetFileName(filePath),
18 | result.Count());
19 | }
20 | }
21 |
22 | /*
23 | Console Output:
24 |
25 | The file "LargeFile.vcf" contains 1000 vCards.
26 | */
--------------------------------------------------------------------------------
/docs/reference/toc/IDBAA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards Address Formatter
--------------------------------------------------------------------------------
/src/FolkerKinzel.VCards.Tests/Intls/Converters/DataConverterTests.cs:
--------------------------------------------------------------------------------
1 | using FolkerKinzel.VCards.Enums;
2 |
3 | namespace FolkerKinzel.VCards.Intls.Converters.Tests;
4 |
5 | [TestClass()]
6 | public class DataConverterTests
7 | {
8 | [TestMethod]
9 | public void Roundtrip()
10 | {
11 | foreach (Data kind in (Data[])Enum.GetValues(typeof(Data)))
12 | {
13 | string? s = DataConverter.ToVcfString(kind);
14 | Data? kind2 = DataConverter.Parse(s.AsSpan());
15 | Assert.AreEqual(kind, kind2);
16 | }
17 |
18 | // Test auf null
19 | Assert.AreEqual(null, DataConverter.Parse(null));
20 |
21 | // Test auf nicht definiert
22 | Assert.AreEqual(null, ((Data?)4711).ToVcfString());
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/docs/reference/toc/IDDAA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards ITime Zone IDConverter
--------------------------------------------------------------------------------
/src/Examples/Namespaces.cs:
--------------------------------------------------------------------------------
1 | // Publish this namespace - it contains commonly used classes such as
2 | // the VCard class, the VCardBuilder class, the NameBuilder class, and the
3 | // AddressBuilder class:
4 |
5 | // It's recommended to publish this namespace too -
6 | // it contains useful extension methods:
7 |
8 | // This namespace contains often used enums. Decide
9 | // yourself whether to publish this namespace or to use
10 | // a namespace alias:
11 |
12 | // This namespace contains the model classes such as GeoCoordinate or
13 | // TimeZoneID:
14 | // Contains the implementations of VCardProperty. If you use VCardBuilder to
15 | // create and manipulate VCard objects, you usually do not need to publish this
16 | // namespace:
17 | //using FolkerKinzel.VCards.Models.Properties;
18 |
19 |
--------------------------------------------------------------------------------
/docs/reference/toc/IDADA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards. Extensions Adr Extension
--------------------------------------------------------------------------------
/docs/reference/toc/IDCDA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards. Extensions Impp Extension
--------------------------------------------------------------------------------
/docs/reference/toc/IDDDA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards. Extensions PCl Extension
--------------------------------------------------------------------------------
/docs/reference/toc/IDDEA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards. Formatters IName Formatter
--------------------------------------------------------------------------------
/docs/reference/toc/IDEDA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards. Extensions Rel Extension
--------------------------------------------------------------------------------
/docs/reference/toc/IDFDA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards. Extensions Tel Extension
--------------------------------------------------------------------------------
/docs/reference/toc/IDAEA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards. Formatters IAddress Formatter
--------------------------------------------------------------------------------
/docs/reference/toc/IDBEA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards. Formatters ICompound Model
--------------------------------------------------------------------------------
/docs/reference/toc/IDEEA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards. Formatters JSComps Formatter
--------------------------------------------------------------------------------
/docs/reference/toc/IDFBA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards. Builder Parts Geo Builder
--------------------------------------------------------------------------------
/docs/reference/toc/IDKBA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards. Builder Parts Org Builder
--------------------------------------------------------------------------------
/docs/reference/toc/IDABA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards. Builder Parts Access Builder
--------------------------------------------------------------------------------
/docs/reference/toc/IDBDA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards. Extensions IEnumerable Extension
--------------------------------------------------------------------------------
/docs/reference/toc/IDCEA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards. Formatters ICompound Property
--------------------------------------------------------------------------------
/docs/reference/toc/IDEBA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards. Builder Parts Gender Builder
--------------------------------------------------------------------------------
/docs/reference/toc/IDGBA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards. Builder Parts Gram Builder
--------------------------------------------------------------------------------
/docs/reference/toc/IDGDA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards. Extensions Vcf Opts Extension
--------------------------------------------------------------------------------
/docs/reference/toc/IDHBA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards. Builder Parts Kind Builder
--------------------------------------------------------------------------------
/docs/reference/toc/IDLBA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards. Builder Parts Profile Builder
--------------------------------------------------------------------------------
/docs/reference/toc/IDNBA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards. Builder Parts Relation Builder
--------------------------------------------------------------------------------
/docs/reference/toc/IDPBA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards. Builder Parts Text Builder
--------------------------------------------------------------------------------
/docs/reference/toc/IDACAA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards Ansi Filter Constructors Ansi Filter( Int 32) Ansi Filter( String)
--------------------------------------------------------------------------------
/docs/reference/toc/IDBBA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards. Builder Parts Addresses Builder
--------------------------------------------------------------------------------
/docs/reference/toc/IDCBA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards. Builder Parts Contact IDBuilder
--------------------------------------------------------------------------------
/src/FolkerKinzel.VCards/VCard_IEnumerable.cs:
--------------------------------------------------------------------------------
1 | using System.Collections;
2 |
3 | namespace FolkerKinzel.VCards;
4 |
5 | public sealed partial class VCard : IEnumerable
6 | {
7 | ///
8 | IEnumerator IEnumerable.GetEnumerator() => ((IEnumerable)this).GetEnumerator();
9 |
10 | /// Explicit implementation of IEnumerable<VCard> ,
11 | /// which enables to pass a single object to a method or property
12 | /// that requires a collection of objects.
13 | /// An enumerator that returns the instance itself.
14 | IEnumerator IEnumerable.GetEnumerator()
15 | {
16 | yield return this;
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/docs/reference/toc/IDIBA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards. Builder Parts Name Views Builder
--------------------------------------------------------------------------------
/docs/reference/toc/IDJBA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards. Builder Parts Non Standard Builder
--------------------------------------------------------------------------------
/docs/reference/toc/IDMBA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards. Builder Parts Raw Data Builder
--------------------------------------------------------------------------------
/docs/reference/toc/IDRBA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards. Builder Parts Text View Builder
--------------------------------------------------------------------------------
/docs/reference/toc/IDSBA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards. Builder Parts Time Stamp Builder
--------------------------------------------------------------------------------
/docs/reference/toc/IDTBA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards. Builder Parts Time Zone Builder
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/bug_report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Bug report
3 | about: Create a report to help us improve
4 | title: "[Bug]"
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Describe the bug**
11 | A clear and concise description of what the bug is.
12 |
13 | **To Reproduce**
14 | Code to reproduce the behavior:
15 |
16 |
17 | **Expected behavior**
18 | A clear and concise description of what you expected to happen.
19 |
20 |
21 | **Desktop (please complete the following information):**
22 | - OS: [e.g. iOS]
23 | - .NET Version: [e.g. .NET 5.0]
24 |
25 | **Smartphone (please complete the following information):**
26 | - Device: [e.g. iPhone6]
27 | - OS: [e.g. iOS8.1]
28 | - .NET Version: [e.g. Mono Android 9.0]
29 |
30 |
31 | **Additional context**
32 | Add any other context about the problem here.
33 |
--------------------------------------------------------------------------------
/docs/reference/toc/IDOBA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards. Builder Parts String Collection Builder
--------------------------------------------------------------------------------
/docs/reference/toc/IDQBA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards. Builder Parts Text Singleton Builder
--------------------------------------------------------------------------------
/src/FolkerKinzel.VCards/Intls/Formatters/DisplayNameFormatter.cs:
--------------------------------------------------------------------------------
1 | using FolkerKinzel.VCards.Intls.Extensions;
2 | using FolkerKinzel.VCards.Models;
3 |
4 | namespace FolkerKinzel.VCards.Intls.Formatters;
5 |
6 | [Obsolete()]
7 | internal static class DisplayNameFormatter
8 | {
9 | internal static string? ToDisplayName(Name name)
10 | {
11 | Debug.Assert(name != null);
12 |
13 | return name.IsEmpty
14 | ? null
15 | #if NETSTANDARD2_0 || NET462
16 | : string.Join(" "
17 | #else
18 | : string.Join(' '
19 | #endif
20 | , name.Prefixes
21 | .Concat(name.Given)
22 | .Concat(name.Given2)
23 | .Concat(name.Surnames)
24 | .Concat(name.Surnames2)
25 | .Concat(name.Suffixes)
26 | .Concat(name.Generations));
27 | }
28 | }
--------------------------------------------------------------------------------
/src/FolkerKinzel.VCards/Enums/Impp.cs:
--------------------------------------------------------------------------------
1 | using FolkerKinzel.VCards.Extensions;
2 |
3 | namespace FolkerKinzel.VCards.Enums;
4 |
5 | /// Named constants to specify the type of an instant messenger handle
6 | /// in vCard 3.0. The constants can be combined.
7 | ///
8 | ///
9 | /// When working with the enum use the extension methods from the class.
11 | ///
12 | ///
13 | [Flags]
14 | public enum Impp
15 | {
16 | // CAUTION: If the enum is expanded, ImppConverter and
17 | // EnumValueCollector must be adjusted!
18 |
19 | /// Personal
20 | Personal = 1,
21 |
22 | /// Business
23 | Business = 2,
24 |
25 | /// Mobile
26 | Mobile = 4
27 | }
28 |
--------------------------------------------------------------------------------
/docs/reference/toc/IDDBA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards. Builder Parts Date And Or Time Builder
--------------------------------------------------------------------------------
/src/FolkerKinzel.VCards.Tests/Intls/Converters/ImppConverterTest.cs:
--------------------------------------------------------------------------------
1 | using FolkerKinzel.VCards.Enums;
2 |
3 | namespace FolkerKinzel.VCards.Intls.Converters.Tests;
4 |
5 | [TestClass]
6 | public class ImppConverterTest
7 | {
8 | [TestMethod]
9 | public void ParseTest()
10 | {
11 | foreach (Impp kind in (Impp[])Enum.GetValues(typeof(Impp)))
12 | {
13 | Impp? kind2 = ImppConverter.Parse(kind.ToString().AsSpan());
14 | Assert.AreEqual(kind, kind2);
15 | }
16 |
17 | Assert.IsNull(ImppConverter.Parse("NICHT_VORHANDEN".AsSpan()));
18 | Assert.IsNull(ImppConverter.Parse(null));
19 | }
20 |
21 |
22 | [TestMethod]
23 | [ExpectedException(typeof(ArgumentOutOfRangeException))]
24 | public void ToVcfStringTest() => _ = ImppConverter.ToVcfString((Impp)4711);
25 | }
26 |
--------------------------------------------------------------------------------
/docs/reference/toc/IDBIAA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards VCard Builder Methods
--------------------------------------------------------------------------------
/docs/reference/toc/IDABIAA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards VCard Builder Methods Create Create( VCard) Create( Boolean, Boolean)
--------------------------------------------------------------------------------
/docs/reference/toc/IDFAJAA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards Vcf Methods Load Load( String, Ansi Filter) Load( String, Encoding)
--------------------------------------------------------------------------------
/src/FolkerKinzel.VCards/Intls/Enums/NameProp.cs:
--------------------------------------------------------------------------------
1 | namespace FolkerKinzel.VCards.Intls.Enums;
2 |
3 | internal enum NameProp
4 | {
5 | /// Family Name(s) (also known as surname(s)). (2,3,4)
6 | Surnames,
7 |
8 | /// Given Name(s) (first name(s)). (2,3,4)
9 | Given,
10 |
11 | /// Additional Name(s) (middle name(s)). (2,3,4)
12 | Given2,
13 |
14 | /// Honorific Prefix(es). (2,3,4)
15 | Prefixes,
16 |
17 | /// Honorific Suffix(es). (2,3,4)
18 | Suffixes,
19 |
20 | /// Secondary surnames (used in some cultures), also known as "maternal surnames". (4 - RFC 9554)
21 | Surnames2,
22 |
23 | /// Generation markers or qualifiers, e.g., "Jr." or "III". (4 - RFC 9554)
24 | Generations
25 | }
26 |
--------------------------------------------------------------------------------
/docs/reference/fti/FTI_54.json:
--------------------------------------------------------------------------------
1 | {"64":[9502721,28049409,32440321,38010881],"6f4c29cf97ea":[19529730,34275330,43188226,47906818],"65":[9502721,28049409],"60":[2686978,3538946,4849666,6881282,8257538,8388610,11862018,17170434,17629186,18481154,18939906,19464194,19595266,19922946,21495810,21823490,23265282,24051714,29163522,29491202,32505858,33292290,37879810,42336258,42532866,50331650,51511298,53542914,53805058,54067202,54460418,55508994,56295426,58785794,60293122,61603842,64290818,64749570,65404930,67436546,68288514,69664770],"6474":[5242883,11862019,18939907,28049409,30081025,37027841,43384833,43581441,46268417,57475075,63963137,68091907],"6350":[19529729],"6901":[18808833],"6715":[3670017,4587523,5242884,5439489,10223617,11862020,16056321,17235969,18939908,21299201,25165825,25427969,27197441,28049409,50724865,53280769,57475076,57671682,60948483,63111169,68091908,69009409],"6473":[21757953]}
--------------------------------------------------------------------------------
/src/FolkerKinzel.VCards.Tests/Intls/Converters/EncConverterTests.cs:
--------------------------------------------------------------------------------
1 | using FolkerKinzel.VCards.Enums;
2 |
3 | namespace FolkerKinzel.VCards.Intls.Converters.Tests;
4 |
5 | [TestClass]
6 | public class EncConverterTests
7 | {
8 | [DataTestMethod]
9 | [DataRow(null, null)]
10 | [DataRow("Base64", Enc.Base64)]
11 | [DataRow("B", Enc.Base64)]
12 | [DataRow("b", Enc.Base64)]
13 | [DataRow("QuotedPrintable", Enc.QuotedPrintable)]
14 | [DataRow("Q", Enc.QuotedPrintable)]
15 | [DataRow("q", Enc.QuotedPrintable)]
16 | [DataRow("8Bit", Enc.Ansi)]
17 | [DataRow("gluck", null)]
18 | [DataRow(".", null)]
19 | [DataRow(" ", null)]
20 | [DataRow("", null)]
21 | public void ParseTest(string? input, Enc? expected)
22 | {
23 | Enc? enc = EncConverter.Parse(input);
24 | Assert.AreEqual(expected, enc);
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/src/FolkerKinzel.VCards/Intls/Deserializers/VcfRow_Data.cs:
--------------------------------------------------------------------------------
1 | using FolkerKinzel.VCards.Models.Properties.Parameters;
2 |
3 | namespace FolkerKinzel.VCards.Intls.Deserializers;
4 |
5 | /// Represents a data row in the VCF file.
6 | internal sealed partial class VcfRow
7 | {
8 | // Bsp. Vcf-Datenzeile:
9 | // item1.ADR;TYPE=HOME,WORK;PREF=1:;;Waldstr. 54;Kleinknuffelsdorf;Sachsen-Anhalt;06789;Germany
10 |
11 | public readonly string? Group; // Group is "item1" in the example
12 |
13 | public readonly string Key; // Key is "ADR" in the example
14 |
15 | // ;TYPE=HOME,WORK;PREF=1
16 | public readonly ParameterSection Parameters;
17 |
18 | // Value: ;;Waldstr. 54;Kleinknuffelsdorf;Sachsen-Anhalt;06789;Germany
19 | public readonly ReadOnlyMemory Value;
20 |
21 | //public readonly VcfDeserializationInfo Info;
22 | }
23 |
--------------------------------------------------------------------------------
/docs/reference/toc/IDAIAFA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards. Models Namespaces Folker Kinzel. VCards. Models Property ID Properties App ID
--------------------------------------------------------------------------------
/docs/reference/toc/IDAADA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards. Extensions Adr Extension Methods Is Set Set Unset
--------------------------------------------------------------------------------
/docs/reference/toc/IDACDA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards. Extensions Impp Extension Methods Is Set Set Unset
--------------------------------------------------------------------------------
/docs/reference/toc/IDADDA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards. Extensions PCl Extension Methods Is Set Set Unset
--------------------------------------------------------------------------------
/docs/reference/toc/IDAEDA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards. Extensions Rel Extension Methods Is Set Set Unset
--------------------------------------------------------------------------------
/docs/reference/toc/IDAFDA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards. Extensions Tel Extension Methods Is Set Set Unset
--------------------------------------------------------------------------------
/docs/reference/toc/IDALBA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards. Builder Parts Profile Builder Methods Clear Edit Set
--------------------------------------------------------------------------------
/docs/reference/toc/IDBEAFA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards. Models Namespaces Folker Kinzel. VCards. Models Gender Methods Create To String
--------------------------------------------------------------------------------
/src/FolkerKinzel.VCards.Tests/Models/Properties/TextPropertyTests.cs:
--------------------------------------------------------------------------------
1 | using FolkerKinzel.VCards.Tests;
2 |
3 | namespace FolkerKinzel.VCards.Models.Properties.Tests;
4 |
5 | [TestClass()]
6 | public class TextPropertyTests
7 | {
8 | [TestMethod]
9 | public void IEnumerableTest()
10 | {
11 | var tProp = new TextProperty("Good value");
12 |
13 | TextProperty value = tProp.AsWeakEnumerable().Cast().First();
14 |
15 | Assert.AreSame(tProp, value);
16 |
17 | }
18 |
19 | [TestMethod]
20 | public void IEnumerableTTest()
21 | {
22 | var tProp = new TextProperty("Good value");
23 |
24 | TextProperty value = tProp.First();
25 |
26 | Assert.AreSame(tProp, value);
27 |
28 | }
29 |
30 | [TestMethod]
31 | public void ToStringTest1() => Assert.IsNotNull(new TextProperty(null).ToString());
32 | }
--------------------------------------------------------------------------------
/docs/reference/toc/IDKAA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards Vcf Reader Constructor
--------------------------------------------------------------------------------
/docs/reference/toc/IDAGDA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards. Extensions Vcf Opts Extension Methods Is Set Set Unset
--------------------------------------------------------------------------------
/docs/reference/toc/IDBAEAA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards Name Builder Methods Add Given Add Given( IEnumerable<String>) Add Given( String)
--------------------------------------------------------------------------------
/docs/reference/toc/IDNAAAA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards Address Builder Methods Add Room Add Room( IEnumerable<String>) Add Room( String)
--------------------------------------------------------------------------------
/src/FolkerKinzel.VCards.Reference.en/Content/VersionHistory/v1.0.0.0.aml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Version [TODO: Version] was released on [TODO: Date].
6 |
7 |
8 |
9 |
10 | Changes in This Release
11 |
12 |
13 |
14 |
15 | [TODO: Add change items here]
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/docs/reference/toc/IDABAFA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards. Models Namespaces Folker Kinzel. VCards. Models App ID Properties Global ID Local ID
--------------------------------------------------------------------------------
/docs/reference/toc/IDBAAAA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards Address Builder Methods Add Block Add Block( IEnumerable<String>) Add Block( String)
--------------------------------------------------------------------------------
/docs/reference/toc/IDBAJAA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards Vcf Methods Deserialize Deserialize( Func<Stream>, Ansi Filter) Deserialize( Stream, Encoding, Boolean)
--------------------------------------------------------------------------------
/docs/reference/toc/IDCAAFA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards. Models Namespaces Folker Kinzel. VCards. Models Address Operators Equality Operator Inequality Operator
--------------------------------------------------------------------------------
/docs/reference/toc/IDCGAFA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards. Models Namespaces Folker Kinzel. VCards. Models Name Operators Equality Operator Inequality Operator
--------------------------------------------------------------------------------
/docs/reference/toc/IDDAEAA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards Name Builder Methods Add Prefix Add Prefix( IEnumerable<String>) Add Prefix( String)
--------------------------------------------------------------------------------
/docs/reference/toc/IDEAEAA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards Name Builder Methods Add Suffix Add Suffix( IEnumerable<String>) Add Suffix( String)
--------------------------------------------------------------------------------
/docs/reference/toc/IDHAAAA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards Address Builder Methods Add Floor Add Floor( IEnumerable<String>) Add Floor( String)
--------------------------------------------------------------------------------
/docs/reference/toc/IDKAAAA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards Address Builder Methods Add POBox Add POBox( IEnumerable<String>) Add POBox( String)
--------------------------------------------------------------------------------
/docs/reference/toc/IDALAFA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards. Models Namespaces Folker Kinzel. VCards. Models Time Zone ID Properties Is Empty Value
--------------------------------------------------------------------------------
/docs/reference/toc/IDCKAFA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards. Models Namespaces Folker Kinzel. VCards. Models Relation Operators Equality Operator Inequality Operator
--------------------------------------------------------------------------------
/docs/reference/toc/IDDAAAA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards Address Builder Methods Add Country Add Country( IEnumerable<String>) Add Country( String)
--------------------------------------------------------------------------------
/docs/reference/toc/IDFAEAA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards Name Builder Methods Add Surname Add Surname( IEnumerable<String>) Add Surname( String)
--------------------------------------------------------------------------------
/docs/reference/toc/IDMAAAA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards Address Builder Methods Add Region Add Region( IEnumerable<String>) Add Region( String)
--------------------------------------------------------------------------------
/docs/reference/toc/IDOAAAA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards Address Builder Methods Add Street Add Street( IEnumerable<String>) Add Street( String)
--------------------------------------------------------------------------------
/docs/reference/toc/IDAAAAA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards Address Builder Methods Add Apartment Add Apartment( IEnumerable<String>) Add Apartment( String)
--------------------------------------------------------------------------------
/docs/reference/toc/IDAAEAA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards Name Builder Methods Add Generation Add Generation( IEnumerable<String>) Add Generation( String)
--------------------------------------------------------------------------------
/docs/reference/toc/IDCAAAA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards Address Builder Methods Add Building Add Building( IEnumerable<String>) Add Building( String)
--------------------------------------------------------------------------------
/docs/reference/toc/IDCIAFA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards. Models Namespaces Folker Kinzel. VCards. Models Property ID Operators Equality Operator Inequality Operator
--------------------------------------------------------------------------------
/docs/reference/toc/IDDCAFA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards. Models Namespaces Folker Kinzel. VCards. Models Contact ID Operators Equality Operator Inequality Operator
--------------------------------------------------------------------------------
/docs/reference/toc/IDEAAAA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards Address Builder Methods Add Direction Add Direction( IEnumerable<String>) Add Direction( String)
--------------------------------------------------------------------------------
/docs/reference/toc/IDFAAAA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards Address Builder Methods Add District Add District( IEnumerable<String>) Add District( String)
--------------------------------------------------------------------------------
/docs/reference/toc/IDGAAAA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards Address Builder Methods Add Extended Add Extended( IEnumerable<String>) Add Extended( String)
--------------------------------------------------------------------------------
/docs/reference/toc/IDIAAAA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards Address Builder Methods Add Landmark Add Landmark( IEnumerable<String>) Add Landmark( String)
--------------------------------------------------------------------------------
/docs/reference/toc/IDJAAAA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards Address Builder Methods Add Locality Add Locality( IEnumerable<String>) Add Locality( String)
--------------------------------------------------------------------------------
/docs/reference/toc/IDDFAFA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards. Models Namespaces Folker Kinzel. VCards. Models Geo Coordinate Operators Equality Operator Inequality Operator
--------------------------------------------------------------------------------
/src/FolkerKinzel.VCards.Tests/Intls/Converters/RelationTypesConverterTests.cs:
--------------------------------------------------------------------------------
1 | using FolkerKinzel.VCards.Enums;
2 |
3 | namespace FolkerKinzel.VCards.Intls.Converters.Tests;
4 |
5 | [TestClass]
6 | public class RelationTypesConverterTests
7 | {
8 | [TestMethod]
9 | public void ParseTest1()
10 | {
11 | foreach (Rel rel in (Rel[])Enum.GetValues(typeof(Rel)))
12 | {
13 | Rel? rel2 = RelConverter.Parse(RelConverter.ToVcfString(rel).AsSpan());
14 | Assert.AreEqual(rel, rel2);
15 | }
16 |
17 | Assert.IsNull(RelConverter.Parse("NICHT_VORHANDEN".AsSpan()));
18 | }
19 |
20 | [TestMethod]
21 | public void ParseTest2() => Assert.IsNull(RelConverter.Parse(null));
22 |
23 | [TestMethod]
24 | [ExpectedException(typeof(ArgumentOutOfRangeException))]
25 | public void ToVcfStringTest() => _ = RelConverter.ToVcfString((Rel)4711);
26 | }
27 |
--------------------------------------------------------------------------------
/docs/reference/toc/IDCAEAA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards Name Builder Methods Add Given 2 Add Given 2( IEnumerable<String>) Add Given 2( String)
--------------------------------------------------------------------------------
/src/FolkerKinzel.VCards/Enums/Gram.cs:
--------------------------------------------------------------------------------
1 | namespace FolkerKinzel.VCards.Enums;
2 |
3 | ///
4 | /// Named constants to define which grammatical gender to use in salutations and other grammatical constructs. (4 - RFC 9554)
5 | ///
6 | public enum Gram
7 | {
8 | // CAUTION: If the enum is expanded, GramConverter must be updated
9 |
10 | /// animate Animate (4 - RFC 9554)
11 | Animate,
12 |
13 | /// common Common (4 - RFC 9554)
14 | Common,
15 |
16 | /// feminine Feminine (4 - RFC 9554)
17 | Feminine,
18 |
19 | /// inanimate Inanimate (4 - RFC 9554)
20 | Inanimate,
21 |
22 | /// masculine Masculine (4 - RFC 9554)
23 | Masculine,
24 |
25 | /// neuter Neuter (4 - RFC 9554)
26 | Neuter
27 | }
28 |
--------------------------------------------------------------------------------
/docs/reference/toc/IDGAEAA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards Name Builder Methods Add Surname 2 Add Surname 2( IEnumerable<String>) Add Surname 2( String)
--------------------------------------------------------------------------------
/src/FolkerKinzel.VCards.Tests/Intls/Converters/PhoneticConverterTests.cs:
--------------------------------------------------------------------------------
1 | using FolkerKinzel.VCards.Enums;
2 |
3 | namespace FolkerKinzel.VCards.Intls.Converters.Tests;
4 |
5 | [TestClass]
6 | public class PhoneticConverterTests
7 | {
8 | [TestMethod]
9 | public void Roundtrip()
10 | {
11 | foreach (Phonetic p in (Phonetic[])Enum.GetValues(typeof(Phonetic)))
12 | {
13 | Phonetic? p2 = PhoneticConverter.Parse(p.ToString().AsSpan());
14 | Assert.AreEqual(p, p2);
15 | object p3 = Enum.Parse(typeof(Phonetic), ((Phonetic?)p).ToVcfString() ?? "", true);
16 | Assert.AreEqual(p, p3);
17 | }
18 |
19 | // Test auf nicht definiert
20 | Assert.AreEqual(null, ((Phonetic?)4711).ToVcfString());
21 | }
22 |
23 | [TestMethod]
24 | public void ParseTest() => Assert.IsNull(PhoneticConverter.Parse("nichtvorhanden".AsSpan()));
25 | }
26 |
--------------------------------------------------------------------------------
/src/BenchmarksCurrentVersion/AnsiFilterBench2.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using BenchmarkDotNet.Attributes;
7 | using FolkerKinzel.VCards;
8 |
9 | namespace Benchmarks;
10 |
11 | [MemoryDiagnoser]
12 | public class AnsiFilterBench2
13 | {
14 | private const string FILE_PATH = @"C:\Users\fkinz\source\repos\FolkerKinzel.VCards\src\Benchmarks\TestFiles\German.vcf";
15 |
16 | [Benchmark(Baseline = true)]
17 | public string AnsiFilterNew1()
18 | {
19 | var filter = new AnsiFilterNew();
20 | _ = filter.LoadVcf(FILE_PATH, out string enc);
21 | return enc;
22 | }
23 |
24 | [Benchmark]
25 | public string AnsiFilter1()
26 | {
27 | var filter = new AnsiFilter();
28 | _ = filter.LoadVcf(FILE_PATH, out string enc);
29 | return enc;
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/docs/reference/toc/IDCAABFA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards. Models Namespaces Folker Kinzel. VCards. Models. Properties Namespaces Folker Kinzel. VCards. Models. Properties Access Property Methods Clone
--------------------------------------------------------------------------------
/docs/reference/toc/IDCJABFA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards. Models Namespaces Folker Kinzel. VCards. Models. Properties Namespaces Folker Kinzel. VCards. Models. Properties Kind Property Methods Clone
--------------------------------------------------------------------------------
/docs/reference/toc/IDCNABFA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards. Models Namespaces Folker Kinzel. VCards. Models. Properties Namespaces Folker Kinzel. VCards. Models. Properties Profile Property Methods Clone
--------------------------------------------------------------------------------
/docs/reference/toc/IDLAAAA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards Address Builder Methods Add Postal Code Add Postal Code( IEnumerable<String>) Add Postal Code( String)
--------------------------------------------------------------------------------
/docs/reference/toc/IDPAAAA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards Address Builder Methods Add Street Name Add Street Name( IEnumerable<String>) Add Street Name( String)
--------------------------------------------------------------------------------
/src/FolkerKinzel.VCards.Tests/Intls/Converters/GramConverterTests.cs:
--------------------------------------------------------------------------------
1 | using FolkerKinzel.VCards.Enums;
2 |
3 | namespace FolkerKinzel.VCards.Intls.Converters.Tests;
4 |
5 | [TestClass]
6 | public class GramConverterTests
7 | {
8 | [TestMethod]
9 | public void Roundtrip()
10 | {
11 | foreach (Gram gram in (Gram[])Enum.GetValues(typeof(Gram)))
12 | {
13 | Assert.IsTrue(GramConverter.TryParse(gram.ToString().AsSpan(), out Gram gram2));
14 | Assert.AreEqual(gram, gram2);
15 | object gram3 = Enum.Parse(typeof(Gram), ((Gram)gram).ToVcfString() ?? "", true);
16 | Assert.AreEqual(gram, gram3);
17 | }
18 |
19 | // Test auf nicht definiert
20 | Assert.AreEqual(null, ((Gram)4711).ToVcfString());
21 | }
22 |
23 | [TestMethod]
24 | public void ParseTest() => Assert.IsFalse(GramConverter.TryParse("nichtvorhanden".AsSpan(), out _));
25 | }
--------------------------------------------------------------------------------
/src/FolkerKinzel.VCards.Tests/TestFiles/v3.vcf:
--------------------------------------------------------------------------------
1 | BEGIN:VCARD
2 | VERSION:3.0
3 | SOURCE;VALUE=URI;CONTEXT=VCARD:http://folker.de/vcard.vcf
4 | FN:Folker Kinzel
5 | N:Kinzel;Folker;;;
6 | item1.EMAIL;TYPE=INTERNET:email1@wumms.de
7 | item1.X-ABLabel:
8 | item2.EMAIL;TYPE=INTERNET:email2@folker-kinzel.de
9 | item2.X-ABLabel:
10 | item3.TEL:0123-45678
11 | item3.X-ABLabel:
12 | item4.ADR:;;Berliner Str. 85;Halle;;06789;DE
13 | item4.X-ABLabel:
14 | BDAY:19780311
15 | item5.URL:www.folker-kinzel.de
16 | item5.X-ABLabel:
17 | PHOTO:https://lh3.googleusercontent.com/-qA19KAIW4ig/XPRQfJuWDoI/AAAAAAAAAA
18 | A/n3yseZjiGHcH1S5pjm8TULwkceJJtHykQCOQCEAE/photo.jpg
19 | END:VCARD
20 | BEGIN:VCARD
21 | VERSION:3.0
22 | FN:KMS Außenstelle
23 | N:KMS;WSF;;;
24 | EMAIL;TYPE=INTERNET: blablö@blub.com
25 | TEL;TYPE=HOME:01234-303776
26 | item1.TEL:03443-333440
27 | item1.X-ABLabel:homeFax
28 | item2.ORG:KMS Außenstelle
29 | item2.X-ABLabel:
30 | END:VCARD
31 |
--------------------------------------------------------------------------------
/src/FolkerKinzel.VCards/Formatters/IAddressFormatter.cs:
--------------------------------------------------------------------------------
1 | using FolkerKinzel.VCards.Models.Properties;
2 |
3 | namespace FolkerKinzel.VCards.Formatters;
4 |
5 | ///
6 | /// Interface that allows implementing classes to convert instances
7 | /// to s, which represent corresponding address labels.
8 | ///
9 | public interface IAddressFormatter
10 | {
11 | ///
12 | /// Converts an instance to an address label.
13 | ///
14 | /// The to convert.
15 | /// A that represents an address label, or null .
16 | /// is null .
17 | string? ToLabel(AddressProperty addressProperty);
18 | }
19 |
20 |
21 |
--------------------------------------------------------------------------------
/src/FolkerKinzel.VCards/NameFormatter.cs:
--------------------------------------------------------------------------------
1 | using FolkerKinzel.VCards.Formatters;
2 | using FolkerKinzel.VCards.Intls.Formatters;
3 |
4 | namespace FolkerKinzel.VCards;
5 |
6 | ///
7 | /// Static class that provides implementations.
8 | ///
9 | ///
10 | /// Since this is a partial class, it can be extended with custom implementations of
11 | /// .
12 | ///
13 | ///
14 | ///
15 | ///
16 | public static partial class NameFormatter
17 | {
18 | ///
19 | /// The default implementation.
20 | ///
21 | ///
22 | ///
23 | ///
24 | public static INameFormatter Default { get; } = new DefaultNameFormatter();
25 | }
26 |
--------------------------------------------------------------------------------
/docs/reference/toc/IDCDABFA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards. Models Namespaces Folker Kinzel. VCards. Models. Properties Namespaces Folker Kinzel. VCards. Models. Properties Contact IDProperty Methods Clone
--------------------------------------------------------------------------------
/docs/reference/toc/IDQAAAA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards Address Builder Methods Add Street Number Add Street Number( IEnumerable<String>) Add Street Number( String)
--------------------------------------------------------------------------------
/docs/reference/toc/IDRAAAA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards Address Builder Methods Add Sub District Add Sub District( IEnumerable<String>) Add Sub District( String)
--------------------------------------------------------------------------------
/src/FolkerKinzel.VCards.Tests/Intls/Converters/AccessConverterTests.cs:
--------------------------------------------------------------------------------
1 | using FolkerKinzel.VCards.Enums;
2 |
3 | namespace FolkerKinzel.VCards.Intls.Converters.Tests;
4 |
5 | [TestClass]
6 | public class AccessConverterTests
7 | {
8 | [TestMethod]
9 | public void Roundtrip()
10 | {
11 | foreach (Access kind in (Access[])Enum.GetValues(typeof(Access)))
12 | {
13 | Assert.IsTrue(AccessConverter.TryParse(kind.ToString().AsSpan(), out Access kind2));
14 | Assert.AreEqual(kind, kind2);
15 | object kind3 = Enum.Parse(typeof(Access), kind.ToVCardString(), true);
16 | Assert.AreEqual(kind, kind3);
17 | }
18 |
19 | // Test auf null
20 | Assert.IsFalse(AccessConverter.TryParse(null, out _));
21 |
22 | // Test auf nicht definiert
23 | Assert.AreEqual(Access.Public.ToVCardString(), ((Access)4711).ToVCardString());
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/src/BenchmarksCurrentVersion/AnsiFilterBench.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using BenchmarkDotNet.Attributes;
7 | using FolkerKinzel.VCards;
8 |
9 | namespace Benchmarks;
10 |
11 | [MemoryDiagnoser]
12 | public class AnsiFilterBench
13 | {
14 | private const string FILE_PATH = "C:\\Users\\fkinz\\source\\repos\\FolkerKinzel.VCards\\src\\Benchmarks\\TestFiles\\Ukrainian.vcf";
15 |
16 | [Benchmark(Baseline = true)]
17 | public string AnsiFilterNew1()
18 | {
19 | var filter = new AnsiFilterNew();
20 | _ = filter.LoadVcf(FILE_PATH, out string enc);
21 | return enc;
22 | }
23 |
24 | [Benchmark]
25 | public string MultiAnsiFilter1()
26 | {
27 | var filter = new MultiAnsiFilter();
28 | _ = filter.LoadVcf(FILE_PATH, out string enc);
29 | return enc;
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/src/FolkerKinzel.VCards/AddressFormatter.cs:
--------------------------------------------------------------------------------
1 | using FolkerKinzel.VCards.Formatters;
2 | using FolkerKinzel.VCards.Intls.Formatters;
3 |
4 | namespace FolkerKinzel.VCards;
5 |
6 | ///
7 | /// Static class that provides implementations.
8 | ///
9 | ///
10 | /// Since this is a partial class, it can be extended with custom implementations of
11 | /// .
12 | ///
13 | ///
14 | ///
15 | ///
16 | public static partial class AddressFormatter
17 | {
18 | ///
19 | /// The default implementation.
20 | ///
21 | ///
22 | ///
23 | ///
24 | public static IAddressFormatter Default { get; } = new DefaultAddressFormatter();
25 | }
--------------------------------------------------------------------------------
/src/FolkerKinzel.VCards/Enums/PCl.cs:
--------------------------------------------------------------------------------
1 | using FolkerKinzel.VCards.Extensions;
2 |
3 | namespace FolkerKinzel.VCards.Enums;
4 |
5 | /// Named constants to classify the scope of a vCard property. The constants
6 | /// can be combined.
7 | ///
8 | ///
9 | /// When working with the enum use the extension methods from the class.
11 | ///
12 | ///
13 | [Flags]
14 | public enum PCl
15 | {
16 | // CAUTION: If the enum is expanded,
17 | // ParameterSection.ParseTypeParameter(string, string) and
18 | // EnumValueCollector must be adjusted!
19 |
20 | /// HOME : Implies that the property is related to an individual's
21 | /// personal life.
22 | Home = 1,
23 |
24 | /// WORK : Implies that the property is related to an individual's
25 | /// work place.
26 | Work = 2
27 | }
28 |
--------------------------------------------------------------------------------
/src/FolkerKinzel.VCards.Tests/Intls/Converters/KindConverterTests.cs:
--------------------------------------------------------------------------------
1 | using FolkerKinzel.VCards.Enums;
2 |
3 | namespace FolkerKinzel.VCards.Intls.Converters.Tests;
4 |
5 | [TestClass]
6 | public class KindConverterTests
7 | {
8 | [TestMethod()]
9 | public void Roundtrip()
10 | {
11 | foreach (Kind kind in (Kind[])Enum.GetValues(typeof(Kind)))
12 | {
13 | Assert.IsTrue(KindConverter.TryParse(kind.ToString().AsSpan(), out Kind kind2));
14 | Assert.AreEqual(kind, kind2);
15 |
16 | object kind3 = Enum.Parse(typeof(Kind), kind.ToVcfString(), true);
17 | Assert.AreEqual(kind, kind3);
18 | }
19 |
20 | // Test auf nicht definiert
21 | Assert.AreEqual(Kind.Individual.ToVcfString(), ((Kind)4711).ToVcfString());
22 | }
23 |
24 |
25 | [TestMethod]
26 | public void TryParseTest1() => Assert.IsFalse(KindConverter.TryParse("blabla".AsSpan(), out _));
27 | }
28 |
--------------------------------------------------------------------------------
/docs/reference/toc/IDABGAFA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards. Models Namespaces Folker Kinzel. VCards. Models Name Methods Equals Equals( Name) Equals( Object)
--------------------------------------------------------------------------------
/src/FolkerKinzel.VCards.Reference.en/Namespaces.cs:
--------------------------------------------------------------------------------
1 | // Publish this namespace - it contains commonly used classes such as
2 | // the VCard class, the VCardBuilder class, the NameBuilder class, and the
3 | // AddressBuilder class:
4 | using FolkerKinzel.VCards;
5 |
6 | // It's recommended to publish this namespace too -
7 | // it contains useful extension methods:
8 | using FolkerKinzel.VCards.Extensions;
9 |
10 | // This namespace contains often used enums. Decide
11 | // yourself whether to publish this namespace or to use
12 | // a namespace alias.
13 | using FolkerKinzel.VCards.Enums;
14 |
15 | // This namespace contains the model classes such as GeoCoordinate or
16 | // TimeZoneID:
17 | using FolkerKinzel.VCards.Models;
18 |
19 | // Contains the implementations of VCardProperty. If you use VCardBuilder to
20 | // create and manipulate VCard objects, you usually do not need to publish this
21 | // namespace.
22 | //using FolkerKinzel.VCards.Models.Properties;
23 |
24 |
--------------------------------------------------------------------------------
/docs/reference/toc/IDABAAFA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards. Models Namespaces Folker Kinzel. VCards. Models Address Methods Equals Equals( Address) Equals( Object)
--------------------------------------------------------------------------------
/docs/reference/toc/IDCBKAFA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards. Models Namespaces Folker Kinzel. VCards. Models Relation Methods Equals Equals( Object) Equals( Relation)
--------------------------------------------------------------------------------
/src/FolkerKinzel.VCards.Reference.en/Content/Namespaces.cs:
--------------------------------------------------------------------------------
1 | // Publish this namespace - it contains commonly used classes such as
2 | // the VCard class, the VCardBuilder class, the NameBuilder class, and the
3 | // AddressBuilder class:
4 | using FolkerKinzel.VCards;
5 |
6 | // It's recommended to publish this namespace too -
7 | // it contains useful extension methods:
8 | using FolkerKinzel.VCards.Extensions;
9 |
10 | // This namespace contains often used enums. Decide
11 | // yourself whether to publish this namespace or to use
12 | // a namespace alias:
13 | using FolkerKinzel.VCards.Enums;
14 |
15 | // This namespace contains the model classes such as GeoCoordinate or
16 | // TimeZoneID:
17 | using FolkerKinzel.VCards.Models;
18 |
19 | // Contains the implementations of VCardProperty. If you use VCardBuilder to
20 | // create and manipulate VCard objects, you usually do not need to publish this
21 | // namespace:
22 | //using FolkerKinzel.VCards.Models.Properties;
23 |
24 |
--------------------------------------------------------------------------------
/src/FolkerKinzel.VCards.Tests/Models/Properties/VCardPropertyTests.cs:
--------------------------------------------------------------------------------
1 | using FolkerKinzel.VCards.Intls.Serializers;
2 | using FolkerKinzel.VCards.Models.Properties.Parameters;
3 |
4 | namespace FolkerKinzel.VCards.Models.Properties.Tests;
5 |
6 | [TestClass]
7 | public class VCardPropertyTests
8 | {
9 | private class ArgumentNullTester(ParameterSection parameters) : VCardProperty(parameters, null)
10 | {
11 | public override bool IsEmpty => throw new NotImplementedException();
12 |
13 | public override object Clone() => throw new NotImplementedException();
14 |
15 | protected override object GetVCardPropertyValue() => throw new NotImplementedException();
16 |
17 | internal override void AppendValue(VcfSerializer serializer) => throw new NotImplementedException();
18 | }
19 |
20 | [TestMethod]
21 | [ExpectedException(typeof(ArgumentNullException))]
22 | public void CtorTest1() => _ = new ArgumentNullTester(null!);
23 | }
24 |
--------------------------------------------------------------------------------
/docs/reference/toc/IDMABDA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards. Extensions IEnumerable Extension Methods Remove Remove<TSource>( IEnumerable<TSource>, TSource) Remove<TSource>( IEnumerable<TSource>, Func<TSource, Boolean>)
--------------------------------------------------------------------------------
/docs/reference/toc/IDBAHBA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards. Builder Parts Kind Builder Methods Edit Edit( Func<Kind Property, Kind Property>) Edit<TArg>( Func<Kind Property, TArg, Kind Property>, TArg)
--------------------------------------------------------------------------------
/docs/reference/toc/IDCCCAFA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards. Models Namespaces Folker Kinzel. VCards. Models Contact ID Methods Equals Equals( Contact ID) Equals( Object)
--------------------------------------------------------------------------------
/src/Examples/Examples.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | Exe
4 | net9.0
5 | enable
6 | enable
7 | true
8 | 1.0.0.124
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/src/Examples/NoPidExample.cs:
--------------------------------------------------------------------------------
1 | using FolkerKinzel.VCards;
2 | using FolkerKinzel.VCards.Enums;
3 |
4 | namespace Examples;
5 |
6 | public static class NoPidExample
7 | {
8 | public static void RemovePropertyIdentification()
9 | {
10 | const string vcf = """
11 | BEGIN:VCARD
12 | VERSION:4.0
13 | REV:20231121T200704Z
14 | UID:urn:uuid:5ad11c78-f4b1-4e70-b0ef-6f4c29cf97ea
15 | FN;PID=1.1:John Doe
16 | CLIENTPIDMAP:1;http://other.com/
17 | END:VCARD
18 | """;
19 |
20 | VCard vCard = Vcf.Parse(vcf)[0];
21 |
22 | // Removes all existing PIDs and CLIENTPIDMAPs
23 | vCard.Sync.Reset();
24 |
25 | Console.WriteLine(Vcf.AsString(vCard, VCdVersion.V4_0));
26 | }
27 | }
28 |
29 | /*
30 | Console Output:
31 |
32 | BEGIN:VCARD
33 | VERSION:4.0
34 | REV:20231121T201552Z
35 | UID:urn:uuid:5ad11c78-f4b1-4e70-b0ef-6f4c29cf97ea
36 | FN:John Doe
37 | END:VCARD
38 | */
--------------------------------------------------------------------------------
/docs/reference/toc/IDABIAFA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards. Models Namespaces Folker Kinzel. VCards. Models Property ID Methods Equals Equals( Object) Equals( Property ID)
--------------------------------------------------------------------------------
/docs/reference/toc/IDBAABA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards. Builder Parts Access Builder Methods Edit Edit( Func<Access Property, Access Property>) Edit<TArg>( Func<Access Property, TArg, Access Property>, TArg)
--------------------------------------------------------------------------------
/docs/reference/toc/IDBHAFA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards. Models Namespaces Folker Kinzel. VCards. Models Organization Properties Is Empty Name Units
--------------------------------------------------------------------------------
/docs/reference/toc/IDBAQBA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards. Builder Parts Text Singleton Builder Methods Edit Edit( Func<Text Property, Text Property>) Edit<TArg>( Func<Text Property, TArg, Text Property>, TArg)
--------------------------------------------------------------------------------
/docs/reference/toc/IDBCFAFA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards. Models Namespaces Folker Kinzel. VCards. Models Geo Coordinate Methods Equals Equals( Geo Coordinate) Equals( Object)
--------------------------------------------------------------------------------
/docs/reference/toc/IDBACBA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards. Builder Parts Contact IDBuilder Methods Edit Edit( Func<Contact IDProperty, Contact IDProperty>) Edit<TArg>( Func<Contact IDProperty, TArg, Contact IDProperty>, TArg)
--------------------------------------------------------------------------------
/docs/reference/toc/IDAAEBA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards. Builder Parts Gender Builder Methods Add Add( Gender, Action<Parameter Section>, Func<VCard, String>) Add( Nullable<Sex>, String, Action<Parameter Section>, Func<VCard, String>)
--------------------------------------------------------------------------------
/docs/reference/toc/IDBBFA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards. Models Namespaces Folker Kinzel. VCards. Models. Properties Namespaces Folker Kinzel. VCards. Models. Properties. Parameters
--------------------------------------------------------------------------------
/docs/reference/toc/IDCASBA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards. Builder Parts Time Stamp Builder Methods Set Set( Action<Parameter Section>, Func<VCard, String>) Set( Date Time Offset, Action<Parameter Section>, Func<VCard, String>)
--------------------------------------------------------------------------------
/src/FolkerKinzel.VCards/Enums/Kind.cs:
--------------------------------------------------------------------------------
1 | namespace FolkerKinzel.VCards.Enums;
2 |
3 | /// Named Constants to specify the type of object the vCard represents.
4 | public enum Kind
5 | {
6 | /// INDIVIDUAL : The vCard represents a single person or entity.
7 | /// (Default) 4
8 | Individual,
9 |
10 | /// GROUP : The vCard represents a group of persons or entities.
11 | /// 4
12 | Group,
13 |
14 | /// ORGANIZATION : The vCard represents an organization. 4
15 | Organization,
16 |
17 | /// LOCATION : The vCard represents a named geographical place.
18 | /// 4
19 | Location,
20 |
21 | /// APPLICATION : The vCard represents a software application such
22 | /// as a server, an online service (e.g., a chat room), or an automated software
23 | /// bot. (4 - RFC 6473)
24 | Application
25 | }
26 |
--------------------------------------------------------------------------------
/docs/reference/toc/IDAATBA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards. Builder Parts Time Zone Builder Methods Add Add( String, Action<Parameter Section>, Func<VCard, String>) Add( Time Zone ID, Action<Parameter Section>, Func<VCard, String>)
--------------------------------------------------------------------------------
/docs/reference/toc/IDDCDAFA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards. Models Namespaces Folker Kinzel. VCards. Models Date And Or Time Methods Equals Equals( Date And Or Time) Equals( Object)
--------------------------------------------------------------------------------
/src/FolkerKinzel.VCards/Formatters/ICompoundModel.cs:
--------------------------------------------------------------------------------
1 | using FolkerKinzel.VCards.Models;
2 |
3 | namespace FolkerKinzel.VCards.Formatters;
4 |
5 | ///
6 | /// Interface implemented by model classes containing a compound value.
7 | ///
8 | ///
9 | ///
10 | public interface ICompoundModel
11 | {
12 | ///
13 | /// Gets the element at the specified .
14 | ///
15 | /// The zero-based index of the element to get.
16 | /// The element at the specified .
17 | /// is less
18 | /// than zero, or equal or greater than
19 | IReadOnlyList this[int index] { get; }
20 |
21 | ///
22 | /// Gets the number of elements in the .
23 | ///
24 | int Count { get; }
25 | }
26 |
--------------------------------------------------------------------------------
/src/FolkerKinzel.VCards/Intls/Converters/EncConverter.cs:
--------------------------------------------------------------------------------
1 | using FolkerKinzel.VCards.Enums;
2 |
3 | namespace FolkerKinzel.VCards.Intls.Converters;
4 |
5 | internal static class EncConverter
6 | {
7 | internal static Enc? Parse(string? val)
8 | {
9 | if (val is null)
10 | {
11 | return null;
12 | }
13 |
14 | for (int i = 0; i < val.Length; i++) // ersetzt Trim
15 | {
16 | char c = val[i];
17 |
18 | if (char.IsLetterOrDigit(c))
19 | {
20 | return char.ToUpperInvariant(c) switch
21 | {
22 | 'B' => Enc.Base64,
23 | 'Q' => Enc.QuotedPrintable,
24 | '8' => Enc.Ansi,
25 |
26 | // Ascii is the standard in vCard 2.1 und has no symbol
27 | // '7' => VCdEncoding.Ascii,
28 | _ => (Enc?)null,
29 | };
30 | }
31 | }
32 |
33 | return null;
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/docs/reference/toc/IDAAOBA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards. Builder Parts String Collection Builder Methods Add Add( IEnumerable<String>, Action<Parameter Section>, Func<VCard, String>) Add( String, Action<Parameter Section>, Func<VCard, String>)
--------------------------------------------------------------------------------
/docs/reference/toc/IDAAFBA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards. Builder Parts Geo Builder Methods Add Add( Geo Coordinate, Action<Parameter Section>, Func<VCard, String>) Add( Double, Double, Nullable<Single>, Action<Parameter Section>, Func<VCard, String>)
--------------------------------------------------------------------------------
/src/FolkerKinzel.VCards.Tests/WhatsAppIssueTests.cs:
--------------------------------------------------------------------------------
1 | using FolkerKinzel.VCards.Models.Properties;
2 |
3 | namespace FolkerKinzel.VCards.Tests;
4 |
5 | [TestClass]
6 | public class WhatsAppIssueTests
7 | {
8 | [TestMethod]
9 | public void WhatsAppIssueTest1()
10 | {
11 | VCard.SyncTestReset();
12 | VCard.RegisterApp(null);
13 |
14 | IReadOnlyList list = Vcf.Load(TestFiles.WhatsAppIssueVcf);
15 | Assert.AreNotEqual(0, list.Count);
16 |
17 | IEnumerable? phoneNumbers = list[0].Phones;
18 | Assert.IsNotNull(phoneNumbers);
19 |
20 | TextProperty? whatsAppNumber = phoneNumbers.ElementAtOrDefault(1);
21 | Assert.IsNotNull(whatsAppNumber);
22 |
23 | KeyValuePair? parameter = whatsAppNumber.Parameters.NonStandard?.FirstOrDefault();
24 |
25 | Assert.IsTrue(parameter.HasValue);
26 | Assert.AreEqual("TYPE", parameter.Value.Key);
27 | Assert.AreEqual("WhatsApp", parameter.Value.Value);
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/docs/reference/toc/IDBASBA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards. Builder Parts Time Stamp Builder Methods Edit Edit( Func<Time Stamp Property, Time Stamp Property>) Edit<TArg>( Func<Time Stamp Property, TArg, Time Stamp Property>, TArg)
--------------------------------------------------------------------------------
/docs/reference/toc/IDKABDA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards. Extensions IEnumerable Extension Methods Pref Or Null Pref Or Null<TSource>( IEnumerable<TSource>, Boolean) Pref Or Null<TSource>( IEnumerable<TSource>, Func<TSource, Boolean>, Boolean)
--------------------------------------------------------------------------------
/docs/reference/toc/IDBEABFA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards. Models Namespaces Folker Kinzel. VCards. Models. Properties Namespaces Folker Kinzel. VCards. Models. Properties Data Property Properties Is Empty Value
--------------------------------------------------------------------------------
/docs/reference/toc/IDBHABFA.xml:
--------------------------------------------------------------------------------
1 | Docs Folker Kinzel. VCards Namespaces Folker Kinzel. VCards. Models Namespaces Folker Kinzel. VCards. Models. Properties Namespaces Folker Kinzel. VCards. Models. Properties Geo Property Properties Is Empty Value
--------------------------------------------------------------------------------