Table of Contents

Method Bounded

Namespace
MailFathom.Application.EmailContent.Rendering
Assembly
MailFathom.Application.dll

Bounded(string, EmailBodyCharacterAllowance)

Bounds one text to the characters a reader may be handed.

public static EmailBodyRepresentation Bounded(string text, EmailBodyCharacterAllowance allowance)

Parameters

text string

The text as the message wrote it.

allowance EmailBodyCharacterAllowance

How many characters the representation may hold, and which bound to name when it cuts.

Returns

EmailBodyRepresentation

The bounded representation, which records the original length whether or not it had to cut.

Remarks

The cut falls on a text-element boundary, so a body ending in an emoji or a combining sequence cannot be handed over as a lone surrogate that a JSON writer would replace and PostgreSQL would reject.

Exceptions

ArgumentNullException

Thrown when text is null.

ArgumentOutOfRangeException

Thrown when the allowance is negative.