Type Mapping

From Apache OpenOffice Wiki
Jump to: navigation, search

The CLI language binding is intended to run programs that connect to an office and that are written in a CLI compliant language. Therefore, all UNO Types have to be mapped to a CLI type. However, it is not necessary to have mappings for all CLI types unless you intend to interact with arbitrary CLI programs (not UNO components) from UNO (binary UNO). Since we focus on interaction with UNO components, we will restrict the mapping to UNO types. Other mappings might be introduced at a later stage (for example, System.Decimal, indexers, and so on.).

This document only covers the complete mapping of UNO types to CLI.

UNO types will be mapped to types from the Common Type System (CTS). Although some types are not CLS compliant (for example, unsigned types are used), they should be usable from various CLI programming languages.This document will represent CTS types by the respective class from the framework class library, where possible. .NET languages may provide particular build-in types, which can be used instead of those classes. For example, in C# you can use int rather than System.Int32.

Since this type mapping specification targets the CLI as a whole, mappings can be given as IL assembler code. However, for easier understanding, mappings are mostly described by C# examples.

Metadata is provided in IL assembler syntax.

This document refers to the subject of how UNO types are defined in a certain language. This subject is to be regarded as hypothetical, since current implementations of the UNO runtime do not allow for new types to be introduced by language bindings. For example, a component written in C# or Java may contain new types which should be used across the UNO system. Currently, new types have to be provided as binary output of the idlc compiler, which have to be made known to UNO, for example by merging them into a central types.rdb. In a remote scenario, those type binaries must be present in all participating processes.

Content on this page is licensed under the Public Documentation License (PDL).
Personal tools
In other languages