Adding DynamicConverter support for enums
authorMarcelo Juchem <marcelo@fb.com>
Thu, 3 Mar 2016 21:48:36 +0000 (13:48 -0800)
committerFacebook Github Bot 6 <facebook-github-bot-6-bot@fb.com>
Thu, 3 Mar 2016 21:50:29 +0000 (13:50 -0800)
commit863a22ada1d3e4603576c41578f4201300ec2c61
treed207ae1571a810487c8b37e7cdd9eba4f203f282
parent6a7158dc065115cc1644283aff90f63255059eca
Adding DynamicConverter support for enums

Summary:DynamicConverter doesn't currently support reading enums.
This diff addresses that by adding an enum specialization that uses integers as its underlying implementation.
A follow-up is to handle both integers and strings, but that would require a way to parse strings into enums like Thrift static reflection provides (see https://github.com/facebook/fbthrift/blob/d17b072daddbd318f9afaa5562100eaba0f890e3/thrift/lib/cpp2/fatal/folly_dynamic-inl.h#L88,L92.

Reviewed By: yfeldblum

Differential Revision: D3002569

fb-gh-sync-id: 27bf4a9d5a7844762f5311e2c777606a0e7753f0
shipit-source-id: 27bf4a9d5a7844762f5311e2c777606a0e7753f0
folly/DynamicConverter.h
folly/test/DynamicConverterTest.cpp