mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-28 07:51:11 +02:00
yhook: allow multiple json objects
Origin commit data
------------------
Commit: e89d0433ad
Author: vanhofen <vanhofen@gmx.de>
Date: 2016-02-23 (Tue, 23 Feb 2016)
Origin message was:
------------------
- yhook: allow multiple json objects
This commit is contained in:
@@ -495,7 +495,7 @@ std::string CyhookHandler::outArrayItem(std::string _key, std::string _content,
|
||||
return result;
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
std::string CyhookHandler::outCollection(std::string _key, std::string _content) {
|
||||
std::string CyhookHandler::outCollection(std::string _key, std::string _content, bool _next) {
|
||||
std::string result = "";
|
||||
switch (outType) {
|
||||
case xml:
|
||||
@@ -506,6 +506,8 @@ std::string CyhookHandler::outCollection(std::string _key, std::string _content)
|
||||
case json:
|
||||
//TODO: json check
|
||||
result = outIndent() + "\"" + _key + "\": {" + _content + "}";
|
||||
if(_next)
|
||||
result += ",";
|
||||
result += "\n";
|
||||
break;
|
||||
default:
|
||||
|
@@ -208,7 +208,7 @@ public:
|
||||
std::string outPair(std::string _key, std::string _content, bool _next);
|
||||
std::string outArray(std::string _key, std::string _content);
|
||||
std::string outArrayItem(std::string _key, std::string _content, bool _next);
|
||||
std::string outCollection(std::string _key,std::string _content);
|
||||
std::string outCollection(std::string _key,std::string _content, bool _next = false);
|
||||
std::string outValue(std::string _content);
|
||||
std::string outNext();
|
||||
friend class CyParser;
|
||||
|
Reference in New Issue
Block a user