Table of Contents

Class TripletsLino

Namespace
Foundation.Data.Doublets.Cli
Assembly
Foundation.Data.Doublets.Cli.dll

Triplets in Links Notation: one (index: type from to) per line (issue #151).

public static class TripletsLino
Inheritance
TripletsLino
Inherited Members

Remarks

The export lists every triplet in the order of its address, a part by its name when it has one and 0 for an empty from or to. The import reads the same lines back: a numeric index is kept, a named index is the triplet of that name (created when there is none), and a line without an index is a new triplet. Lines may refer to each other in any order, since every triplet is reserved before any of them gets its parts. The Rust counterparts are link_cli::triplets_to_lino and link_cli::import_triplets_lino.

Methods

Export<TLinkAddress>(ITriplets<TLinkAddress>)

Every triplet as a line (index: type from to), in the order of the addresses.

public static string Export<TLinkAddress>(ITriplets<TLinkAddress> triplets) where TLinkAddress : struct, IUnsignedNumber<TLinkAddress>

Parameters

triplets ITriplets<TLinkAddress>

Returns

string

Type Parameters

TLinkAddress

Import<TLinkAddress>(ITriplets<TLinkAddress>, string)

Writes the triplets of text and returns their indices, one per line.

public static IReadOnlyList<TLinkAddress> Import<TLinkAddress>(ITriplets<TLinkAddress> triplets, string text) where TLinkAddress : struct, IUnsignedNumber<TLinkAddress>

Parameters

triplets ITriplets<TLinkAddress>
text string

Returns

IReadOnlyList<TLinkAddress>

Type Parameters

TLinkAddress