mirror of
https://github.com/QuasarApp/CopyrightFixer.git
synced 2025-04-29 03:04:43 +00:00
commit
28a72f47d2
@ -26,5 +26,10 @@ int main(int argc, char *argv[]) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool runProc = worker.run();
|
||||||
|
if (!runProc) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -6,18 +6,37 @@
|
|||||||
//#
|
//#
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
#include "configparser.h"
|
||||||
|
#include "signer.h"
|
||||||
#include "worker.h"
|
#include "worker.h"
|
||||||
#include <quasarapp.h>
|
#include <quasarapp.h>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
namespace CopyrighFixer {
|
namespace CopyrighFixer {
|
||||||
Worker::Worker() {
|
|
||||||
|
|
||||||
|
Worker::Worker() {
|
||||||
|
_conf = new Config;
|
||||||
|
_confParser = new ConfigParser;
|
||||||
|
_subscriber = new Signer;
|
||||||
|
}
|
||||||
|
|
||||||
|
Worker::~Worker() {
|
||||||
|
delete _conf;
|
||||||
|
delete _confParser;
|
||||||
|
delete _subscriber;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Worker::run() {
|
bool Worker::run() {
|
||||||
return false;
|
|
||||||
|
if (!_confParser->parseOptions(*_conf)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!_subscriber->checkSign(*_conf)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Worker::printHelp() const {
|
void Worker::printHelp() const {
|
||||||
|
@ -10,6 +10,10 @@
|
|||||||
|
|
||||||
#include "CopyrighFixer_global.h"
|
#include "CopyrighFixer_global.h"
|
||||||
|
|
||||||
|
class ConfigParser;
|
||||||
|
class Signer;
|
||||||
|
class Config;
|
||||||
|
|
||||||
|
|
||||||
namespace CopyrighFixer {
|
namespace CopyrighFixer {
|
||||||
|
|
||||||
@ -17,13 +21,14 @@ namespace CopyrighFixer {
|
|||||||
* @brief The Worker class will be control all work process.
|
* @brief The Worker class will be control all work process.
|
||||||
*/
|
*/
|
||||||
class CopyrighFixer_EXPORT Worker {
|
class CopyrighFixer_EXPORT Worker {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Worker();
|
Worker();
|
||||||
|
~Worker();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief run It is main method for control of all parsing process.
|
* @brief run It is main method for control of all parsing process.
|
||||||
* @return Returns false if the program terminates with an error.
|
* @return Returns false if the program terminates with an error.
|
||||||
|
|
||||||
*/
|
*/
|
||||||
bool run();
|
bool run();
|
||||||
|
|
||||||
@ -32,6 +37,10 @@ public:
|
|||||||
*/
|
*/
|
||||||
void printHelp() const;
|
void printHelp() const;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
Config *_conf = nullptr;
|
||||||
|
ConfigParser *_confParser = nullptr;
|
||||||
|
Signer *_subscriber = nullptr;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user