OTPNitro
 All Classes Files Functions Variables Macros
Public Member Functions | Public Attributes | List of all members
Text Class Reference

Text and encoding related functions. More...

#include <text.h>

Public Member Functions

void replaceAll (string &, const string &, const string &)
 Replace all characters from a string. More...
 
void create (int, string, string, string)
 Set the Text object parameters. More...
 
string print (int)
 Print a human friendly Text object. More...
 
string encodeB26 (unsigned char *, long)
 Returns the text encoded in Base26. More...
 
void decodeB26 (unsigned char *, string)
 Returns the text decoded in Base26. More...
 
void parse (string)
 Parse and set the Text object with a formatted (headed) message. More...
 

Public Attributes

string msg
 Message string. More...
 
string book
 Book ID. More...
 
string from
 Sender identificative string (3 letters, for example: AVD) More...
 
int page
 Page num (int) More...
 

Detailed Description

Text and encoding related functions.

Member Function Documentation

void Text::create ( int  page,
string  book,
string  from,
string  msg 
)

Set the Text object parameters.

Parameters
pagePage num
bookBook ID
fromA sender id for identification
msgThe cleartext message
void Text::decodeB26 ( unsigned char *  output,
string  text 
)

Returns the text decoded in Base26.

Parameters
outputText decoded
textEncoded text
string Text::encodeB26 ( unsigned char *  text,
long  len 
)

Returns the text encoded in Base26.

Parameters
textText to encode
lenText len
Returns
Encoded text (string)
void Text::parse ( string  text)

Parse and set the Text object with a formatted (headed) message.

Parameters
textThe formatted message string
string Text::print ( int  spa)

Print a human friendly Text object.

Parameters
spaSpace num
Returns
sout.str()
void Text::replaceAll ( string &  ,
const string &  ,
const string &   
)

Replace all characters from a string.

replaceAll( str, from, to )

Parameters
strThe string pointer
fromCharacter to be replaced
toReplace character

Member Data Documentation

string Text::book

Book ID.

string Text::from

Sender identificative string (3 letters, for example: AVD)

string Text::msg

Message string.

int Text::page

Page num (int)


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