JsonSerializable Class

  • JsonSerializable
  • class Esri::ArcGISRuntime::JsonSerializable

    Marker interface inherited by classes that support serialization to and from JSON. More...

    This class was introduced in Esri::ArcGISRuntime 100.0.

    Public Functions

    virtual QString toJson() const = 0
    virtual QJsonObject unknownJson() const = 0
    virtual QJsonObject unsupportedJson() const = 0

    Detailed Description

    JsonSerializable is an abstract, pure virtual base class.

    JsonSerializable is a marker interface in that there are four interface methods (toJson, fromJson, unknownJson, and unsupportedJson) but fromJson is not part of the interface due to technical limitations. The fromJson method is static and cannot be overridden by base classes. All classes that inherit from this abstract base class support all four methods.

    QString json = m_licenseInfo.toJson();
    QFile file(QDir::tempPath() + "/licenseFile.txt");
    file.open(QIODevice::WriteOnly);
    file.write(json.toUtf8());
    file.close();

    Member Function Documentation

    [pure virtual] QString JsonSerializable::toJson() const

    Returns this object as a JSON string.

    This is the pure virtual version of this method. It should be implemented by classes that inherit from this interface.

    [pure virtual] QJsonObject JsonSerializable::unknownJson() const

    Returns the unknown JSON from the source JSON.

    Unknown JSON is a JSON object containing the key/value pairs present in the source JSON but were unparsed by the Runtime.

    This is the pure virtual version of this method. It should be implemented by classes that inherit from this interface.

    [pure virtual] QJsonObject JsonSerializable::unsupportedJson() const

    Returns the unsupported data from the source JSON.

    Unsupported JSON is a JSON object containing the key/value pairs present in the source JSON that are supported by web maps, but not exposed through the native Runtime API.

    This is the pure virtual version of this method. It should be implemented by classes that inherit from this interface.

    Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.