FieldedText TypeScript Library
    Preparing search index...

    Class FtNodeFileWriter

    High-level writer for fielded text files that writes directly to the file system. Node.js-specific extension of FtWriter that accepts a file path. Provides a convenient single-class API for Node.js applications.

    Hierarchy

    • FtWriter
      • FtNodeFileWriter
    Index
    • Creates a new FtNodeFileWriter that writes to a file.

      Parameters

      • filePath: PathLike

        The path to the file to write

      • meta: FtMeta

        The metadata defining the file structure

      • encoding: BufferEncoding = 'utf-8'

        The character encoding to use (default: 'utf-8')

      • Optionalsettings: FtWriterSettings

        Optional writer settings

      Returns FtNodeFileWriter

    _recordCount: number
    _tableCount: number
    onFieldHeadingReadReady?: (args: FtFieldHeadingReadyEventArgs) => void
    onFieldHeadingWriteReady?: (args: FtFieldHeadingReadyEventArgs) => void
    onFieldValueReadReady?: (args: FtFieldValueReadyEventArgs) => void
    onFieldValueWriteReady?: (args: FtFieldValueReadyEventArgs) => void
    onHeadingLineFinished?: (args: FtHeadingLineFinishedEventArgs) => void
    onHeadingLineStarted?: (args: FtHeadingLineStartedEventArgs) => void
    onRecordFinished?: (args: FtRecordFinishedEventArgs) => void
    onRecordStarted?: (args: FtRecordStartedEventArgs) => void
    onSequenceRedirected?: (args: FtSequenceRedirectedEventArgs) => void
    CarriageReturnChar: "\r"
    CarriageReturnLineFeedString: "\r\n"
    LineFeedChar: "\n"
    PrefixSpaceChar: " "
    Signature: "|!Fielded Text^|"
    VersionLabel: "Version"
    VersionMajor: 1
    VersionMinor: 1
    VersionSeparator: "."
    • get allowEndOfLineCharInQuotes(): boolean

      Returns boolean

    • get allowIncompleteRecords(): boolean

      Returns boolean

    • get baseWriter(): FtTextWriter | undefined

      Gets the underlying text writer.

      Returns FtTextWriter | undefined

    • get culture(): DotNetLocaleSettings

      Returns DotNetLocaleSettings

    • get delimiterChar(): string

      Returns string

    • get depth(): number

      Number of sequences currently invoked (depth of sequence invokation stack).

      IDataReader member

      Returns number

    • get endOfLineAutoWriteType(): FtEndOfLineAutoWriteType

      Returns FtEndOfLineAutoWriteType

    • get endOfLineChar(): string

      Returns string

    • get endOfLineType(): FtEndOfLineType

      Returns FtEndOfLineType

    • get fieldCount(): number

      Number of fields in the current record.

      IDataReader member

      Returns number

    • get fieldDefinitionList(): FtFieldDefinitionList

      Returns FtFieldDefinitionList

    • get fieldList(): FtFieldList

      Returns FtFieldList

    • get headingAlwaysWriteOptionalQuote(): boolean

      Returns boolean

    • get headingConstraint(): FtHeadingConstraint

      Returns FtHeadingConstraint

    • get headingEndOfValueChar(): string

      Returns string

    • get headingLineCount(): number

      Returns number

    • get headingPadAlignment(): FtPadAlignment

      Returns FtPadAlignment

    • get headingPadChar(): string

      Returns string

    • get headingPadCharType(): FtPadCharType

      Returns FtPadCharType

    • get headingQuotedType(): FtQuotedType

      Returns FtQuotedType

    • get headingTruncateChar(): string

      Returns string

    • get headingTruncateType(): FtTruncateType

      Returns FtTruncateType

    • get headingWritePrefixSpace(): boolean

      Returns boolean

    • get ignoreBlankLines(): boolean

      Returns boolean

    • get ignoreExtraChars(): boolean

      Returns boolean

    • get isClosed(): boolean

      Gets whether the writer is closed.

      Returns boolean

    • get lastLineEndedType(): FtLastLineEndedType

      Returns FtLastLineEndedType

    • get lineCommentChar(): string

      Returns string

    • get mainHeadingLineIndex(): number

      Returns number

    • get previousRecordSequenceInvokationList(): FtSequenceInvokationList

      Returns FtSequenceInvokationList

    • get quoteChar(): string

      Returns string

    • get recordCount(): number

      Returns number

    • get rootFieldCount(): number

      Returns number

    • get rootSequence(): FtSequence | undefined

      Returns FtSequence | undefined

    • get rootSequenceInvokation(): FtSequenceInvokation | undefined

      Returns FtSequenceInvokation | undefined

    • get seeking(): boolean

      Returns boolean

    • get sequenceInvokationList(): FtSequenceInvokationList

      Returns FtSequenceInvokationList

    • get sequenceList(): FtSequenceList

      Returns FtSequenceList

    • get stuffedEmbeddedQuotes(): boolean

      Returns boolean

    • get substitutionChar(): string

      Returns string

    • get substitutionList(): FtSubstitutionList

      Returns FtSubstitutionList

    • get substitutionsEnabled(): boolean

      Returns boolean

    • get tableCount(): number

      Returns number

    • Parameters

      • field: FtField
      • lineIndex: number

      Returns void

    • Parameters

      • field: FtField
      • recordIndex: number

      Returns void

    • Parameters

      • lineIndex: number

      Returns void

    • Parameters

      • lineIndex: number

      Returns void

    • Parameters

      • recordIndex: number

      Returns void

    • Parameters

      • recordIndex: number

      Returns void

    • Parameters

      • redirectingField: FtField
      • fieldsAffectedFromIndex: number

      Returns void

    • Flush the writer.

      Returns void

    • Get a FtField object at index.

      Parameters

      • idx: number

      Returns FtField

    • Get a FtField object by name.

      Parameters

      • name: string

      Returns FtField | undefined

    • Get a index of field in record by its name.

      Parameters

      • name: string

      Returns number | undefined

      Error if the field is not found.

    • Get the name of the field at the given index.

      Parameters

      • idx: number

      Returns string

    • Get a field value by index. Returns null if the field value is null.

      Parameters

      • idx: number

      Returns Value | null

    • Get a field value by name. Returns null if the field value is null.

      Parameters

      • name: string

      Returns Value | null

      Error if the field is not found.

    • Get a field value by index.

      Parameters

      • idx: number

      Returns Value | null

      FtFieldNullError if the field value is null.

    • Get a field value by name.

      Parameters

      • name: string

      Returns Value | null

      FtFieldNullError if the field value is null.

      Error if the field is not found.

    • Get the value type of the field at the given index.

      Parameters

      • idx: number

      Returns string

    • Name of the field at the given index. Alias for getFieldName.

      IDataReader member

      Parameters

      • idx: number

      Returns string

    • Get a index of field in record by its name.

      IDataReader member

      Parameters

      • name: string

      Returns number

      Error if the field is not found.

    • Internal load metadata. Override from SerializationCore.

      Parameters

      • meta: FtMeta

      Returns void

    • Whether the field value at the given index is null. Alias for isFieldNull.

      IDataReader member

      Parameters

      • idx: number

      Returns boolean

    • Whether the field value at the given index is null.

      Parameters

      • idx: number

      Returns boolean

    • Load configuration from FtMeta.

      Parameters

      • meta: FtMeta

      Returns void

    • Open the writer with a FtTextWriter and optional settings.

      Parameters

      • textWriter: FtTextWriter

        The FtTextWriter to write to

      • Optionalsettings: FtWriterSettings

        Optional writer settings (default: {})

      Returns void

    • Parameters

      • redirectingField: FtField
      • invokedSequence: FtSequence
      • invokationDelay: FtSequenceInvokationDelay

      Returns number

    • Reset serialization state.

      Returns void

    • Set a boolean field.

      Parameters

      • idx: number

        The 0-based index of the field to set.

      • value: boolean | null

        The value to set for the field. Can be null to set the field to null.

      Returns void

    • Set a DateTime field's value.

      Parameters

      • idx: number

        The 0-based index of the field to set.

      • value: Date | null

        The value to set for the field. Can be null to set the field to null.

      Returns void

    • Set a decimal field.

      Parameters

      • idx: number

        The 0-based index of the field to set.

      • value: number | null

        The value to set for the field. Can be null to set the field to null.

      Returns void

    • Set a field value by index. Accepts null to set the field to null.

      Parameters

      • idx: number

        The 0-based index of the field to set.

      • value: Value | null

        The value to set for the field. Can be null to set the field to null.

      Returns void

      FtTypeError if the value being set is not of the field's expected type.

    • Set a field value by name.

      Parameters

      • name: string

        The name of the field to set.

      • value: Value | null

        The value to set for the field. Can be null to set the field to null.

      Returns void

      FtTypeError if the value being set is not of the field's expected type.

    • Set a float field.

      Parameters

      • idx: number

        The 0-based index of the field to set.

      • value: number | null

        The value to set for the field. Can be null to set the field to null.

      Returns void

    • Set an integer field.

      Parameters

      • idx: number

        The 0-based index of the field to set.

      • value: number | bigint | null

        The value to set for the field. Can be null to set the field to null.

      Returns void

    • Parameters

      • aChar: string

      Returns void

    • Set a field to null.

      Parameters

      • idx: number

        The 0-based index of the field to set.

      Returns void

    • Set a field to null.

      Parameters

      • name: string

        The name of the field to set.

      Returns void

    • Parameters

      • value: boolean

      Returns void

    • Set a string field.

      Parameters

      • idx: number

        The 0-based index of the field to set.

      • value: string | null

        The value to set for the field. Can be null to set the field to null.

      Returns void

    • Set multiple field values.

      Parameters

      • values: (Value | null)[]

        An array of values to set for the fields. The length of the array must not exceed the number of fields. Array elements can be null to set the corresponding field to null.

      Returns void

      FtTypeError if any of the values being set is not of the corresponding field's expected type.

    • Parameters

      • token: string

      Returns { found: boolean; value: string }

    • Parameters

      • unredirectingField: FtField

      Returns number

    • Write a record.

      Returns void

    • Write a comment line.

      Parameters

      • comment: string
      • OptionalbeforeCommentChars: string

      Returns void

    • Write the header (declaration, embedded meta, heading lines).

      Returns void