mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-31 01:11:12 +02:00
- yhook: allow multiple json arrays
This commit is contained in:
@@ -452,7 +452,7 @@ std::string CyhookHandler::outPair(std::string _key, std::string _content, bool
|
|||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
std::string CyhookHandler::outArray(std::string _key, std::string _content) {
|
std::string CyhookHandler::outArray(std::string _key, std::string _content, bool _next) {
|
||||||
std::string result = "";
|
std::string result = "";
|
||||||
switch (outType) {
|
switch (outType) {
|
||||||
case xml:
|
case xml:
|
||||||
@@ -463,6 +463,8 @@ std::string CyhookHandler::outArray(std::string _key, std::string _content) {
|
|||||||
case json:
|
case json:
|
||||||
//TODO: json check
|
//TODO: json check
|
||||||
result = outIndent() + "\"" + _key + "\": [" + _content + "]";
|
result = outIndent() + "\"" + _key + "\": [" + _content + "]";
|
||||||
|
if(_next)
|
||||||
|
result += ",";
|
||||||
result += "\n";
|
result += "\n";
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@@ -206,7 +206,7 @@ public:
|
|||||||
std::string outIndent();
|
std::string outIndent();
|
||||||
std::string outSingle(std::string _content);
|
std::string outSingle(std::string _content);
|
||||||
std::string outPair(std::string _key, std::string _content, bool _next);
|
std::string outPair(std::string _key, std::string _content, bool _next);
|
||||||
std::string outArray(std::string _key, std::string _content);
|
std::string outArray(std::string _key, std::string _content, bool _next = false);
|
||||||
std::string outArrayItem(std::string _key, std::string _content, bool _next);
|
std::string outArrayItem(std::string _key, std::string _content, bool _next);
|
||||||
std::string outObject(std::string _key,std::string _content, bool _next = false);
|
std::string outObject(std::string _key,std::string _content, bool _next = false);
|
||||||
std::string outValue(std::string _content);
|
std::string outValue(std::string _content);
|
||||||
|
Reference in New Issue
Block a user