mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 00:11:14 +02:00
- yhook: add SendResult() function to simplify result output
This commit is contained in:
@@ -579,3 +579,19 @@ void CyhookHandler::SendError(std::string error) {
|
||||
}
|
||||
Write(result);
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
void CyhookHandler::SendResult(std::string _content) {
|
||||
std::string result = "";
|
||||
switch (outType) {
|
||||
case xml:
|
||||
result = _content;
|
||||
break;
|
||||
case json:
|
||||
result = json_out_success(_content);
|
||||
break;
|
||||
default:
|
||||
result = _content;
|
||||
break;
|
||||
}
|
||||
WriteLn(result);
|
||||
}
|
||||
|
Reference in New Issue
Block a user