CVocPrinter Class Reference

Vocabulary Printer Class. More...

#include <vocprinter.H>

List of all members.

Public Member Functions

void PrintWords (const std::vector< std::string > &words)
 Print Words function.
void PrintCorrectString ()
 Print correct string function.
void PrintWrongString (const std::vector< std::string > &words, const bool &bBeep)
 Print wrong string function.
void PrintStartString ()
 Print start string function.
void PrintEndString (size_t nWords, size_t nInquiries, size_t nWrong, size_t nSecs)
 Print end string function.

Private Member Functions

void printLine (std::string strLine)
 Helper function.
std::string genWordString (const std::vector< std::string > &words)
 Helper function.
void beep ()
 Helper function.

Detailed Description

Vocabulary Printer Class.

This class handles all the functionality between writing to the console and Vocatra.


Member Function Documentation

void CVocPrinter::beep (  )  [private]

Helper function.

Plays a beep sound

Referenced by PrintWrongString().

std::string CVocPrinter::genWordString ( const std::vector< std::string > &  words  )  [private]

Helper function.

Generates a string with the given words

Parameters:
words vector with words to append to string
Returns:
generated string

Referenced by PrintWords(), and PrintWrongString().

void CVocPrinter::PrintCorrectString (  ) 

Print correct string function.

This function prints a string to the standard output stream, if the answer is correct.

References printLine().

Referenced by CVocTrainer::Learn().

void CVocPrinter::PrintEndString ( size_t  nWords,
size_t  nInquiries,
size_t  nWrong,
size_t  nSecs 
)

Print end string function.

This function prints the end string to the standard output stream.

Parameters:
nWords number of learned vocabulary words
nInquiries number of word inquiries
nWrong number of wrong answers
nSecs number of seconds since the learning process has started

References printLine().

Referenced by CVocTrainer::Learn().

void CVocPrinter::printLine ( std::string  strLine  )  [private]

Helper function.

Prints line to stdout.

Parameters:
strLine string to be printed

Referenced by PrintCorrectString(), PrintEndString(), PrintStartString(), PrintWords(), and PrintWrongString().

void CVocPrinter::PrintStartString (  ) 

Print start string function.

This function prints the start string to the standard output stream.

References printLine().

Referenced by CVocTrainer::Learn().

void CVocPrinter::PrintWords ( const std::vector< std::string > &  words  ) 

Print Words function.

This function prints the words to stdout and separates them with a comma.

Parameters:
words vector with words to print.

References genWordString(), and printLine().

Referenced by CVocTrainer::Learn().

void CVocPrinter::PrintWrongString ( const std::vector< std::string > &  words,
const bool &  bBeep 
)

Print wrong string function.

This function prints a string to the standard output stream, if the answer is wrong.

Parameters:
words vector with words to print
bBeep If true, function will cause beep sound

References beep(), genWordString(), and printLine().

Referenced by CVocTrainer::Learn().


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

Get Vocatra at SourceForge.net. Fast, secure and Free Open Source software downloads Generated for Vocatra by doxygen