1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

json objects support dumps to string.

This commit is contained in:
winlin 2015-09-19 12:27:31 +08:00
parent b78781707e
commit 3f7e69b617
14 changed files with 729 additions and 761 deletions

View file

@ -112,6 +112,12 @@ public:
* user must ensure the type is a ecma array, or assert failed.
*/
virtual SrsJsonArray* to_array();
// json
public:
/**
* convert the amf0 stuff to json.
*/
virtual std::string to_json();
public:
static SrsJsonAny* str(const char* value = NULL);
static SrsJsonAny* boolean(bool value = false);
@ -145,6 +151,12 @@ public:
virtual std::string key_at(int index);
// @remark: max index is count().
virtual SrsJsonAny* value_at(int index);
// json
public:
/**
* convert the amf0 object to json.
*/
virtual std::string to_json();
public:
virtual void set(std::string key, SrsJsonAny* value);
virtual SrsJsonAny* get_property(std::string name);
@ -171,6 +183,14 @@ public:
// @remark: max index is count().
virtual SrsJsonAny* at(int index);
virtual void add(SrsJsonAny* value);
// alias to add.
virtual void append(SrsJsonAny* value);
// json
public:
/**
* convert the amf0 ecma array to json.
*/
virtual std::string to_json();
};
////////////////////////////////////////////////////////////////////////