# TCCConversion.cc

Summary

TCCConversion.cc |
Functions |
f__putInLowercase | Put charstring to lowercase
f__putInUppercase | Put charstring to uppercase
f__addOctetstring | Add two integer values represented in OCTETSTRING
f__subOctetstring | Substract two integer values represented in OCTETSTRING
f__compOctetstring | Compare two integer values represented in OCTETSTRING
f_substr_token | The function returns a substring from a value.
f_strstr | The f_strstr function locates the first occurrence of the string s2 in string s1 and returns an index of starting pont of the located string, or -1 if the string is not found.
f_convertIPAddrToBinary | Converts an IPv4 and IPv6 address to its hex representation.
f_oct2char_safe | Fault tolerant version of the oct2str Titan built-in function.

### Functions

### f__putInLowercase

#### Purpose

Put charstring to lowercase

#### Parameters

pl__string | in charstring - charstring

#### Return Value

charstring | converted value

#### Errors

-

#### Detailed description

-

### f__putInUppercase

#### Purpose

Put charstring to uppercase

#### Parameters

pl__string | in charstring - charstring

#### Return Value

charstring | converted value

#### Errors

-

#### Detailed description

-

### f__addOctetstring

#### Purpose

Add two integer values represented in OCTETSTRING

#### Parameters

par1 | in octetstring - first octetstring value
par2 | in octetstring - second octetstring value

#### Return Value

octetstring | sum of input

#### Errors

-

#### Detailed description

Negative values are unhandled!

### f__subOctetstring

#### Purpose

Substract two integer values represented in OCTETSTRING

#### Parameters

par1 | in octetstring - first octetstring value
par2 | in octetstring - second octetstring value

#### Return Value

octetstring | difference of input

#### Errors

-

#### Detailed description

Negative values are unhandled!

### f__compOctetstring

#### Purpose

Compare two integer values represented in OCTETSTRING

#### Parameters

par1 | in octetstring - first octetstring value
par2 | in octetstring - second octetstring value

#### Return Value

integer | 0: par1 = par2 1: par1>par2 2: par1<par2

#### Errors

-

#### Detailed description

Negative values are unhandled!

### f_substr_token

#### Purpose

The function returns a substring from a value. The starting and the ending points are defined by the begin and end tokens.

#### Parameters

str | in charstring - the value
begin_token | in charstring - begin token
end_token | in charstring - end token

#### Return Value

charstring. If one of the tokens is not found it returns an empty string

#### Errors

-

#### Detailed description

If end_token is an empty string the function returns the part of the value after the begin_token. If begin_token is an empty string the function returns the part of the value until the end_token. If both of them empty string the function returns the part whole value

### f_strstr

#### Purpose

The f_strstr function locates the first occurrence of the string s2 in string s1 and returns an index of starting pont of the located string, or -1 if the string is not found. If s2 is an empty, the func- tion returns 0.

#### Parameters

s1 | in charstring - input string
s2 | in charstring - string to search
offset | in integer - start offset.

#### Return Value

index of starting pont of the located string

#### Errors

-

#### Detailed description

The offset determines the starting point of the search. Any occurance of the s2 before the offset is ignored. The offset is optional

### f_convertIPAddrToBinary

#### Purpose

Converts an IPv4 and IPv6 address to its hex representation. IPv6 address is assumed if the input string contains ‘:’

#### Parameters

pl_ip | in charstring - input string

#### Return Value

hex value of the Ip in an octetstring

#### Errors

-

#### Detailed description

### f_oct2char_safe

#### Purpose

Fault tolerant version of the oct2str Titan built-in function.

#### Parameters

s1 | in octetsttring - input string
s2 | out charstring - output string

#### Return Value

false on fault, ie. on unbound input or invalid character in input. true on success

#### Errors

-

#### Detailed description

On fault, the longest chunk that could be decoded is returned.