WebCAD-Lib-TS API 文档 - v1.0.0
    Preparing search index...

    Class TextScanner

    Text scanner for parsing MText content

    Index

    Constructors

    • Create a new text scanner

      Parameters

      • text: string

        The text to scan

      Returns TextScanner

    Accessors

    • get currentIndex(): number

      Get the current index in the text

      Returns number

    • get isEmpty(): boolean

      Check if the scanner has reached the end of the text

      Returns boolean

    • get hasData(): boolean

      Check if there is more text to scan

      Returns boolean

    • get tail(): string

      Get the remaining text from the current position

      Returns string

    Methods

    • Get the next character and advance the index

      Returns string

      The next character, or empty string if at end

    • Advance the index by the specified count

      Parameters

      • count: number = 1

        Number of characters to advance

      Returns void

    • Look at a character without advancing the index

      Parameters

      • offset: number = 0

        Offset from current position

      Returns string

      The character at the offset position, or empty string if out of bounds

    • Find the next occurrence of a character

      Parameters

      • char: string

        The character to find

      • escape: boolean = false

        Whether to handle escaped characters

      Returns number

      Index of the character, or -1 if not found

    • Check if the next character is a space

      Returns boolean

    • Consume spaces until a non-space character is found

      Returns number

      Number of spaces consumed

    • Get remaining text from current position (alias for tail)

      Returns string