Scalar value.
Style of the _scalar. If invalid, default _style will be used. If the node was loaded before, previous _style will always be used.
The represented node.
1 struct MyStruct 2 { 3 int x, y, z; 4 5 //Any D:YAML type must have a custom opCmp operator. 6 //This is used for ordering in mappings. 7 const int opCmp(ref const MyStruct s) 8 { 9 if(x != s.x){return x - s.x;} 10 if(y != s.y){return y - s.y;} 11 if(z != s.z){return z - s.z;} 12 return 0; 13 } 14 } 15 16 Node representMyStruct(ref Node node, Representer representer) 17 { 18 auto value = node.as!MyStruct; 19 auto scalar = format("%s:%s:%s", value.x, value.y, value.z); 20 return representer.representScalar("!mystruct.tag", scalar); 21 }
Represent a _scalar with specified _tag.
This is used by representer functions that produce scalars.