Class CssLocation

All Implemented Interfaces:
PointerInterface

public class CssLocation extends Record
Represents a location in a file or other source of data parsed
by the CSS engine.

The @bytes and @line_bytes offsets are meant to be used to
programmatically match data. The @lines and @line_chars offsets
can be used for printing the location in a file.

Note that the @lines parameter starts from 0 and is increased
whenever a CSS line break is encountered. (CSS defines the C character
sequences "\r\n", "\r", "\n" and "\f" as newlines.)
If your document uses different rules for line breaking, you might want
run into problems here.

https://docs.gtk.org/gtk4/struct.CssLocation.html

  • Field Details

    • BYTES

      public static final String BYTES
      number of bytes parsed since the beginning
      See Also:
    • CHARS

      public static final String CHARS
      number of characters parsed since the beginning
      See Also:
    • LINES

      public static final String LINES
      number of full lines that have been parsed. If you want to
      display this as a line number, you need to add 1 to this.
      See Also:
    • LINE_BYTES

      public static final String LINE_BYTES
      Number of bytes parsed since the last line break
      See Also:
    • LINE_CHARS

      public static final String LINE_CHARS
      Number of characters parsed since the last line break
      See Also:
  • Constructor Details

    • CssLocation

      public CssLocation(PointerContainer pointer)
    • CssLocation

      public CssLocation()
  • Method Details

    • getClassHandler

      public static ClassHandler getClassHandler()
    • setFieldBytes

      public void setFieldBytes(long bytes)
      number of bytes parsed since the beginning
    • getFieldBytes

      public long getFieldBytes()
      number of bytes parsed since the beginning
    • setFieldChars

      public void setFieldChars(long chars)
      number of characters parsed since the beginning
    • getFieldChars

      public long getFieldChars()
      number of characters parsed since the beginning
    • setFieldLines

      public void setFieldLines(long lines)
      number of full lines that have been parsed. If you want to
      display this as a line number, you need to add 1 to this.
    • getFieldLines

      public long getFieldLines()
      number of full lines that have been parsed. If you want to
      display this as a line number, you need to add 1 to this.
    • setFieldLineBytes

      public void setFieldLineBytes(long line_bytes)
      Number of bytes parsed since the last line break
    • getFieldLineBytes

      public long getFieldLineBytes()
      Number of bytes parsed since the last line break
    • setFieldLineChars

      public void setFieldLineChars(long line_chars)
      Number of characters parsed since the last line break
    • getFieldLineChars

      public long getFieldLineChars()
      Number of characters parsed since the last line break