TSDuck v3.40-4163
MPEG Transport Stream Toolkit
Loading...
Searching...
No Matches
ts::json Namespace Reference

Namespace for JSON (JavaScript Object Notation) classes. More...

Classes

class  Array
 Implementation of a JSON array. More...
 
class  False
 Implementation of a JSON false literal. More...
 
class  Null
 Implementation of a JSON null literal. More...
 
class  Number
 Implementation of a JSON number. More...
 
class  Object
 Implementation of a JSON object. More...
 
class  OutputArgs
 Command line arguments for JSON reports (--json, --json-line, --json-udp, --json-tcp). More...
 
class  RunningDocument
 Representation of a "running" JSON document which is displayed on the fly. More...
 
class  String
 Implementation of a JSON string. More...
 
class  True
 Implementation of a JSON true literal. More...
 
class  Value
 Abstract base class of a JSON value. More...
 

Typedefs

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

Enumerations

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

Functions

ValuePtr Bool (bool value)
 Create a boolean JSON value.
 
ValuePtr Factory (Type type, const UString &value=UString())
 Create a JSON value by type.
 
bool IsInlineJSON (const UString &name)
 Check if a "file name" is in fact inline JSON content instead of a file name.
 
bool 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 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 Parse (ValuePtr &value, const UString &text, Report &report=(ts::NullReport::Instance()))
 Parse a JSON value (typically an object or array).
 
bool Parse (ValuePtr &value, const UStringList &lines, Report &report=(ts::NullReport::Instance()))
 Parse a JSON value (typically an object or array).
 
bool Parse (ValuePtr &value, TextParser &parser, bool jsonOnly, Report &report=(ts::NullReport::Instance()))
 Parse a JSON value (typically an object or array).
 
const NamesTypeEnum ()
 Enumeration description of ts::json::Type.
 

Variables

Null NullValue
 A general-purpose null JSON value.
 

Detailed Description

Namespace for JSON (JavaScript Object Notation) classes.

Variable Documentation

◆ NullValue

Null ts::json::NullValue
extern

A general-purpose null JSON value.

This object is not marked as "const" but, like any Null value, all modificaton operations do nothing.