Enum SwiftSubfieldFlags
Set of flags the define some characteristics for subfields. These flags control how the Subfield() method extracts a subfield.
[Flags]
public enum SwiftSubfieldFlags
Fields
EndsAtCrLf = 16
If this flag is included, then the subfield extraction stops at the first CRLF sequence (represented by a single linefeed '\n' in the field content) that is encountered. The linefeed character is not included in the string returned by Subfield().
EndsAtDoubleSlash = 8
If this flag is included, then the subfield extraction stops at the first double-slash sequence '//' that is encountered. The double-slash is not included in the string returned by Subfield().
It is not useful to combine this flag with EndsAtSlash.
EndsAtSlash = 4
If this flag is included, then the subfield extraction stops at the first slash '/' character that is encountered. The slash character is not included in the string returned by Subfield(). Of course, extraction also stops at the first slash of a double-slash.
FixedLength = 1
If this flag is included, then the extracted field is required to have exactly the requested length. If it falls short, then a SwiftException will be thrown. If this flag is not included, then the requested length is merely a maximum length and the extracted subfield string can be shorter.
In SWIFT syntax tables a fixed length is indicated by an exclamation mark, e.g. "3!a" defines an alphabetic subfield with a length of exactly three characters.
None = 0
No special treatment.
Optional = 2
If this flag is included, then the subfield is optional. Hence, possibly nothing will be extracted and Subfield() returns
null
. If this is flag is not included, then a SwiftException will be thrown when just an empty subfield could be extracted.In SWIFT syntax tables optional subfields are defined with square brackets, e.g. "[8!a]" defines an optional alphabetic subfield.
Remarks
Multiple flags can be combined using an arithmetic "or" operation. It is also possible to combine the EndsAtSlash, EndsAtDoubleSlash, and EndsAtCrLf flags if a subfield ends with either of those.