TSDuck v3.40-3963
MPEG Transport Stream Toolkit
Loading...
Searching...
No Matches
tsjson.h File Reference

Simple and basic implementation of a JSON value. More...

Namespaces

namespace  ts
 TSDuck namespace, containing all TSDuck classes and functions.
 
namespace  ts::json
 Namespace for JSON (JavaScript Object Notation) classes.
 

Typedefs

using ts::json::ValuePtr = std::shared_ptr< Value >
 Safe pointer to a JSON value (not thread-safe).
 
using ts::json::ValuePtrList = std::list< ValuePtr >
 A list of safe pointers to JSON values.
 
using ts::json::ValuePtrVector = std::vector< ValuePtr >
 A vector of safe pointers to JSON values.
 

Enumerations

enum class  ts::json::Type {
  ts::json::Null ,
  ts::json::True ,
  ts::json::False ,
  ts::json::String ,
  ts::json::Number ,
  ts::json::Object ,
  ts::json::Array
}
 Definition of the type of a value. More...
 

Functions

ValuePtr ts::json::Bool (bool value)
 Create a boolean JSON value.
 
ValuePtr ts::json::Factory (Type type, const UString &value=UString())
 Create a JSON value by type.
 
bool ts::json::IsInlineJSON (const UString &name)
 Check if a "file name" is in fact inline JSON content instead of a file name.
 
bool ts::json::LoadFile (ValuePtr &value, const UString &filename, Report &report=(ts::NullReport::Instance()))
 Load a JSON value (typically an object or array) from a text file.
 
bool ts::json::LoadStream (ValuePtr &value, std::istream &strm, Report &report=(ts::NullReport::Instance()))
 Load a JSON value (typically an object or array) from an open text stream.
 
bool ts::json::Parse (ValuePtr &value, const UString &text, Report &report=(ts::NullReport::Instance()))
 Parse a JSON value (typically an object or array).
 
bool ts::json::Parse (ValuePtr &value, const UStringList &lines, Report &report=(ts::NullReport::Instance()))
 Parse a JSON value (typically an object or array).
 
bool ts::json::Parse (ValuePtr &value, TextParser &parser, bool jsonOnly, Report &report=(ts::NullReport::Instance()))
 Parse a JSON value (typically an object or array).
 

Variables

const TypeEnumWrapper ts::json::TypeEnum
 Enumeration description of ts::json::Type.
 

Detailed Description

Simple and basic implementation of a JSON value.