VcardPid Struct

Definition

Namespace: DataStandardizer.File.vCard

A value of the PID parameter (RFC 6350 §5.5): a positive integer, or two separated by a dot such as 1.2. Only vCard 4.0 has this parameter.

Syntax

public readonly struct VcardPid : IEquatable<VcardPid>

Remarks

The second integer is the source identifier, which a VcardClientPidMap gives a meaning to. Neither can be zero (RFC 6350 §5.5, §6.7.7). An integer too large for a long is rejected. Leading zeros are accepted, and not written.

Forms. In jCard a parameter value is a JSON string with “the original case of the parameter value” (RFC 7095 §3.4), and in xCard the content of a text element whose pattern is that of the text form (RFC 6351 Appendix A), so the Json and Xml forms are the same as Text.

Allocation. TryParse from a span and TryFormat into one do not allocate (covered by VcardValueAllocationTests).

Uninitialised instance. A default instance throws InvalidOperationException from LocalId and SourceId. TryFormat writes nothing and returns true, ToString() gives the type name, and two default instances are equal.

Constructors

Constructor Notes
VcardPid(long localId), VcardPid(long localId, long sourceId) An identifier that isn’t positive throws ArgumentOutOfRangeException.

Properties

Property Notes
long LocalId The first integer.
long? SourceId The second, or null.

Methods

Method Notes
TryParse, Parse, TryFormat, ToString As for the other values, with no version.

See the API reference.


This site uses Just the Docs, a documentation theme for Jekyll.