yhook: introduce new format for plain output; key=value

Origin commit data
------------------
Commit: 4c679613d6
Author: vanhofen <vanhofen@gmx.de>
Date: 2016-02-20 (Sat, 20 Feb 2016)

Origin message was:
------------------
- yhook: introduce new format for plain output; key=value
This commit is contained in:
vanhofen
2016-02-20 12:06:58 +01:00
parent f3bba7968d
commit a975781295
3 changed files with 19 additions and 10 deletions

View File

@@ -28,6 +28,7 @@ CyhookHandler::CyhookHandler()
Method = M_UNKNOWN;
httpStatus = HTTP_NIL;
outType = plain;
outSingle = false;
LastModified=0;
}
@@ -405,7 +406,8 @@ TOutType CyhookHandler::checkOutput() {
return outType;
}
//-----------------------------------------------------------------------------
TOutType CyhookHandler::outStart() {
TOutType CyhookHandler::outStart(bool single) {
outSingle = single; // for compatibility
// get outType
outType = plain; // plain
if (ParamList["format"] == "json")
@@ -440,7 +442,13 @@ std::string CyhookHandler::outPair(std::string _key, std::string _content, bool
result += "\n";
break;
default:
result = _content;
if (outSingle)
result = _content;
else
{
result = _key + "=" + _content;
result += "\n";
}
break;
}
return result;