Inherits from NSObject
Declared in GBSourceInfo.h
GBSourceInfo.m

Overview

Specifies declared file data for store object.

Declared file provides information about where an object was declared - i.e. source file name and line number. This can be used for generating output and for diagnostics and as debug information.

Tasks

Initialization & disposal

Data handling

  • – compare: Returns an NSComparisonResult value that indicates whether the receiver is greater than, equal to, or less than a given data.
  •   filename The name of the file, without path. property
  •   lineNumber The number of the line within the file. property

Properties

filename

The name of the file, without path.

@property (readonly, copy) NSString *filename

Declared In

GBSourceInfo.h

lineNumber

The number of the line within the file.

@property (readonly, assign) NSUInteger lineNumber

Declared In

GBSourceInfo.h

Class Methods

infoWithFilename:lineNumber:

Returns a new autoreleased GBSourceInfo with the given values.

+ (id)infoWithFilename:(NSString *)filename lineNumber:(NSUInteger)lineNumber

Parameters

filename
The name of the file without path.
lineNumber
Line number within the file.

Return Value

Returns autoreleased object.

Exceptions

NSException
Thrown if the given filename is nil or empty string.

Declared In

GBSourceInfo.h

Instance Methods

compare:

Returns an NSComparisonResult value that indicates whether the receiver is greater than, equal to, or less than a given data.

- (NSComparisonResult)compare:(GBSourceInfo *)data

Parameters

data
GBSourceInfo to compare with.

Return Value

NSOrderedAscending if the value of data is greater than the receiver, NSOrderedSame if they’re equal, and NSOrderedDescending if the data is less than the receiver.

Discussion

Comparison is done over the filename first. If the filename is the same, lineNumber is compared.

Important: Note that the given data must not be nil. The behavior is undefined in such case!

Declared In

GBSourceInfo.h