1 #include <msp/strings/format.h>
7 void operator>>(const LexicalConverter &conv, IconShape &shape)
9 const string &str = conv.get();
12 else if(str=="Triangle")
14 else if(str=="Square")
16 else if(str=="Diamond")
18 else if(str=="Hexagon")
23 throw lexical_error(format("Conversion of %s to IconShape", str));
26 void operator<<(LexicalConverter &conv, IconShape shape)
30 case CIRCLE: conv.result("Circle"); return;
31 case TRIANGLE: conv.result("Triangle"); return;
32 case SQUARE: conv.result("Square"); return;
33 case DIAMOND: conv.result("Diamond"); return;
34 case HEXAGON: conv.result("Hexagon"); return;
35 case STAR: conv.result("Star"); return;
36 default: conv.result(format("IconShape(%d)", static_cast<int>(shape))); return;