This repository has been archived by the owner on Sep 4, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
119 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// | ||
// Created by pily on 15/03/17. | ||
// | ||
|
||
#ifndef WPS_PIN_GENERATOR_AUTHORSCREENEXCEPTION_H | ||
#define WPS_PIN_GENERATOR_AUTHORSCREENEXCEPTION_H | ||
|
||
#include <string> | ||
#include <exception> | ||
|
||
class AuthorsScreenException : public std::exception { | ||
public: | ||
/** Constructor (C string) | ||
* @param message C-style string error message. | ||
* The string contents are copied upon construction. | ||
* Hence, responsibility for deleting the char* lies | ||
* with the caller. | ||
*/ | ||
explicit AuthorsScreenException(const char *message) : errorMessage_(message) {} | ||
|
||
/** Constructor (C++ STL string) | ||
* @param message The error message. | ||
*/ | ||
explicit AuthorsScreenException(const std::string &message = "Authors screen showed") : errorMessage_(message) {} | ||
|
||
/** Destructor | ||
* Virtual to allow subclassing | ||
*/ | ||
virtual ~AuthorsScreenException() throw() {} | ||
|
||
/** Returns a pointer to the (constant) error description. | ||
* | ||
* @return | ||
*/ | ||
const char *what() const throw() { | ||
return errorMessage_.c_str(); | ||
} | ||
|
||
private: | ||
/** Saved error message | ||
*/ | ||
std::string errorMessage_; | ||
}; | ||
|
||
#endif //WPS_PIN_GENERATOR_AUTHORSCREENEXCEPTION_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// | ||
// Created by pily on 15/03/17. | ||
// | ||
|
||
#include "AuthorsScreen.h" | ||
#include <string> | ||
#include "../Info/Info.h" | ||
#include "../../lib/rang/include/rang.hpp" | ||
|
||
void AuthorsScreen::printAuthorsScreen() { | ||
|
||
std::cout << rang::style::reset << rang::fg::green << "AUTHORS" << rang::style::reset << std::endl | ||
<< Info::getAuthorInfos() | ||
<< std::endl; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// | ||
// Created by pily on 15/03/17. | ||
// | ||
|
||
#ifndef WPS_PIN_GENERATOR_AUTHORSSCREEN_H | ||
#define WPS_PIN_GENERATOR_AUTHORSSCREEN_H | ||
|
||
class AuthorsScreen { | ||
public: | ||
static void printAuthorsScreen(); | ||
}; | ||
|
||
#endif //WPS_PIN_GENERATOR_AUTHORSSCREEN_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters