CText Class Reference

CText operates list of objects. More...

#import <ctext.h>

List of all members.

Public Member Functions

(id) - init
 Initialize CText object.
(id) - initWithString:
 Initialize text object by string.
(void) - dealloc
 Release resource for the object.
(uint_t) - lineNum
 Get number of lines in the text.
(NSString *) - lineAtIndex:
 Get one line from text.
(void) - appendLine:
 Append new line to the text.
(void) - appendSomeLines:
 Append some lines to the text.
(void) - prependLine:
 Prepend new string as a 1st line in text.
(void) - prependSomeLines:
 Prepend some lines to the heading of text.
(uint_t) - width
 Get max width of line in the text.
(void) - print:
 Print the content of text.
(CText *) - paste:
 Join other text for each lines and generate text from them.

Protected Attributes

NSMutableArray * line_array


Detailed Description

CText operates list of objects.

Description
CText operates list of objects.


Member Function Documentation

- (void) appendLine: (NSString *)  src  
 

Append new line to the text.

Parameters:
src Source line.
Description
Append new line to the text. The source line must NOT have newline code in it. (See appendSomeLines() method).
Warning:
Do not give the line which contains newline code. This method does not split the line into some lines.

- (void) appendSomeLines: (NSString *)  src  
 

Append some lines to the text.

Parameters:
src Source string which contans some words and newlines.
Description
Append new lines to the text. The source string can contain some newlines. (See appendLine() method).

- (void) dealloc  
 

Release resource for the object.

Description
Release resource for the object.

- (id) init  
 

Initialize CText object.

Description
Initialize CText object.
Returns:
The object itself.

- (id) initWithString: (NSString *)  str  
 

Initialize text object by string.

Returns:
New text.
Parameters:
str Source string.
Description
Initialize text object by string.

- (NSString *) lineAtIndex: (uint_t)  index  
 

Get one line from text.

Return values:
obj The string for the line.
nil The indexed object is not found.
Parameters:
index Index to choose a line.
Description
Get one line from text.

- (uint_t) lineNum  
 

Get number of lines in the text.

Returns:
Number of lines.
Description
Get number of lines in the text.

- (CText *) paste: (CText *)  text  
 

Join other text for each lines and generate text from them.

Parameters:
text Source text to paste.
Description
Paste other text for each lines. Each lines are joined and the indentation of right line are defined by maximum width of left lines.

- (void) prependLine: (NSString *)  src  
 

Prepend new string as a 1st line in text.

Parameters:
src Source line. The string must NOT contain newline codes.
Description
Prepend new string as a 1st line in text. The source line must NOT have newline code in it. (See prependSomeLines() method).
Warning:
Do not give the line which contains newline code. This method does not split the line into some lines.

- (void) prependSomeLines: (NSString *)  src  
 

Prepend some lines to the heading of text.

Parameters:
src Source string which contans some words and newlines.
Description
Prepend new lines to the heading of text. The source string can contain some newlines. (See prependLine() method).

- (void) print: (FILE *)  outfp  
 

Print the content of text.

Parameters:
outfp Output file stream.
Description
Print the content of text.

- (uint_t) width  
 

Get max width of line in the text.

Returns:
Width of text.
Description
Get max width of line in the text.


Member Data Documentation

- (NSMutableArray*) line_array [protected]
 

Array of lines in text


The documentation for this class was generated from the following files:
Generated on Mon Mar 20 18:48:15 2006 for Coconut by  doxygen 1.4.6