Method Json.opBinaryRight

Performs binary operations between JSON values.

The two JSON values must be of the same run time type or an exception will be thrown. Only the operations listed are allowed for each of the types.

Null
none
Bool
&&, ||
Int
+, -, *, /, %
Float
+, -, *, /, %
String
~
Array
~
Object
none

Prototypes

Json opBinary(string op)(ref const(Json) other)(
  ref const(Json) other
) const;

Json opBinary(string op)(Json other) if (op == "~")(
  Json other
);

void opOpAssign(string op)(Json other) if (op == "+" || op == "-" || op == "*" || op == "/" || op == "%")(
  Json other
);

Json opBinary(string op)(bool other)(
  bool other
) const;

Json opBinary(string op)(long other)(
  long other
) const;

Json opBinary(string op)(double other)(
  double other
) const;

Json opBinary(string op)(string other)(
  string other
) const;

Json opBinary(string op)(Json[] other)(
  Json[] other
);

Json opBinaryRight(string op)(bool other)(
  bool other
) const;

Json opBinaryRight(string op)(long other)(
  long other
) const;

Json opBinaryRight(string op)(double other)(
  double other
) const;

Json opBinaryRight(string op)(string other) if (op == "~")(
  string other
) const;

inout(Json)* opBinaryRight(string op)(string other) if (op == "in")(
  string other
) inout;

Json opBinaryRight(string op)(Json[] other)(
  Json[] other
);

Authors

Sönke Ludwig

Copyright

© 2012 RejectedSoftware e.K.

License

Subject to the terms of the MIT license, as written in the included LICENSE.txt file.