Main Page | Namespace List | Class Hierarchy | Class List | File List | Class Members | File Members | Related Pages

user_interface Class Reference

#include <user_interface.h>

Collaboration diagram for user_interface:

Collaboration graph
List of all members.

Detailed Description

Singleton class for user interface.


Public Types

enum  console_type { AUTO, MONO, ANSI, WIND }
 Console types enum. More...


Public Member Functions

 ~user_interface (void)
 user interface destructor.

bool Ask (const string &Question, const char TrueOption, const char FalseOption, const bool DefaultAnswer)
 Ask a question to the user.

string Ask (const string &Question, const string &DefaultAnswer)
 Ask a question to the user.

int Ask (const string &Question, const int DefaultAnswer)
 Ask a question to the user.

void Message (const string &Message, console::console_color CColor=console::BRIGHT_WHITE)
 Prints program message.

void DebugMessage (const string &Message)
 Prints debug message.

void ExceptionMessage (const string &Message)
 Prints exception message.

void LogMessage (const string &Message)
 Write message into log file.

void StartLoopMessage (void)
 Start loop message.

void LoopMessage (const string &Message, console::console_color CColor=console::BRIGHT_WHITE)
 Print loop message.

void StopLoopMessage (void)
 Stop loop message.

void Version (void)
 Show Version.

void Help (void)
 Show help.


Static Public Member Functions

void CreateInstance (console_type ConsoleType=AUTO)
 Create the user_interface singleton instance.

void DeleteInstance (void)
 Deletes the user_interface singleton instance.

user_interfaceInstance (void)
 Get de user_interface singleton instance.


Private Member Functions

 user_interface (console_type ConsoleType)
 User interface constructor.

 user_interface (const user_interface &Obj)
 User interface copy constructor.


Private Attributes

consolem_pConsole
 Pointer to the input/output console.

bool m_LoopMessage
 If true there is a loop message in progress.

string::size_type m_LastLoopMessageLength
 Length of the last loop message.


Static Private Attributes

user_interfacem_pInstance = NULL
 Instance of the singleton.


Member Enumeration Documentation

enum user_interface::console_type
 

Console types enum.


Constructor & Destructor Documentation

user_interface::~user_interface void   ) 
 

user interface destructor.

user_interface::user_interface console_type  ConsoleType  )  [private]
 

User interface constructor.

Parameters:
ConsoleType: Console type.

user_interface::user_interface const user_interface Obj  )  [private]
 

User interface copy constructor.

Parameters:
Obj: Object instance.


Member Function Documentation

void user_interface::CreateInstance console_type  ConsoleType = AUTO  )  [static]
 

Create the user_interface singleton instance.

Parameters:
ConsoleType: Type of the console to create.

Here is the call graph for this function:

void user_interface::DeleteInstance void   )  [static]
 

Deletes the user_interface singleton instance.

user_interface * user_interface::Instance void   )  [static]
 

Get de user_interface singleton instance.

Returns:
pointer to the current instance.

bool user_interface::Ask const string &  Question,
const char  TrueOption,
const char  FalseOption,
const bool  DefaultAnswer
 

Ask a question to the user.

Parameters:
Question: The question.
TrueOption: The true answer.
FalseOption: The false answer.
DefaultAnswer: Default value if answer is empty.
Returns:
The answer to the question.

Here is the call graph for this function:

string user_interface::Ask const string &  Question,
const string &  DefaultAnswer
 

Ask a question to the user.

Parameters:
Question: The question.
DefaultAnswer: The answer assumed by default.
Returns:
The answer to the question.

Here is the call graph for this function:

int user_interface::Ask const string &  Question,
const int  DefaultAnswer
 

Ask a question to the user.

Parameters:
Question: The question.
DefaultAnswer: The answer assumed by default.
Returns:
The answer to the question.

Here is the call graph for this function:

void user_interface::Message const string &  Message,
console::console_color  CColor = console::BRIGHT_WHITE
 

Prints program message.

Parameters:
Message: Program message.
CColor: Message color.

Here is the call graph for this function:

void user_interface::DebugMessage const string &  Message  ) 
 

Prints debug message.

Parameters:
Message: Debug message.

void user_interface::ExceptionMessage const string &  Message  ) 
 

Prints exception message.

Parameters:
Message: Exception message.

Here is the call graph for this function:

void user_interface::LogMessage const string &  Message  ) 
 

Write message into log file.

Parameters:
Message: Message to write.

void user_interface::StartLoopMessage void   ) 
 

Start loop message.

Here is the call graph for this function:

void user_interface::LoopMessage const string &  Message,
console::console_color  CColor = console::BRIGHT_WHITE
 

Print loop message.

Parameters:
Message: Message to Print.
CColor: Color for the message.

Here is the call graph for this function:

void user_interface::StopLoopMessage void   ) 
 

Stop loop message.

Here is the call graph for this function:

void user_interface::Version void   ) 
 

Show Version.

Here is the call graph for this function:

void user_interface::Help void   ) 
 

Show help.

Here is the call graph for this function:


Member Data Documentation

console* user_interface::m_pConsole [private]
 

Pointer to the input/output console.

user_interface * user_interface::m_pInstance = NULL [static, private]
 

Instance of the singleton.

bool user_interface::m_LoopMessage [private]
 

If true there is a loop message in progress.

string::size_type user_interface::m_LastLoopMessageLength [private]
 

Length of the last loop message.


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