Module: Ole::Types::Variant

### Home Classes Methods

### In Files

- lib/ole/types/base.rb

### Namespace

- MODULE Ole::Types::Variant::Constants

### Methods

- ::dump
- ::load

### Files

- ChangeLog
- README

### Class/Module Index

Quicksearch

- Ole
- Ole::IOMode
- Ole::IOMode::Constants
- Ole::Storage
- Ole::Storage::AllocationTable
- Ole::Storage::AllocationTable::Big
- Ole::Storage::AllocationTable::Small
- Ole::Storage::DirClass
- Ole::Storage::DirClass::Dir
- Ole::Storage::Dirent
- Ole::Storage::FileClass
- Ole::Storage::FileClass::Stat
- Ole::Storage::Header
- Ole::Storage::MetaData
- Ole::Storage::RangesIOMigrateable
- Ole::Storage::RangesIOResizeable
- Ole::Types
- Ole::Types::Clsid
- Ole::Types::Data
- Ole::Types::FileTime
- Ole::Types::Lpstr
- Ole::Types::Lpwstr
- Ole::Types::PropertySet
- Ole::Types::PropertySet::Constants
- Ole::Types::PropertySet::Section
- Ole::Types::Variant
- Ole::Types::Variant::Constants
- RangesIO

No matching classes.

# Ole::Types::Variant

The OLE variant types, extracted from www.marin.clara.net/COM/variant_type_definitions.htm.

A subset is also in WIN32OLE::VARIANT, but its not cross platform (obviously).

Use like:

    p Ole::Types::Variant::NAMES[0x001f] => 'VT_LPWSTR'
    p Ole::Types::VT_DATE # => 7

The serialization / deserialization functions should be fixed to make it easier to work with. like

    Ole::Types.from_str(VT_DATE, data) # and
    Ole::Types.to_str(VT_DATE, data)

Or similar, rather than having to do VT_* <=> ad hoc class name etc as it is currently.

### Constants

CLASS_MAP
NAMES

### Public Class Methods

dump(type, variant) click to toggle source

    # File lib/ole/types/base.rb, line 291
    def self.dump type, variant
      type = NAMES[type] or raise ArgumentError, 'unknown ole type - 0x%04x' % type
      (CLASS_MAP[type] || Data).dump variant
    end

load(type, str) click to toggle source

    # File lib/ole/types/base.rb, line 286
    def self.load type, str
      type = NAMES[type] or raise ArgumentError, 'unknown ole type - 0x%04x' % type
      (CLASS_MAP[type] || Data).load str
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.