#include "tensorstore/json_serialization_options.h"
class tensorstore::JsonSerializationOptions;

Defines options for conversion to/from JSON.

Each individual option is defined by a separate class in order to support a form of named parameters. For example:

auto j = x.ToJson(IncludeDefaults{false});
auto j = x.ToJson({IncludeDefaults{false}, RankConstraint{3}});

Data members

static constexpr bool IsOption<T>;

Indicates if a given type is a supported option.

Constructors

constexpr JsonSerializationOptions(T... option);

Combines any number of supported options.

Methods

constexpr void Set(JsonSerializationOptions value);

Overrides all options.

constexpr void Set(RankConstraint value);

Sets the rank constraint.

constexpr void Set(IncludeDefaults value);

Sets the IncludeDefaults option.

constexpr void Set(DataType value);
constexpr void Set(StaticDataType<T> value);

Sets the data type constraint.

constexpr RankConstraint rank() const;
constexpr operator RankConstraint() const;

Returns the rank constraint.

constexpr DataType dtype() const;
constexpr operator DataType() const;

Returns the data type constraint.

Conversion operators

constexpr operator IncludeDefaults() const;

Returns the IncludeDefaults constraint.