Vocabulary Printer Class. More...
#include <vocprinter.H>
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. | |
Vocabulary Printer Class.
This class handles all the functionality between writing to the console and Vocatra.
| void CVocPrinter::beep | ( | ) | [private] |
| std::string CVocPrinter::genWordString | ( | const std::vector< std::string > & | words | ) | [private] |
Helper function.
Generates a string with the given words
| words | vector with words to append to 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.
| 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.
| 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.
| 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.
| words | vector with words to print | |
| bBeep | If true, function will cause beep sound |
References beep(), genWordString(), and printLine().
Referenced by CVocTrainer::Learn().
|
|
Generated for Vocatra by
|