1 package OWA_TEXT is
2
3 /*
4 The package OWA_TEXT provides an utility functions for handling
5 large amounts of text. These utilities mainly provide the ability
6 to turn a single stream of text into an array of individual lines.
7 These utilities are primarily used by the OWA_PATTERN package,
8 but may also be used independently.
9 */
10
11 type vc_arr is table of varchar2(32767) index by binary_integer;
12 type int_arr is table of integer index by binary_integer;
13
14 /* A multi_line is just an abstract datatype which can hold */
15 /* large amounts of text data as one piece. */
16 type multi_line is record
17 (
18 rows vc_arr,
19 num_rows integer,
20 partial_row boolean
21 );
22
23 /* row_list is used to contain a list of "interesting" rows */
24 type row_list is record
25 (
26 rows int_arr,
27 num_rows integer
28 );
29
30 /* Standard "make element" routines. */
31 function new_multi return multi_line;
32 procedure new_multi(mline out multi_line);
33
34 /* STREAM2MULTI takes in a single stream of text and will turn */
35 /* it into a multi_line structure. */
36 procedure stream2multi(stream in varchar2, mline out multi_line);
37 /* ADD2MULTI allows you to easily add new text to a multi-line */
38 /* structure. */
39 procedure add2multi(stream in varchar2,
40 mline in out multi_line,
41 continue in boolean DEFAULT TRUE);
42
43 /* PRINT_MULTI uses HTP.PRINT to print out a multi-line structure */
44 procedure print_multi(mline in multi_line);
45
46 /* For manipulating row_list structures - standard creation routines */
47 function new_row_list return row_list;
48 procedure new_row_list(rlist out row_list);
49
50 /* Print a row list using HTP.PRINT */
51 procedure print_row_list(rlist in row_list);
52
53 end;