Main Page | Namespace List | File List | File Members

recources.inc.cpp File Reference


Functions

void generate_charstring_from_telnr (string telNr[])
void insert_array_indexes_to_charstring (string telNr[])
 Generates all possible key indexes and inserts them into telNr.

int is_valid_array_index (string telNr, string array_index)
 Check if we can gerate string from integer.

int max_strings (string str)
 Simply replaces chars in string with 4'rs.

int one_string_to_int (string str)
int string_to_int (string str)
 Converts string to integer.

string itos (int i)
 Convert integer to string.

int min_strings (string str)
 Simply replaces chars in string with 1'es.

void replace_array_indexes_in_charstring_with_chars (string telNr[])
 Replaces numbers in array_index strings with characters.

string ctos (char chr[])
 Character type string to string.

void filter_junk (string telNr[])
 Removes random strings with the help of dictionary.

void writeout (string telNr[])
 Writes out array telNr.

string array_index_to_char (string key, string array_index)
 Looks up a character from key.

void stoc (string input, char output[])
 Changes variable from string to char.


Variables

string chars_on_telkey [10][5]

Function Documentation

string array_index_to_char string  key,
string  array_index
 

Looks up a character from key.

todo. Maby parameters should be integers.

string ctos char  chr[]  ) 
 

Character type string to string.

void filter_junk string  telNr[]  ) 
 

Removes random strings with the help of dictionary.

Goes through the array telNr and removes all strings that doesn't exist in words.txt.

void generate_charstring_from_telnr string  telNr[]  ) 
 

void insert_array_indexes_to_charstring string  telNr[]  ) 
 

Generates all possible key indexes and inserts them into telNr.

So what do I mean by key index? On key 2 we have chars a, b anc c. Key index is alias to every char and they start from 1 on every key. So 1 = a, 2 = b and 3 = c. "1221" was a great band.

int is_valid_array_index string  telNr,
string  array_index
 

Check if we can gerate string from integer.

So what do I mean with integer? It's a special string filled with numbers. Each of these tell which character to choose from a key.

Which characters are on what key are stored in array chars_on_telkey.

string itos int  i  ) 
 

Convert integer to string.

Not char type string.

int max_strings string  str  ) 
 

Simply replaces chars in string with 4'rs.

So if the input is 123, output is 444. That's the max count of different strings we can generate.

int min_strings string  str  ) 
 

Simply replaces chars in string with 1'es.

So if the input is 123, output is 111. That's the min count of different strings we can generate.

int one_string_to_int string  str  ) 
 

void replace_array_indexes_in_charstring_with_chars string  telNr[]  ) 
 

Replaces numbers in array_index strings with characters.

Very important function. From a previous examp., if we have a telephone nr 2222 and array_index string 1221 the answer would be abba.

void stoc string  input,
char  output[]
 

Changes variable from string to char.

int string_to_int string  str  ) 
 

Converts string to integer.

Don't confuse this one with function that changes string type char to integer.

void writeout string  telNr[]  ) 
 

Writes out array telNr.


Variable Documentation

string chars_on_telkey[10][5]
 

Initial value:

{ {"-","0","-","-","-"}, {"-","1","-","-","-"}, {"-","a","b","c","-"}, {"-","d","e","f","-"}, {"-","g","h","i","-"}, {"-","j","k","l","-"}, {"-","m","n","o","-"}, {"-","p","q","r","s"}, {"-","t","u","v","-"}, {"-","w","x","y","z"} }


Generated on Tue Jun 22 12:55:06 2004 for Telephone numbers to words by doxygen 1.3.7