Skip to content

JsonSerializable Class

  • JsonSerializable
  • class Esri::ArcGISRuntime::JsonSerializable

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

    Public Functions

    virtual QString toJson() 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.

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