Rantanen / intercom

Object based cross-language FFI for Rust
MIT License
63 stars 7 forks source link

Implement VARIANT support #92

Closed Rantanen closed 5 years ago

Rantanen commented 5 years ago

I was hoping to avoid this, but given it's somewhat of a requirement for SAFEARRAY, which is one of the more obvious choices for collection support in Automation interfaces, I went for it.

Currently I'm using C# for unit tests as that way I get somewhat of a reference implementation from Microsoft for handling Variants on the client side.

The code is also somewhat of a mess with everything piled into variant.rs. This includes the VARIANT_BOOL representation, Microsoft's 1890-epoch date type, etc. And for now most of this is mod raw::. In the end we'll want somewhat sane non-raw wrappers for these things.

Most of the support is built on top of things like From<T> and TryFrom<T>. This will end up somewhat of a mess later, but we'll see how that goes!

codecov-io commented 5 years ago

Codecov Report

Merging #92 into master will increase coverage by 1.71%. The diff coverage is 87.46%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #92      +/-   ##
==========================================
+ Coverage   76.11%   77.83%   +1.71%     
==========================================
  Files          55       57       +2     
  Lines        4066     4809     +743     
==========================================
+ Hits         3095     3743     +648     
- Misses        971     1066      +95
Impacted Files Coverage Δ
intercom-attributes/tests/lib.rs 71.05% <0%> (ø) :arrow_up:
intercom/src/error.rs 24% <0%> (-1.22%) :arrow_down:
intercom/src/comrc.rs 100% <100%> (ø)
intercom-common/src/generators/cpp.rs 81.1% <100%> (+0.12%) :arrow_up:
intercom-common/src/generators/idl.rs 82.43% <100%> (+0.12%) :arrow_up:
intercom/src/combox.rs 85.26% <100%> (+1.56%) :arrow_up:
intercom-common/src/attributes/com_class.rs 100% <100%> (ø) :arrow_up:
intercom/src/lib.rs 73.91% <100%> (+9.2%) :arrow_up:
intercom/src/comitf.rs 65.21% <63.15%> (-8.32%) :arrow_down:
intercom-common/src/tyhandlers.rs 82.03% <83.72%> (+0.44%) :arrow_up:
... and 7 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update aca435c...635e4d4. Read the comment docs.