SizePol

Members

Functions

fromRepresentation
T fromRepresentation(string value)
Undocumented in source. Be warned that the author may not have intended to support it.
toRepresentation
string toRepresentation(T value)
Undocumented in source. Be warned that the author may not have intended to support it.

Examples

import vson.json;

static struct SizeI {
	int x;
	int y;
}
SizeI sizeI = SizeI(1,2);
Json serializedI = serializeWithPolicy!(JsonSerializer, SizePol)(sizeI);
assert(serializedI.get!string == "1x2");

static struct SizeF {
	float x;
	float y;
}
SizeF sizeF = SizeF(0.1f,0.2f);
Json serializedF = serializeWithPolicy!(JsonSerializer, SizePol)(sizeF);
assert(serializedF.get!string == "0.1x0.2");

Meta