| LineNumberTracker Class |
Namespace: Sdl.FileTypeSupport.Framework.Core.Utilities.NativeApi
The LineNumberTracker type exposes the following members.
| Name | Description | |
|---|---|---|
| LineNumberTracker | Initializes a new instance of the LineNumberTracker class |
| Name | Description | |
|---|---|---|
| ExtractionOutput |
Strongly typed output content handler that can be used
when the buffer is used for extraction.
(Inherited from AbstractNativeExtractionGenerationContentProcessor.) | |
| GenerationOutput |
Strongly typed output content handler that can be used
when the buffer is used for generation.
(Inherited from AbstractNativeExtractionGenerationContentProcessor.) | |
| LastCharacterWasCR |
If true, the last processed character was a CR (0x0d).
This flag is used to determine whether an LF character (0x0a)
should increment the line count or not, since CR + LF is
counted as a single line break character.
| |
| Line |
1-based value that expresses the number of characters that
have passed through the tag and text content of this processor
since the last line break.
| |
| LineBeforeIncrement |
Accessor to the field holding the value that is set to the
current line number before it is incremented in the IncrementLineAndOffsetNumbers(String) implementation.
Implementations that override that method without calling the base class may need to set this property.
The value is used in the implementation of GetLocationBeforeCurrentContent.
| |
| MessageReporter |
The message reporter to be used for reporting non-critical issues.
(Inherited from AbstractNativeFileTypeComponent.) | |
| Offset |
1-based index that expresses the number of line break characters that
have passed through the tag and text content of this processor.
| |
| OffsetBeforeIncrement |
Accessor to the field holding the value that is set to the
current offset number before it is incremented in the IncrementLineAndOffsetNumbers(String) implementation.
Implementations that override that method without calling the base class may need to set this property.
The value is used in the implementation of GetLocationBeforeCurrentContent.
| |
| Output |
Agnostic access to the output handler; accesses the
very same object instance as the ExtractionOutput
and the GenerationOutput properties.
(Inherited from AbstractNativeExtractionGenerationContentProcessor.) | |
| PropertiesFactory |
The factory used to create native properties objects
(Inherited from AbstractNativeFileTypeComponent.) |
This is intended to be used for components related to native text location message reporting, where line and offset numbers is the means of specifying a location for an error message.
Both line and offset numbers are 1-based, i.e. the first line in a file is line 1, and the first character on a line is character offset 1.
Line and offsets are calculated by looking at the text and tag properties passed through the content processor. Any text or tag content that contains a line break increments the current line number. The offset is reset to 1 after each line break and is incremented by 1 for each Unicode character after the line break.
Text and tags inside locked content are counted too.
The following is considered a line break character: a combination of CR+LF, a standalone LF, or a standalone CR. A CR+LF is counted as one single line break (CR = 0x0d, LF = 0x0a).
The current line and offset numbers can be read from the Line and Offset properties. These properties can also be written to, which could be useful if the values need to be adjusted.