1 module introspection.protection; 2 3 4 version(unittest) { 5 import fluent.asserts; 6 } 7 8 /// 9 enum Protection { 10 unknown_, public_, protected_, private_, export_ 11 } 12 13 /// 14 Protection toProtection(string value) { 15 if(value == "public") { 16 return Protection.public_; 17 } 18 19 if(value == "protected") { 20 return Protection.protected_; 21 } 22 23 if(value == "private") { 24 return Protection.private_; 25 } 26 27 if(value == "export") { 28 return Protection.export_; 29 } 30 31 return Protection.unknown_; 32 }