Inherits from NSTextStorage
Declared in ViTextStorage.h

Overview

Text storage.

Line numbers are 1-based. Columns are zero-based.

Tasks

Instance Methods

columnAtLocation:

Find the column of a location.

- (NSUInteger)columnAtLocation:(NSUInteger)aLocation

Parameters

aLocation

The location to check for column.

Return Value

The logical column from the start of the line.

Discussion

This method always uses the default tab size when determining the column.

Declared In

ViTextStorage.h

firstNonBlankForLineAtLocation:

Find the first non-blank character on a line.

- (NSUInteger)firstNonBlankForLineAtLocation:(NSUInteger)aLocation

Parameters

aLocation

A location on the line to check.

Return Value

The location of the first non-blank character on the given line. If the line is blank (no non-blanks found), then the location of the end of the line is returned. Returns NSNotFound if aLocation is beyond the end of the document.

Declared In

ViTextStorage.h

isBlankLineAtLocation:

Determine if a line is blank.

- (BOOL)isBlankLineAtLocation:(NSUInteger)aLocation

Parameters

aLocation

A location on the line to check.

Return Value

YES if the line at the given location is blank.

Declared In

ViTextStorage.h

lineCount

Return the number of lines.

- (NSUInteger)lineCount

Return Value

The number of lines, or zero if the document is empty.

Declared In

ViTextStorage.h

lineNumberAtLocation:

Find the line number of a location.

- (NSUInteger)lineNumberAtLocation:(NSUInteger)aLocation

Parameters

aLocation

The location of the line number to return.

Return Value

The line number at a given location. Returns 0 if the document is empty.

Declared In

ViTextStorage.h

locationForStartOfLine:

Find the start location of a line.

- (NSInteger)locationForStartOfLine:(NSUInteger)aLineNumber

Parameters

aLineNumber

The line number to lookup.

Return Value

The location for the start of the given line.

Declared In

ViTextStorage.h

rangeOfLeadingWhitespaceForLineAtLocation:

Find the range of leading whitespace on a line.

- (NSRange)rangeOfLeadingWhitespaceForLineAtLocation:(NSUInteger)aLocation

Parameters

aLocation

A location on the line to check.

Return Value

A range of leading whitespace for the given line. Returns (NSNotFound, 0) if aLocation is beyond the end of the document.

Declared In

ViTextStorage.h

rangeOfLine:

Return the range of a line.

- (NSRange)rangeOfLine:(NSUInteger)lineNumber

Parameters

lineNumber

The line number to return the range for.

Return Value

The range of the line, or (NSNotFound, 0) if the lineNumber is invalid.

Declared In

ViTextStorage.h

rangeOfLineAtLocation:

Return the range of a line.

- (NSRange)rangeOfLineAtLocation:(NSUInteger)aLocation

Parameters

aLocation

The location of a character on the line to return the range for.

Return Value

The range of the line, or (NSNotFound, 0) if the location is invalid.

Declared In

ViTextStorage.h