-
Notifications
You must be signed in to change notification settings - Fork 1
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
10 changed files
with
197 additions
and
1,529 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,37 @@ | ||
#pragma once | ||
|
||
#include <QtCore/QString> | ||
#include <QtCore/QProcess> | ||
|
||
bool cmd(const QString& cmd) | ||
{ | ||
auto args = QProcess::splitCommand(cmd); | ||
|
||
QProcess sp; | ||
sp.setProgram(args[0]); | ||
args.erase(args.begin()); | ||
sp.setArguments(args); | ||
sp.start(); | ||
|
||
if (sp.waitForFinished(10000)) | ||
if (sp.exitStatus() == QProcess::NormalExit) | ||
return true; | ||
|
||
return false; | ||
} | ||
|
||
QString cmd2(const QString& cmd) | ||
{ | ||
auto args = QProcess::splitCommand(cmd); | ||
|
||
QProcess sp; | ||
sp.setProgram(args[0]); | ||
args.erase(args.begin()); | ||
sp.setArguments(args); | ||
sp.start(); | ||
|
||
if (sp.waitForFinished(10000)) | ||
return sp.readAll(); | ||
else | ||
throw sp.errorString(); | ||
} |
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 |
---|---|---|
@@ -1,37 +1,38 @@ | ||
#include <string> | ||
#pragma once | ||
|
||
#include <QtCore/QString> | ||
|
||
std::string operator ""_bld (const char* str, size_t) | ||
QString operator ""_bld (const char* str, size_t) | ||
{ | ||
return "<b>" + std::string(str) + "</b>"; | ||
return "<b>" + QString(str) + "</b>"; | ||
} | ||
|
||
std::string operator ""_red (const char* str, size_t) | ||
QString operator ""_red (const char* str, size_t) | ||
{ | ||
return "<font color=red>" + std::string(str) + "</font>"; | ||
return "<font color=red>" + QString(str) + "</font>"; | ||
} | ||
|
||
std::string operator ""_bldred (const char* str, size_t) | ||
QString operator ""_bldred (const char* str, size_t) | ||
{ | ||
return "<font color=red><b>" + std::string(str) + "</b></font>"; | ||
return "<font color=red><b>" + QString(str) + "</b></font>"; | ||
} | ||
|
||
std::string operator ""_grn (const char* str, size_t) | ||
QString operator ""_grn (const char* str, size_t) | ||
{ | ||
return "<font color=green>" + std::string(str) + "</font>"; | ||
return "<font color=green>" + QString(str) + "</font>"; | ||
} | ||
|
||
std::string operator ""_bldgrn (const char* str, size_t) | ||
QString operator ""_bldgrn (const char* str, size_t) | ||
{ | ||
return "<font color=green><b>" + std::string(str) + "</b></font>"; | ||
return "<font color=green><b>" + QString(str) + "</b></font>"; | ||
} | ||
|
||
std::string operator ""_cyn (const char* str, size_t) | ||
QString operator ""_cyn (const char* str, size_t) | ||
{ | ||
return "<font color=cyan>" + std::string(str) + "</font>"; | ||
return "<font color=cyan>" + QString(str) + "</font>"; | ||
} | ||
|
||
std::string operator ""_bldcyn (const char* str, size_t) | ||
QString operator ""_bldcyn (const char* str, size_t) | ||
{ | ||
return "<font color=cyan><b>" + std::string(str) + "</b></font>"; | ||
return "<font color=cyan><b>" + QString(str) + "</b></font>"; | ||
} |
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
Oops, something went wrong.