fb-doc  0.4.0
FreeBASIC documentation tool
RepData Class Reference

A container for string replacements. More...

Collaboration diagram for RepData:

Public Member Functions

FUNCTION_AS_ZSTRING_PTR add (BYREF_AS_STRING, BYREF_AS_STRING)
 Add a new element pair. More...
 
FUNCTION_AS_ZSTRING_PTR rep (BYREF_AS_STRING)
 Search for a string, get its replacement (if any) More...
 

Public Attributes

STRING O
 The output (a list of counters and strings) More...
 
STRING I = MKl(0) & CHR(1)
 The input (a list of strings to search for) More...
 

Detailed Description

A container for string replacements.

This class is to store two tables, one of search strings and a second one of their replacements. It's used to collect the links from the original source and replace symbol names in the emitter output, as well as referenced line numbers and #INCLUDE files.

Definition at line 21 of file fbdoc_emit_syntax.bi.

Member Function Documentation

FUNCTION_AS_ZSTRING_PTR RepData::add ( BYREF_AS_STRING  S,
BYREF_AS_STRING  R 
)

Add a new element pair.

Parameters
SThe string to search for
RThe string to replace with
Returns
zero on success, otherwise a ZSTRING PTR to an error code

Add a new pair of strings to the container tables. The function checks if the search string contains illegal characters or if it's already defined. In this cases nothing happens and an error message gets returned. Otherwise the search string and its replacement gets stored in the container.

The search string must not contain characters in the range CHR(0) to CHR(2).

Definition at line 43 of file fbdoc_emit_syntax.bas.

FUNCTION_AS_ZSTRING_PTR RepData::rep ( BYREF_AS_STRING  S)

Search for a string, get its replacement (if any)

Parameters
SThe string to search for
Returns
A pointer to the replacement (if any)

This function searches for the string given as parameter. If the string is in the search words, a pointer to it's replacement gets returned. Otherwise a pointer to the original string gets returned.

The function searches case sensitive.

Definition at line 62 of file fbdoc_emit_syntax.bas.

Member Data Documentation

STRING RepData::O

The output (a list of counters and strings)

Definition at line 23 of file fbdoc_emit_syntax.bi.

STRING RepData::I = MKl(0) & CHR(1)

The input (a list of strings to search for)

Definition at line 24 of file fbdoc_emit_syntax.bi.


The documentation for this class was generated from the following files: