[Libreoffice-commits] core.git: 2 commits - codemaker/Executable_cppumaker.mk codemaker/Executable_javamaker.mk codemaker/inc codemaker/Package_inc.mk codemaker/source codemaker/StaticLibrary_codemaker.mk package/source solenv/gbuild unodevtools/Executable_skeletonmaker.mk unodevtools/source unoidl/inc unoidl/source

Stephan Bergmann sbergman at redhat.com
Tue Apr 9 00:45:03 PDT 2013


 codemaker/Executable_cppumaker.mk                     |    2 
 codemaker/Executable_javamaker.mk                     |    1 
 codemaker/Package_inc.mk                              |    1 
 codemaker/StaticLibrary_codemaker.mk                  |    2 
 codemaker/inc/codemaker/codemaker.hxx                 |   12 
 codemaker/inc/codemaker/commoncpp.hxx                 |   12 
 codemaker/inc/codemaker/commonjava.hxx                |    8 
 codemaker/inc/codemaker/dependencies.hxx              |  148 
 codemaker/inc/codemaker/exceptiontree.hxx             |   27 
 codemaker/inc/codemaker/global.hxx                    |   64 
 codemaker/inc/codemaker/options.hxx                   |   18 
 codemaker/inc/codemaker/typemanager.hxx               |   53 
 codemaker/inc/codemaker/unotype.hxx                   |   48 
 codemaker/source/codemaker/codemaker.cxx              |   24 
 codemaker/source/codemaker/dependencies.cxx           |  273 
 codemaker/source/codemaker/exceptiontree.cxx          |   42 
 codemaker/source/codemaker/global.cxx                 |   16 
 codemaker/source/codemaker/options.cxx                |   15 
 codemaker/source/codemaker/typemanager.cxx            |  180 
 codemaker/source/codemaker/unotype.cxx                |    4 
 codemaker/source/cppumaker/cppumaker.cxx              |  254 
 codemaker/source/cppumaker/cppuoptions.cxx            |   31 
 codemaker/source/cppumaker/cpputype.cxx               | 6107 +++++++-----------
 codemaker/source/cppumaker/cpputype.hxx               |  378 -
 codemaker/source/cppumaker/dependencies.cxx           |  330 
 codemaker/source/cppumaker/dependencies.hxx           |  140 
 codemaker/source/cppumaker/dumputils.cxx              |   54 
 codemaker/source/cppumaker/dumputils.hxx              |   11 
 codemaker/source/cppumaker/includes.cxx               |  100 
 codemaker/source/cppumaker/includes.hxx               |   16 
 codemaker/source/javamaker/classfile.hxx              |   86 
 codemaker/source/javamaker/javamaker.cxx              |   19 
 codemaker/source/javamaker/javatype.cxx               |  304 
 package/source/xstor/ohierarchyholder.cxx             |    2 
 solenv/gbuild/UnoApiTarget.mk                         |    2 
 unodevtools/Executable_skeletonmaker.mk               |    1 
 unodevtools/source/skeletonmaker/cppcompskeleton.cxx  |  144 
 unodevtools/source/skeletonmaker/cpptypemaker.cxx     |   22 
 unodevtools/source/skeletonmaker/javacompskeleton.cxx |    5 
 unodevtools/source/skeletonmaker/javatypemaker.cxx    |   14 
 unodevtools/source/skeletonmaker/skeletoncommon.cxx   |   72 
 unodevtools/source/skeletonmaker/skeletonmaker.cxx    |    2 
 unoidl/inc/unoidl/unoidl.hxx                          |  183 
 unoidl/source/unoidl.cxx                              |   66 
 44 files changed, 4142 insertions(+), 5151 deletions(-)

New commits:
commit 02a8e8acd1f0cbb512868fd9849363f9d069db95
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Mon Apr 8 08:45:37 2013 +0200

    [API CHANGE] WIP: Experimental new binary type.rdb format
    
    Make cppumaker work on top of unoidl/ instead of registry/, as a first step to
    change all the various codemakers.
    
    * API CHANGE: cppumaker no longer supports the -B switch, as that is meaningless
      with the new format.  When reading from an old-format .rdb file, /UCR is
      hard-coded as the prefix now.
    
    * TODO: The new format does not yet support deprecation annotations, so the
      generated .hdl/.hpp files lack any SAL_DEPRECATED_INTERNALs for now.
    
    * codemaker/typemanager.hxx is extended with access to unoidl/ functionality, so
      the various codemakers can use registry/ and unoidl/ in parallel for now.
      The access to registry/ functionality will be removed.  (Added small throwaway
      helper functions u2b/b2u to easily map between OString and OUString at the
      remaining seams for now.)
    
    * Includes a selective revert of ba044b1e9613ed30906a9a540b7da8392923e4e3
      "remove needless forward rtl::OUString declarations" in those parts of
      codemaker, unodevtools, unoidl that were covered by this local
      work-in-progress patch; I would otherwise have hard a hard time re-applying
      it.
    
    * The generated .hdl/.hpp files are mostly unchanged, except for a few minor
      things:
    
    ** Any SAL_DEPRECATED_INTERNALs are missing (see above).
    
    ** In comprehensive getCppuType definitions, some members were erroneously
       classified as TypeCalss_UNKNOWN.
    
    ** In comprehensive getCppuType definitions, some unnecessary calls like
    
         ::cppu::UnoType< ::sal_Int32 >::get();
    
       can be removed.
    
    ** For typedef sequence<X>, the .hdl file need not include X.hdl, but only needs
       to forward-declare it.
    
    ** Unnecessary includes for optional bases of interfaces can be removed.
    
    ** Some numbering of local variable names (sMethodName1, ...) has changed.
    
    Change-Id: Icad98f248ac15177337f1b4ab709a755a8af6238

diff --git a/codemaker/Executable_cppumaker.mk b/codemaker/Executable_cppumaker.mk
index c7437b4..c31d5d2 100644
--- a/codemaker/Executable_cppumaker.mk
+++ b/codemaker/Executable_cppumaker.mk
@@ -32,6 +32,7 @@ $(eval $(call gb_Executable_use_libraries,cppumaker,\
     reg \
     sal \
     salhelper \
+    unoidl \
 ))
 
 $(eval $(call gb_Executable_use_static_libraries,cppumaker,\
@@ -43,6 +44,7 @@ $(eval $(call gb_Executable_add_exception_objects,cppumaker,\
     codemaker/source/cppumaker/cppumaker \
     codemaker/source/cppumaker/cppuoptions \
     codemaker/source/cppumaker/cpputype \
+    codemaker/source/cppumaker/dependencies \
     codemaker/source/cppumaker/dumputils \
     codemaker/source/cppumaker/includes \
 ))
diff --git a/codemaker/Executable_javamaker.mk b/codemaker/Executable_javamaker.mk
index 3db6096..9d55909 100644
--- a/codemaker/Executable_javamaker.mk
+++ b/codemaker/Executable_javamaker.mk
@@ -32,6 +32,7 @@ $(eval $(call gb_Executable_use_libraries,javamaker,\
     reg \
     sal \
     salhelper \
+    unoidl \
 ))
 
 $(eval $(call gb_Executable_use_static_libraries,javamaker,\
diff --git a/codemaker/Package_inc.mk b/codemaker/Package_inc.mk
index 1fa3c14..bb43843 100644
--- a/codemaker/Package_inc.mk
+++ b/codemaker/Package_inc.mk
@@ -30,7 +30,6 @@ $(eval $(call gb_Package_add_file,codemaker_inc,inc/codemaker/codemaker.hxx,code
 $(eval $(call gb_Package_add_file,codemaker_inc,inc/codemaker/commoncpp.hxx,codemaker/commoncpp.hxx))
 $(eval $(call gb_Package_add_file,codemaker_inc,inc/codemaker/commonjava.hxx,codemaker/commonjava.hxx))
 $(eval $(call gb_Package_add_file,codemaker_inc,inc/codemaker/commonjava.hxx,codemaker/commonjava.hxx))
-$(eval $(call gb_Package_add_file,codemaker_inc,inc/codemaker/dependencies.hxx,codemaker/dependencies.hxx))
 $(eval $(call gb_Package_add_file,codemaker_inc,inc/codemaker/exceptiontree.hxx,codemaker/exceptiontree.hxx))
 $(eval $(call gb_Package_add_file,codemaker_inc,inc/codemaker/generatedtypeset.hxx,codemaker/generatedtypeset.hxx))
 $(eval $(call gb_Package_add_file,codemaker_inc,inc/codemaker/global.hxx,codemaker/global.hxx))
diff --git a/codemaker/StaticLibrary_codemaker.mk b/codemaker/StaticLibrary_codemaker.mk
index 9f7f6f0..5cfa3ce 100644
--- a/codemaker/StaticLibrary_codemaker.mk
+++ b/codemaker/StaticLibrary_codemaker.mk
@@ -34,10 +34,10 @@ $(eval $(call gb_StaticLibrary_use_packages,codemaker,\
 	registry_odk_headers \
 	sal_generated \
 	sal_odk_headers \
+	unoidl_inc \
 ))
 
 $(eval $(call gb_StaticLibrary_add_exception_objects,codemaker,\
-	codemaker/source/codemaker/dependencies \
 	codemaker/source/codemaker/exceptiontree \
 	codemaker/source/codemaker/global \
 	codemaker/source/codemaker/options \
diff --git a/codemaker/inc/codemaker/codemaker.hxx b/codemaker/inc/codemaker/codemaker.hxx
index 52ae001..a1c3a14 100644
--- a/codemaker/inc/codemaker/codemaker.hxx
+++ b/codemaker/inc/codemaker/codemaker.hxx
@@ -28,17 +28,21 @@
 
 #include <vector>
 
+namespace rtl {
+    class OString;
+    class OUString;
+}
 class TypeManager;
 
 namespace codemaker {
 
-OString convertString(OUString const & string);
+rtl::OString convertString(rtl::OUString const & string);
 
 codemaker::UnoType::Sort decomposeAndResolve(
-    rtl::Reference< TypeManager > const & manager, OString const & type,
+    rtl::Reference< TypeManager > const & manager, rtl::OString const & type,
     bool resolveTypedefs, bool allowVoid, bool allowExtraEntities,
-    RTTypeClass * typeClass, OString * name, sal_Int32 * rank,
-    std::vector< OString > * arguments);
+    RTTypeClass * typeClass, rtl::OString * name, sal_Int32 * rank,
+    std::vector< rtl::OString > * arguments);
 
 }
 
diff --git a/codemaker/inc/codemaker/commoncpp.hxx b/codemaker/inc/codemaker/commoncpp.hxx
index 4f81f98..3cfd713 100644
--- a/codemaker/inc/codemaker/commoncpp.hxx
+++ b/codemaker/inc/codemaker/commoncpp.hxx
@@ -33,11 +33,11 @@ namespace codemaker { namespace cpp {
     Use common namespace aliases instead of fully specified (nested)
     namespace. currently replaces com::sun::star with css.
  */
-OString scopedCppName(OString const & type, bool ns_alias=true);
+rtl::OString scopedCppName(rtl::OString const & type, bool ns_alias=true);
 
-OString translateUnoToCppType(
+rtl::OString translateUnoToCppType(
     codemaker::UnoType::Sort sort, RTTypeClass typeClass,
-    OString const & nucleus, bool shortname);
+    rtl::OString const & nucleus, bool shortname);
 
 enum IdentifierTranslationMode {
     ITM_GLOBAL,
@@ -45,10 +45,10 @@ enum IdentifierTranslationMode {
     ITM_KEYWORDSONLY
 };
 
-OString translateUnoToCppIdentifier(
-    OString const & identifier, OString const & prefix,
+rtl::OString translateUnoToCppIdentifier(
+    rtl::OString const & identifier, rtl::OString const & prefix,
     IdentifierTranslationMode transmode = ITM_GLOBAL,
-    OString const * forbidden = 0);
+    rtl::OString const * forbidden = 0);
 
 } }
 
diff --git a/codemaker/inc/codemaker/commonjava.hxx b/codemaker/inc/codemaker/commonjava.hxx
index f2e77ee..26c87e1 100644
--- a/codemaker/inc/codemaker/commonjava.hxx
+++ b/codemaker/inc/codemaker/commonjava.hxx
@@ -24,12 +24,12 @@
 
 namespace codemaker { namespace java {
 
-OString translateUnoToJavaType(
+rtl::OString translateUnoToJavaType(
     codemaker::UnoType::Sort sort, RTTypeClass typeClass,
-    OString const & nucleus, bool referenceType);
+    rtl::OString const & nucleus, bool referenceType);
 
-OString translateUnoToJavaIdentifier(
-    OString const & identifier, OString const & prefix);
+rtl::OString translateUnoToJavaIdentifier(
+    rtl::OString const & identifier, rtl::OString const & prefix);
 
 } }
 
diff --git a/codemaker/inc/codemaker/dependencies.hxx b/codemaker/inc/codemaker/dependencies.hxx
deleted file mode 100644
index 47e5e24..0000000
--- a/codemaker/inc/codemaker/dependencies.hxx
+++ /dev/null
@@ -1,148 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#ifndef INCLUDED_CODEMAKER_DEPENDENCIES_HXX
-#define INCLUDED_CODEMAKER_DEPENDENCIES_HXX
-
-#include "sal/config.h"
-
-#include <map>
-
-#include "rtl/ref.hxx"
-#include "rtl/string.hxx"
-#include "rtl/ustring.hxx"
-
-class TypeManager;
-
-/// @HTML
-
-namespace codemaker {
-
-/**
-   A simple class to track which other types a given type depends on.
-
-   <p>This class is not multi-thread–safe.</p>
- */
-class Dependencies {
-public:
-    /**
-       Flags to distinguish whether or not one type depends on another type
-       because the second is a direct base of the first.
-     */
-    enum Kind { KIND_NO_BASE, KIND_BASE };
-
-    typedef std::map< OString, Kind > Map;
-
-    /**
-       Constructs the dependencies for a given type.
-
-       <p>If the given type is not successfully available at the given type
-       manager, <code>isValid()</code> will return <code>false</code>.</p>
-
-       @param manager a type manager, to obtain information about the given type
-
-       @param type the UNO type registry name of an enum type, plain struct
-       type, polymorphic struct type template, exception type, interface type,
-       typedef, module, constant group, service, or singleton
-     */
-    Dependencies(
-        rtl::Reference< TypeManager > const & manager,
-        OString const & type);
-
-    ~Dependencies();
-
-    /**
-       Add a special dependency (which is not obvious from the type's data
-       available at the type manager).
-
-       @param type a UNO type registry name
-     */
-    void add(OString const & type) { insert(type, false); }
-
-    bool isValid() const { return m_valid; }
-
-    Map const & getMap() const { return m_map; }
-
-    bool hasVoidDependency() const { return m_voidDependency; }
-
-    bool hasBooleanDependency() const { return m_booleanDependency; }
-
-    bool hasByteDependency() const { return m_byteDependency; }
-
-    bool hasShortDependency() const { return m_shortDependency; }
-
-    bool hasUnsignedShortDependency() const
-    { return m_unsignedShortDependency; }
-
-    bool hasLongDependency() const { return m_longDependency; }
-
-    bool hasUnsignedLongDependency() const { return m_unsignedLongDependency; }
-
-    bool hasHyperDependency() const { return m_hyperDependency; }
-
-    bool hasUnsignedHyperDependency() const
-    { return m_unsignedHyperDependency; }
-
-    bool hasFloatDependency() const { return m_floatDependency; }
-
-    bool hasDoubleDependency() const { return m_doubleDependency; }
-
-    bool hasCharDependency() const { return m_charDependency; }
-
-    bool hasStringDependency() const { return m_stringDependency; }
-
-    bool hasTypeDependency() const { return m_typeDependency; }
-
-    bool hasAnyDependency() const { return m_anyDependency; }
-
-    bool hasSequenceDependency() const { return m_sequenceDependency; }
-
-private:
-    Dependencies(Dependencies &); // not implemented
-    void operator =(Dependencies); // not implemented
-
-    void insert(OUString const & type, bool base);
-
-    void insert(OString const & type, bool base);
-
-    Map m_map;
-    bool m_valid;
-    bool m_voidDependency;
-    bool m_booleanDependency;
-    bool m_byteDependency;
-    bool m_shortDependency;
-    bool m_unsignedShortDependency;
-    bool m_longDependency;
-    bool m_unsignedLongDependency;
-    bool m_hyperDependency;
-    bool m_unsignedHyperDependency;
-    bool m_floatDependency;
-    bool m_doubleDependency;
-    bool m_charDependency;
-    bool m_stringDependency;
-    bool m_typeDependency;
-    bool m_anyDependency;
-    bool m_sequenceDependency;
-};
-
-}
-
-#endif // INCLUDED_CODEMAKER_DEPENDENCIES_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/codemaker/inc/codemaker/exceptiontree.hxx b/codemaker/inc/codemaker/exceptiontree.hxx
index 91a0cae..5392386 100644
--- a/codemaker/inc/codemaker/exceptiontree.hxx
+++ b/codemaker/inc/codemaker/exceptiontree.hxx
@@ -37,7 +37,7 @@ struct ExceptionTreeNode {
     typedef std::vector< ExceptionTreeNode * > Children;
 
     // Internally used by ExceptionTree:
-    ExceptionTreeNode(OString const & theName):
+    ExceptionTreeNode(rtl::OString const & theName):
         name(theName), present(false) {}
 
     // Internally used by ExceptionTree:
@@ -47,9 +47,9 @@ struct ExceptionTreeNode {
     void setPresent() { present = true; clearChildren(); }
 
     // Internally used by ExceptionTree:
-    ExceptionTreeNode * add(OString const & theName);
+    ExceptionTreeNode * add(rtl::OString const & theName);
 
-    OString name;
+    rtl::OString name;
     bool present;
     Children children;
 
@@ -69,15 +69,15 @@ private:
    subtypes that are hidden by supertypes are pruned from the hierarchy).  The
    exception com.sun.star.uno.RuntimeException and its subtypes are pruned
    completely from the hierarchy.  Each node of the hierarchy is represented by
-   an instance of ExceptionTreeNode, where name gives the slashified name of
-   the UNO exception type, present is true iff the given exception type is a
-   member of the set S, and children contains all the relevant direct subtypes
-   of the given exception type, in no particular order (for nodes other than the
-   root node it holds that children is non-empty iff present is false).
+   an instance of ExceptionTreeNode, where name gives the name of the UNO
+   exception type, present is true iff the given exception type is a member of
+   the set S, and children contains all the relevant direct subtypes of the
+   given exception type, in no particular order (for nodes other than the root
+   node it holds that children is non-empty iff present is false).
  */
 class ExceptionTree {
 public:
-    ExceptionTree(): m_root("com/sun/star/uno/Exception") {}
+    ExceptionTree(): m_root("com.sun.star.uno.Exception") {}
 
     ~ExceptionTree() {}
 
@@ -86,17 +86,16 @@ public:
 
        This function can be called more than once for the same exception name.
 
-       @param name the name of a UNO exception type, in slashified form; it is
-       an error if the given name does not represent a UNO exception type
+       @param name the name of a UNO exception type; it is an error if the given
+       name does not represent a UNO exception type
 
        @param manager a type manager, used to resolve type names; it is an error
        if different calls to this member function use different, incompatible
        type managers
      */
     void add(
-        OString const & name,
-        rtl::Reference< TypeManager > const & manager)
-        throw( CannotDumpException );
+        rtl::OString const & name,
+        rtl::Reference< TypeManager > const & manager);
 
     /**
        Gives access to the resultant exception hierarchy.
diff --git a/codemaker/inc/codemaker/global.hxx b/codemaker/inc/codemaker/global.hxx
index 891ed47..2c61ce8 100644
--- a/codemaker/inc/codemaker/global.hxx
+++ b/codemaker/inc/codemaker/global.hxx
@@ -32,7 +32,7 @@
 
 struct EqualString
 {
-    sal_Bool operator()(const OString& str1, const OString& str2) const
+    sal_Bool operator()(const ::rtl::OString& str1, const ::rtl::OString& str2) const
     {
         return (str1 == str2);
     }
@@ -40,7 +40,7 @@ struct EqualString
 
 struct HashString
 {
-    size_t operator()(const OString& str) const
+    size_t operator()(const ::rtl::OString& str) const
     {
         return str.hashCode();
     }
@@ -48,15 +48,15 @@ struct HashString
 
 struct LessString
 {
-    sal_Bool operator()(const OString& str1, const OString& str2) const
+    sal_Bool operator()(const ::rtl::OString& str1, const ::rtl::OString& str2) const
     {
         return (str1 < str2);
     }
 };
 
-typedef ::std::list< OString >               StringList;
-typedef ::std::vector< OString >             StringVector;
-typedef ::std::set< OString, LessString >    StringSet;
+typedef ::std::list< ::rtl::OString >               StringList;
+typedef ::std::vector< ::rtl::OString >             StringVector;
+typedef ::std::set< ::rtl::OString, LessString >    StringSet;
 
 //*************************************************************************
 // FileStream
@@ -77,58 +77,58 @@ public:
 
     sal_Bool isValid();
 
-    void createTempFile(const OString& sPath);
+    void createTempFile(const ::rtl::OString& sPath);
     void close();
 
-    OString  getName() { return m_name; }
+    ::rtl::OString  getName() { return m_name; }
 
     bool write(void const * buffer, sal_uInt64 size);
 
     // friend functions
     friend FileStream &operator<<(FileStream& o, sal_uInt32 i);
     friend FileStream &operator<<(FileStream& o, char const * s);
-    friend FileStream &operator<<(FileStream& o, OString* s);
-    friend FileStream &operator<<(FileStream& o, const OString& s);
-    friend FileStream &operator<<(FileStream& o, OStringBuffer* s);
-    friend FileStream &operator<<(FileStream& o, const OStringBuffer& s);
+    friend FileStream &operator<<(FileStream& o, ::rtl::OString* s);
+    friend FileStream &operator<<(FileStream& o, const ::rtl::OString& s);
+    friend FileStream &operator<<(FileStream& o, ::rtl::OStringBuffer* s);
+    friend FileStream &operator<<(FileStream& o, const ::rtl::OStringBuffer& s);
+    friend FileStream & operator <<(FileStream & out, rtl::OUString const & s);
 
 private:
     oslFileHandle m_file;
-    OString  m_name;
+    ::rtl::OString  m_name;
 };
 
 
 //*************************************************************************
 // Helper functions
 //*************************************************************************
-OString getTempDir(const OString& sFileName);
+::rtl::OString getTempDir(const ::rtl::OString& sFileName);
 
-OString createFileNameFromType(const OString& destination,
-                                      const OString type,
-                                      const OString postfix,
+::rtl::OString createFileNameFromType(const ::rtl::OString& destination,
+                                      const ::rtl::OString type,
+                                      const ::rtl::OString postfix,
                                       sal_Bool bLowerCase=sal_False,
-                                      const OString prefix="");
+                                      const ::rtl::OString prefix="");
 
-sal_Bool fileExists(const OString& fileName);
-sal_Bool makeValidTypeFile(const OString& targetFileName,
-                           const OString& tmpFileName,
+sal_Bool fileExists(const ::rtl::OString& fileName);
+sal_Bool makeValidTypeFile(const ::rtl::OString& targetFileName,
+                           const ::rtl::OString& tmpFileName,
                            sal_Bool bFileCheck);
-sal_Bool removeTypeFile(const OString& fileName);
+sal_Bool removeTypeFile(const ::rtl::OString& fileName);
 
-OUString convertToFileUrl(const OString& fileName);
+::rtl::OUString convertToFileUrl(const ::rtl::OString& fileName);
 
-//*************************************************************************
-// Global exception to signal problems when a type cannot be dumped
-//*************************************************************************
-class CannotDumpException
-{
+class CannotDumpException {
 public:
-    CannotDumpException(const OString& msg)
-        : m_message(msg) {}
+    CannotDumpException(OUString const & message): message_(message) {}
 
-    OString  m_message;
-};
+    virtual ~CannotDumpException() throw ();
 
+    OUString getMessage() const { return message_; }
+
+private:
+    OUString message_;
+};
 
 #endif // INCLUDED_CODEMAKER_GLOBAL_HXX
 
diff --git a/codemaker/inc/codemaker/options.hxx b/codemaker/inc/codemaker/options.hxx
index 053cda9..4a33e28 100644
--- a/codemaker/inc/codemaker/options.hxx
+++ b/codemaker/inc/codemaker/options.hxx
@@ -26,8 +26,8 @@
 
 typedef ::boost::unordered_map
 <
-    OString,
-    OString,
+    ::rtl::OString,
+    ::rtl::OString,
     HashString,
     EqualString
 > OptionMap;
@@ -35,10 +35,10 @@ typedef ::boost::unordered_map
 class IllegalArgument
 {
 public:
-    IllegalArgument(const OString& msg)
+    IllegalArgument(const ::rtl::OString& msg)
         : m_message(msg) {}
 
-    OString  m_message;
+    ::rtl::OString  m_message;
 };
 
 class Options
@@ -50,11 +50,11 @@ public:
     virtual sal_Bool initOptions(int ac, char* av[], sal_Bool bCmdFile=sal_False)
         throw( IllegalArgument ) = 0;
 
-    virtual OString  prepareHelp() = 0;
+    virtual ::rtl::OString  prepareHelp() = 0;
 
-    const OString&   getProgramName() const;
-    sal_Bool                isValid(const OString& option);
-    const OString    getOption(const OString& option)
+    const ::rtl::OString&   getProgramName() const;
+    sal_Bool                isValid(const ::rtl::OString& option) const;
+    const ::rtl::OString    getOption(const ::rtl::OString& option) const
         throw( IllegalArgument );
 
     const StringVector& getInputFiles();
@@ -64,7 +64,7 @@ public:
     inline const StringVector& getExtraInputFiles() const
         { return m_extra_input_files; }
 protected:
-    OString  m_program;
+    ::rtl::OString  m_program;
     StringVector    m_inputFiles;
     StringVector    m_extra_input_files;
     OptionMap       m_options;
diff --git a/codemaker/inc/codemaker/typemanager.hxx b/codemaker/inc/codemaker/typemanager.hxx
index 886aee5..325a510 100644
--- a/codemaker/inc/codemaker/typemanager.hxx
+++ b/codemaker/inc/codemaker/typemanager.hxx
@@ -21,14 +21,23 @@
 #define INCLUDED_CODEMAKER_TYPEMANAGER_HXX
 
 #include "codemaker/global.hxx"
+#include "codemaker/unotype.hxx"
 #include "registry/registry.hxx"
 #include "registry/types.h"
+#include "rtl/ref.hxx"
 #include "salhelper/simplereferenceobject.hxx"
 
 #include <boost/unordered_map.hpp>
 #include <list>
+#include <vector>
 
 namespace typereg { class Reader; }
+namespace unoidl {
+    class Entity;
+    class Manager;
+    class MapCursor;
+    class Provider;
+}
 
 //typedef ::std::list< Registry* >  RegistryList;
 typedef ::std::vector< Registry* >  RegistryList;
@@ -37,7 +46,7 @@ typedef ::std::vector< KeyPair >    RegistryKeyList;
 
 typedef ::boost::unordered_map
 <
-    OString, // Typename
+    ::rtl::OString, // Typename
     RTTypeClass,    // TypeClass
     HashString,
     EqualString
@@ -50,40 +59,60 @@ public:
 
     sal_Bool init(const StringVector& regFiles, const StringVector& extraFiles = StringVector() );
 
-    OString getTypeName(RegistryKey& rTypeKey) const;
+    ::rtl::OString getTypeName(RegistryKey& rTypeKey) const;
 
-    sal_Bool    isValidType(const OString& name) const
+    sal_Bool    isValidType(const ::rtl::OString& name) const
         { return searchTypeKey(name, 0).isValid(); }
     RegistryKey getTypeKey(
-        const OString& name, sal_Bool * pIsExtraType = 0 ) const
+        const ::rtl::OString& name, sal_Bool * pIsExtraType = 0 ) const
         { return searchTypeKey(name, pIsExtraType); }
-    RegistryKeyList getTypeKeys(const OString& name) const;
+    RegistryKeyList getTypeKeys(const ::rtl::OString& name) const;
     typereg::Reader getTypeReader(
-        const OString& name, sal_Bool * pIsExtraType = 0 ) const;
+        const ::rtl::OString& name, sal_Bool * pIsExtraType = 0 ) const;
     typereg::Reader getTypeReader(RegistryKey& rTypeKey) const;
-    RTTypeClass getTypeClass(const OString& name) const;
+    RTTypeClass getTypeClass(const ::rtl::OString& name) const;
     RTTypeClass getTypeClass(RegistryKey& rTypeKey) const;
 
-    void setBase(const OString& base);
-    OString getBase() const { return m_base; }
+    void setBase(const ::rtl::OString& base);
+    ::rtl::OString getBase() const { return m_base; }
 
     sal_Int32 getSize() const { return m_t2TypeClass.size(); }
 
-    static sal_Bool isBaseType(const OString& name);
+
+    void loadProvider(rtl::OUString const & uri, bool primary);
+
+    bool foundAtPrimaryProvider(rtl::OUString const & name) const;
+
+    codemaker::UnoType::Sort getSort(
+        rtl::OUString const & name,
+        rtl::Reference< unoidl::Entity > * entity = 0,
+        rtl::Reference< unoidl::MapCursor > * cursor = 0) const;
 
 private:
     virtual ~TypeManager();
 
     RegistryKey searchTypeKey(
-        const OString& name, sal_Bool * pIsExtraType = 0 ) const;
+        const ::rtl::OString& name, sal_Bool * pIsExtraType = 0 ) const;
     void        freeRegistries();
 
     mutable T2TypeClassMap m_t2TypeClass;
     RegistryList    m_registries;
     RegistryList    m_extra_registries;
-    OString  m_base;
+    ::rtl::OString  m_base;
+
+    rtl::Reference< unoidl::Manager > manager_;
+    std::vector< rtl::Reference< unoidl::Provider > > primaryProviders_;
 };
 
+
+inline rtl::OString u2b(rtl::OUString const & s) {
+    return rtl::OUStringToOString(s, RTL_TEXTENCODING_UTF8);
+}
+
+inline rtl::OUString b2u(rtl::OString const & s) {
+    return rtl::OStringToOUString(s, RTL_TEXTENCODING_UTF8);
+}
+
 #endif // INCLUDED_CODEMAKER_TYPEMANAGER_HXX
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/codemaker/inc/codemaker/unotype.hxx b/codemaker/inc/codemaker/unotype.hxx
index ce22e62..6d6038e 100644
--- a/codemaker/inc/codemaker/unotype.hxx
+++ b/codemaker/inc/codemaker/unotype.hxx
@@ -21,17 +21,16 @@
 #define INCLUDED_CODEMAKER_UNOTYPE_HXX
 
 #include "sal/types.h"
-#include <rtl/ustring.hxx>
 
 #include <vector>
 
+namespace rtl { class OString; }
+
 namespace codemaker {
 
 namespace UnoType {
     /**
-       An enumeration of all the sorts of UNO types.
-
-       All complex UNO types are subsumed under SORT_COMPLEX.
+       An enumeration of all the sorts of relevant UNOIDL entities.
      */
     enum Sort {
         SORT_VOID,
@@ -49,10 +48,26 @@ namespace UnoType {
         SORT_STRING,
         SORT_TYPE,
         SORT_ANY,
-        SORT_COMPLEX
+
+        SORT_SEQUENCE_TYPE,
+        SORT_MODULE,
+        SORT_ENUM_TYPE,
+        SORT_PLAIN_STRUCT_TYPE,
+        SORT_POLYMORPHIC_STRUCT_TYPE_TEMPLATE,
+        SORT_INSTANTIATED_POLYMORPHIC_STRUCT_TYPE,
+        SORT_EXCEPTION_TYPE,
+        SORT_INTERFACE_TYPE,
+        SORT_TYPEDEF,
+        SORT_CONSTANT_GROUP,
+        SORT_SINGLE_INTERFACE_BASED_SERVICE,
+        SORT_ACCUMULATION_BASED_SERVICE,
+        SORT_INTERFACE_BASED_SINGLETON,
+        SORT_SERVICE_BASED_SINGLETON
+
+        ,SORT_COMPLEX=SORT_SEQUENCE_TYPE //TODO
     };
 
-    /**
+    /** TODO
        Maps from a binary UNO type name or UNO type registry name to its type
        sort.
 
@@ -63,20 +78,9 @@ namespace UnoType {
        is a UNO type registry name that denotes something other than a UNO type,
        SORT_COMPLEX is returned)
      */
-    Sort getSort(OString const & type);
-
-    /**
-       Determines whether a UNO type name or UNO type registry name denotes a
-       UNO sequence type.
+    Sort getSort(rtl::OString const & type);
 
-       @param type a binary UNO type name or UNO type registry name
-
-       @return true iff the given type denotes a UNO sequence type; the
-       detection is purely syntactical
-     */
-    bool isSequenceType(OString const & type);
-
-    /**
+    /** TODO
        Decomposes a UNO type name or UNO type registry name.
 
        @param type a binary UNO type name or UNO type registry name
@@ -91,9 +95,9 @@ namespace UnoType {
 
        @return the base part of the given type
      */
-    OString decompose(
-        OString const & type, sal_Int32 * rank = 0,
-        std::vector< OString > * arguments = 0);
+    rtl::OString decompose(
+        rtl::OString const & type, sal_Int32 * rank = 0,
+        std::vector< rtl::OString > * arguments = 0);
 }
 
 }
diff --git a/codemaker/source/codemaker/codemaker.cxx b/codemaker/source/codemaker/codemaker.cxx
index 0412e36..2ed28e1 100644
--- a/codemaker/source/codemaker/codemaker.cxx
+++ b/codemaker/source/codemaker/codemaker.cxx
@@ -39,7 +39,7 @@
 
 namespace {
 
-void checkNoTypeArguments(std::vector< OString > const & arguments) {
+void checkNoTypeArguments(std::vector< rtl::OString > const & arguments) {
     if (!arguments.empty()) {
         throw CannotDumpException("Bad type information");
             //TODO
@@ -50,8 +50,8 @@ void checkNoTypeArguments(std::vector< OString > const & arguments) {
 
 namespace codemaker {
 
-OString convertString(OUString const & string) {
-    OString s;
+rtl::OString convertString(rtl::OUString const & string) {
+    rtl::OString s;
     if (!string.convertToString(
             &s, RTL_TEXTENCODING_UTF8,
             (RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR
@@ -63,18 +63,18 @@ OString convertString(OUString const & string) {
 }
 
 codemaker::UnoType::Sort decomposeAndResolve(
-    rtl::Reference< TypeManager > const & manager, OString const & type,
+    rtl::Reference< TypeManager > const & manager, rtl::OString const & type,
     bool resolveTypedefs, bool allowVoid, bool allowExtraEntities,
-    RTTypeClass * typeClass, OString * name, sal_Int32 * rank,
-    std::vector< OString > * arguments)
+    RTTypeClass * typeClass, rtl::OString * name, sal_Int32 * rank,
+    std::vector< rtl::OString > * arguments)
 {
     OSL_ASSERT(typeClass != 0 && name != 0 && rank != 0 && arguments != 0);
     *rank = 0;
-    for (OString t(type);;) {
+    for (rtl::OString t(type);;) {
         sal_Int32 n = 0;
         *name = codemaker::UnoType::decompose(t, &n, arguments);
         if (n > SAL_MAX_INT32 - *rank) {
-            throw CannotDumpException("Bad type information: " + type);
+            throw CannotDumpException("Bad type information: " + b2u(type));
             //TODO
         }
         *rank += n;
@@ -86,7 +86,7 @@ codemaker::UnoType::Sort decomposeAndResolve(
         switch (sort) {
         case codemaker::UnoType::SORT_VOID:
             if (!allowVoid) {
-                throw CannotDumpException("Bad type information: " + type);
+                throw CannotDumpException("Bad type information: " + b2u(type));
                 //TODO
             }
         default:
@@ -109,7 +109,7 @@ codemaker::UnoType::Sort decomposeAndResolve(
                         || (static_cast< sal_uInt16 >(arguments->size())
                             != reader.getReferenceCount())))
                 {
-                    throw CannotDumpException("Bad type information: " + type);
+                    throw CannotDumpException("Bad type information: " + b2u(type));
                     //TODO
                 }
                 return sort;
@@ -120,7 +120,7 @@ codemaker::UnoType::Sort decomposeAndResolve(
             case RT_TYPE_SINGLETON:
             case RT_TYPE_CONSTANTS:
                 if (!allowExtraEntities) {
-                    throw CannotDumpException("Bad type information: " + type);
+                    throw CannotDumpException("Bad type information: " + b2u(type));
                     //TODO
                 }
                 checkNoTypeArguments(*arguments);
@@ -142,7 +142,7 @@ codemaker::UnoType::Sort decomposeAndResolve(
                     }
                 }
             default:
-                throw CannotDumpException("Bad type information: " + type);
+                throw CannotDumpException("Bad type information: " + b2u(type));
                 //TODO
             }
         }
diff --git a/codemaker/source/codemaker/dependencies.cxx b/codemaker/source/codemaker/dependencies.cxx
deleted file mode 100644
index 143dc98..0000000
--- a/codemaker/source/codemaker/dependencies.cxx
+++ /dev/null
@@ -1,273 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-
-#include "codemaker/dependencies.hxx"
-
-#include "codemaker/typemanager.hxx"
-#include "codemaker/unotype.hxx"
-
-#include "osl/diagnose.h"
-#include "registry/reader.hxx"
-#include "rtl/string.hxx"
-#include "rtl/textcvt.h"
-#include "rtl/textenc.h"
-#include "rtl/ustring.hxx"
-#include "sal/types.h"
-
-#include <vector>
-
-using codemaker::Dependencies;
-
-namespace {
-
-struct Bad {};
-
-}
-
-Dependencies::Dependencies(
-    rtl::Reference< TypeManager > const & manager, OString const & type):
-    m_voidDependency(false), m_booleanDependency(false),
-    m_byteDependency(false), m_shortDependency(false),
-    m_unsignedShortDependency(false), m_longDependency(false),
-    m_unsignedLongDependency(false), m_hyperDependency(false),
-    m_unsignedHyperDependency(false), m_floatDependency(false),
-    m_doubleDependency(false), m_charDependency(false),
-    m_stringDependency(false), m_typeDependency(false), m_anyDependency(false),
-    m_sequenceDependency(false)
-{
-    typereg::Reader reader(manager->getTypeReader(type));
-    m_valid = reader.isValid();
-    if (m_valid) {
-        // Not everything is checked for consistency, just things that are cheap
-        // to test:
-        try {
-            RTTypeClass tc = reader.getTypeClass();
-            if (tc != RT_TYPE_SERVICE) {
-                for (sal_Int16 i = 0; i < reader.getSuperTypeCount(); ++i) {
-                    insert(reader.getSuperTypeName(i), true);
-                }
-            }
-            if (tc != RT_TYPE_ENUM) {
-                for (sal_Int16 i = 0; i < reader.getFieldCount(); ++i) {
-                    if ((reader.getFieldFlags(i) & RT_ACCESS_PARAMETERIZED_TYPE)
-                        == 0)
-                    {
-                        insert(reader.getFieldTypeName(i), false);
-                    }
-                }
-            }
-            for (sal_Int16 i = 0; i < reader.getMethodCount(); ++i) {
-                insert(reader.getMethodReturnTypeName(i), false);
-                for (sal_Int16 j = 0; j < reader.getMethodParameterCount(i);
-                      ++j)
-                {
-                    if ((reader.getMethodParameterFlags(i, j) & RT_PARAM_REST)
-                        != 0)
-                    {
-                        m_sequenceDependency = true;
-                    }
-                    insert(reader.getMethodParameterTypeName(i, j), false);
-                }
-                for (sal_Int16 j = 0; j < reader.getMethodExceptionCount(i);
-                      ++j)
-                {
-                    insert(reader.getMethodExceptionTypeName(i, j), false);
-                }
-            }
-            for (sal_Int16 i = 0; i < reader.getReferenceCount(); ++i) {
-                if (reader.getReferenceSort(i) != RT_REF_TYPE_PARAMETER) {
-                    insert(reader.getReferenceTypeName(i), false);
-                }
-            }
-        } catch (Bad &) {
-            m_map.clear();
-            m_valid = false;
-            m_voidDependency = false;
-            m_booleanDependency = false;
-            m_byteDependency = false;
-            m_shortDependency = false;
-            m_unsignedShortDependency = false;
-            m_longDependency = false;
-            m_unsignedLongDependency = false;
-            m_hyperDependency = false;
-            m_unsignedHyperDependency = false;
-            m_floatDependency = false;
-            m_doubleDependency = false;
-            m_charDependency = false;
-            m_stringDependency = false;
-            m_typeDependency = false;
-            m_anyDependency = false;
-            m_sequenceDependency = false;
-        }
-    }
-}
-
-Dependencies::~Dependencies()
-{}
-
-void Dependencies::insert(OUString const & type, bool base) {
-    OString t;
-    if (!type.convertToString(
-            &t, RTL_TEXTENCODING_UTF8,
-            (RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR
-             | RTL_UNICODETOTEXT_FLAGS_INVALID_ERROR)))
-    {
-        throw Bad();
-    }
-    insert(t, base);
-}
-
-void Dependencies::insert(OString const & type, bool base) {
-    sal_Int32 rank;
-    std::vector< OString > args;
-    OString t(UnoType::decompose(type, &rank, &args));
-    if (rank > 0) {
-        m_sequenceDependency = true;
-    }
-    switch (UnoType::getSort(t)) {
-    case UnoType::SORT_VOID:
-        if (rank != 0 || !args.empty()) {
-            throw Bad();
-        }
-        m_voidDependency = true;
-        break;
-
-    case UnoType::SORT_BOOLEAN:
-        if (!args.empty()) {
-            throw Bad();
-        }
-        m_booleanDependency = true;
-        break;
-
-    case UnoType::SORT_BYTE:
-        if (!args.empty()) {
-            throw Bad();
-        }
-        m_byteDependency = true;
-        break;
-
-    case UnoType::SORT_SHORT:
-        if (!args.empty()) {
-            throw Bad();
-        }
-        m_shortDependency = true;
-        break;
-
-    case UnoType::SORT_UNSIGNED_SHORT:
-        if (!args.empty()) {
-            throw Bad();
-        }
-        m_unsignedShortDependency = true;
-        break;
-
-    case UnoType::SORT_LONG:
-        if (!args.empty()) {
-            throw Bad();
-        }
-        m_longDependency = true;
-        break;
-
-    case UnoType::SORT_UNSIGNED_LONG:
-        if (!args.empty()) {
-            throw Bad();
-        }
-        m_unsignedLongDependency = true;
-        break;
-
-    case UnoType::SORT_HYPER:
-        if (!args.empty()) {
-            throw Bad();
-        }
-        m_hyperDependency = true;
-        break;
-
-    case UnoType::SORT_UNSIGNED_HYPER:
-        if (!args.empty()) {
-            throw Bad();
-        }
-        m_unsignedHyperDependency = true;
-        break;
-
-    case UnoType::SORT_FLOAT:
-        if (!args.empty()) {
-            throw Bad();
-        }
-        m_floatDependency = true;
-        break;
-
-    case UnoType::SORT_DOUBLE:
-        if (!args.empty()) {
-            throw Bad();
-        }
-        m_doubleDependency = true;
-        break;
-
-    case UnoType::SORT_CHAR:
-        if (!args.empty()) {
-            throw Bad();
-        }
-        m_charDependency = true;
-        break;
-
-    case UnoType::SORT_STRING:
-        if (!args.empty()) {
-            throw Bad();
-        }
-        m_stringDependency = true;
-        break;
-
-    case UnoType::SORT_TYPE:
-        if (!args.empty()) {
-            throw Bad();
-        }
-        m_typeDependency = true;
-        break;
-
-    case UnoType::SORT_ANY:
-        if (!args.empty()) {
-            throw Bad();
-        }
-        m_anyDependency = true;
-        break;
-
-    case UnoType::SORT_COMPLEX:
-        {
-            for (std::vector< OString >::iterator i(args.begin());
-                 i != args.end(); ++i)
-            {
-                insert(*i, false);
-            }
-            Map::iterator i(m_map.find(t));
-            if (i == m_map.end()) {
-                m_map.insert(
-                    Map::value_type(t, base ? KIND_BASE : KIND_NO_BASE));
-            } else if (base) {
-                i->second = KIND_BASE;
-            }
-            break;
-        }
-
-    default:
-        OSL_ASSERT(false);
-        break;
-    }
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/codemaker/source/codemaker/exceptiontree.cxx b/codemaker/source/codemaker/exceptiontree.cxx
index 1b4915b..f8dd868 100644
--- a/codemaker/source/codemaker/exceptiontree.cxx
+++ b/codemaker/source/codemaker/exceptiontree.cxx
@@ -22,11 +22,11 @@
 #include "codemaker/typemanager.hxx"
 
 #include "osl/diagnose.h"
-#include "registry/reader.hxx"
-#include "registry/types.h"
+#include "rtl/ref.hxx"
 #include "rtl/string.hxx"
 #include "rtl/textenc.h"
 #include "rtl/ustring.hxx"
+#include "unoidl/unoidl.hxx"
 
 #include <memory>
 #include <vector>
@@ -34,7 +34,7 @@
 using codemaker::ExceptionTree;
 using codemaker::ExceptionTreeNode;
 
-ExceptionTreeNode * ExceptionTreeNode::add(OString const & theName) {
+ExceptionTreeNode * ExceptionTreeNode::add(rtl::OString const & theName) {
     std::auto_ptr< ExceptionTreeNode > node(new ExceptionTreeNode(theName));
     children.push_back(node.get());
     return node.release();
@@ -48,34 +48,30 @@ void ExceptionTreeNode::clearChildren() {
 }
 
 void ExceptionTree::add(
-    OString const & name, rtl::Reference< TypeManager > const & manager)
-    throw( CannotDumpException )
+    rtl::OString const & name, rtl::Reference< TypeManager > const & manager)
 {
-    typedef std::vector< OString > OStringList;
-    OStringList stringlist;
+    std::vector< rtl::OString > list;
     bool runtimeException = false;
-    for (OString n(name); n != "com/sun/star/uno/Exception";) {
-        if (n == "com/sun/star/uno/RuntimeException") {
+    for (rtl::OString n(name); n != "com.sun.star.uno.Exception";) {
+        if (n == "com.sun.star.uno.RuntimeException") {
             runtimeException = true;
             break;
         }
-        stringlist.push_back(n);
-        typereg::Reader reader(manager->getTypeReader(n));
-        if (!reader.isValid())
-            throw CannotDumpException(
-                OString("Unknown type '" + n.replace('/', '.')
-                               + "', incomplete type library."));
-
-        OSL_ASSERT(
-            reader.getTypeClass() == RT_TYPE_EXCEPTION
-            && reader.getSuperTypeCount() == 1);
-        n = OUStringToOString(
-            reader.getSuperTypeName(0), RTL_TEXTENCODING_UTF8);
+        list.push_back(n);
+        rtl::Reference< unoidl::Entity > ent;
+        codemaker::UnoType::Sort s = manager->getSort(b2u(n), &ent);
+        assert(s == codemaker::UnoType::SORT_EXCEPTION_TYPE);
+        n = u2b(
+            static_cast< unoidl::ExceptionTypeEntity * >(ent.get())->
+            getDirectBase());
+        assert(!n.isEmpty());
     }
     if (!runtimeException) {
         ExceptionTreeNode * node = &m_root;
-        for (OStringList::reverse_iterator i(stringlist.rbegin()); !node->present; ++i) {
-            if (i == stringlist.rend()) {
+        for (std::vector< rtl::OString >::reverse_iterator i(list.rbegin());
+             !node->present; ++i)
+        {
+            if (i == list.rend()) {
                 node->setPresent();
                 break;
             }
diff --git a/codemaker/source/codemaker/global.cxx b/codemaker/source/codemaker/global.cxx
index 2630ee8..34c43a9 100644
--- a/codemaker/source/codemaker/global.cxx
+++ b/codemaker/source/codemaker/global.cxx
@@ -68,7 +68,7 @@ OString createFileNameFromType( const OString& destination,
                                 sal_Bool bLowerCase,
                                 const OString prefix )
 {
-    OString type(typeName);
+    OString type(typeName.replace('.', '/'));
 
     if (bLowerCase)
     {
@@ -364,27 +364,33 @@ FileStream &operator<<(FileStream& o, char const * s) {
     osl_writeFile(o.m_file, s, strlen(s), &writtenBytes);
     return o;
 }
-FileStream &operator<<(FileStream& o, OString* s) {
+FileStream &operator<<(FileStream& o, ::rtl::OString* s) {
     sal_uInt64 writtenBytes;
     osl_writeFile(o.m_file, s->getStr(), s->getLength() * sizeof(sal_Char), &writtenBytes);
     return o;
 }
-FileStream &operator<<(FileStream& o, const OString& s) {
+FileStream &operator<<(FileStream& o, const ::rtl::OString& s) {
     sal_uInt64 writtenBytes;
     osl_writeFile(o.m_file, s.getStr(), s.getLength() * sizeof(sal_Char), &writtenBytes);
     return o;
 
 }
-FileStream &operator<<(FileStream& o, OStringBuffer* s) {
+FileStream &operator<<(FileStream& o, ::rtl::OStringBuffer* s) {
     sal_uInt64 writtenBytes;
     osl_writeFile(o.m_file, s->getStr(), s->getLength() * sizeof(sal_Char), &writtenBytes);
     return o;
 }
-FileStream &operator<<(FileStream& o, const OStringBuffer& s) {
+FileStream &operator<<(FileStream& o, const ::rtl::OStringBuffer& s) {
     sal_uInt64 writtenBytes;
     osl_writeFile(
         o.m_file, s.getStr(), s.getLength() * sizeof(sal_Char), &writtenBytes);
     return o;
 }
 
+FileStream & operator <<(FileStream & out, rtl::OUString const & s) {
+    return out << OUStringToOString(s, RTL_TEXTENCODING_UTF8);
+}
+
+CannotDumpException::~CannotDumpException() throw () {}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/codemaker/source/codemaker/options.cxx b/codemaker/source/codemaker/options.cxx
index d233f6f..328cc9c 100644
--- a/codemaker/source/codemaker/options.cxx
+++ b/codemaker/source/codemaker/options.cxx
@@ -20,6 +20,7 @@
 
 #include "codemaker/options.hxx"
 
+using ::rtl::OString;
 
 Options::Options()
 {
@@ -35,21 +36,19 @@ const OString& Options::getProgramName() const
     return m_program;
 }
 
-sal_Bool Options::isValid(const OString& option)
+sal_Bool Options::isValid(const OString& option) const
 {
-    return (m_options.count(option) > 0);
+    return m_options.find(option) != m_options.end();
 }
 
-const OString Options::getOption(const OString& option)
+const OString Options::getOption(const OString& option) const
     throw( IllegalArgument )
 {
-    if (m_options.count(option) > 0)
-    {
-        return m_options[option];
-    } else
-    {
+    OptionMap::const_iterator i(m_options.find(option));
+    if (i == m_options.end()) {
         throw IllegalArgument("Option is not valid or currently not set.");
     }
+    return i->second;
 }
 
 const StringVector& Options::getInputFiles()
diff --git a/codemaker/source/codemaker/typemanager.cxx b/codemaker/source/codemaker/typemanager.cxx
index 9d4cf63..1c9a5ca 100644
--- a/codemaker/source/codemaker/typemanager.cxx
+++ b/codemaker/source/codemaker/typemanager.cxx
@@ -17,50 +17,22 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include "sal/config.h"
+
+#include <cstdlib>
 
 #include "rtl/alloc.h"
 #include "codemaker/typemanager.hxx"
 #include "registry/reader.hxx"
 #include "registry/version.h"
+#include "unoidl/unoidl.hxx"
 
+using ::rtl::OUString;
+using ::rtl::OString;
+using ::rtl::OStringToOUString;
+using ::rtl::OUStringToOString;
 
-sal_Bool TypeManager::isBaseType(const OString& name)
-{
-    if ( name == "short" )
-        return sal_True;
-    if ( name == "unsigned short" )
-        return sal_True;
-    if ( name == "long" )
-        return sal_True;
-    if ( name == "unsigned long" )
-        return sal_True;
-    if ( name == "hyper" )
-        return sal_True;
-    if ( name == "unsigned hyper" )
-        return sal_True;
-    if ( name == "string" )
-        return sal_True;
-    if ( name == "boolean" )
-        return sal_True;
-    if ( name == "char" )
-        return sal_True;
-    if ( name == "byte" )
-        return sal_True;
-    if ( name == "any" )
-        return sal_True;
-    if ( name == "type" )
-        return sal_True;
-    if ( name == "float" )
-        return sal_True;
-    if ( name == "double" )
-        return sal_True;
-    if ( name == "void" )
-        return sal_True;
-
-    return sal_False;
-}
-
-TypeManager::TypeManager() {}
+TypeManager::TypeManager(): m_base("UCR"), manager_(new unoidl::Manager) {}
 
 TypeManager::~TypeManager()
 {
@@ -104,7 +76,7 @@ sal_Bool TypeManager::init(
     return sal_True;
 }
 
-OString TypeManager::getTypeName(RegistryKey& rTypeKey) const
+::rtl::OString TypeManager::getTypeName(RegistryKey& rTypeKey) const
 {
     OString typeName = OUStringToOString(rTypeKey.getName(), RTL_TEXTENCODING_UTF8);
 
@@ -243,9 +215,9 @@ void TypeManager::setBase(const OString& base)
 {
 
     if (base.lastIndexOf('/') == (base.getLength() - 1))
-        m_base += base.copy(0, base.lastIndexOf('/') - 1);
+        m_base = base.copy(0, base.lastIndexOf('/') - 1);
     else
-        m_base += base;
+        m_base = base;
 }
 
 void TypeManager::freeRegistries()
@@ -302,7 +274,7 @@ RegistryKey TypeManager::searchTypeKey(const OString& name_, sal_Bool * pIsExtra
     return key;
 }
 
-RegistryKeyList TypeManager::getTypeKeys(const OString& name_) const
+RegistryKeyList TypeManager::getTypeKeys(const ::rtl::OString& name_) const
 {
     RegistryKeyList keyList= RegistryKeyList();
     OString tmpName;
@@ -346,4 +318,130 @@ RegistryKeyList TypeManager::getTypeKeys(const OString& name_) const
     return keyList;
 }
 
+
+void TypeManager::loadProvider(rtl::OUString const & uri, bool primary) {
+    rtl::Reference< unoidl::Provider > prov(
+        unoidl::loadProvider(manager_, uri));
+    manager_->addProvider(prov);
+    if (primary) {
+        primaryProviders_.push_back(prov);
+    }
+}
+
+bool TypeManager::foundAtPrimaryProvider(rtl::OUString const & name) const {
+    if (name.isEmpty()) {
+        return !primaryProviders_.empty();
+    }
+    for (std::vector< rtl::Reference< unoidl::Provider > >::const_iterator i(
+             primaryProviders_.begin());
+         i != primaryProviders_.end(); ++i)
+    {
+        if ((*i)->findEntity(name).is()) {
+            return true;
+        }
+    }
+    return false;
+}
+
+codemaker::UnoType::Sort TypeManager::getSort(
+    rtl::OUString const & name, rtl::Reference< unoidl::Entity > * entity,
+    rtl::Reference< unoidl::MapCursor > * cursor) const
+{
+    if (name.isEmpty()) {
+        if (cursor != 0) {
+            *cursor = manager_->createCursor("");
+        }
+        return codemaker::UnoType::SORT_MODULE;
+    }
+    if (name == "void") {
+        return codemaker::UnoType::SORT_VOID;
+    }
+    if (name == "boolean") {
+        return codemaker::UnoType::SORT_BOOLEAN;
+    }
+    if (name == "byte") {
+        return codemaker::UnoType::SORT_BYTE;
+    }
+    if (name == "short") {
+        return codemaker::UnoType::SORT_SHORT;
+    }
+    if (name == "unsigned short") {
+        return codemaker::UnoType::SORT_UNSIGNED_SHORT;
+    }
+    if (name == "long") {
+        return codemaker::UnoType::SORT_LONG;
+    }
+    if (name == "unsigned long") {
+        return codemaker::UnoType::SORT_UNSIGNED_LONG;
+    }
+    if (name == "hyper") {
+        return codemaker::UnoType::SORT_HYPER;
+    }
+    if (name == "unsigned hyper") {
+        return codemaker::UnoType::SORT_UNSIGNED_HYPER;
+    }
+    if (name == "float") {
+        return codemaker::UnoType::SORT_FLOAT;
+    }
+    if (name == "double") {
+        return codemaker::UnoType::SORT_DOUBLE;
+    }
+    if (name == "char") {
+        return codemaker::UnoType::SORT_CHAR;
+    }
+    if (name == "string") {
+        return codemaker::UnoType::SORT_STRING;
+    }
+    if (name == "type") {
+        return codemaker::UnoType::SORT_TYPE;
+    }
+    if (name == "any") {
+        return codemaker::UnoType::SORT_ANY;
+    }
+    if (name.startsWith("[")) {
+        return codemaker::UnoType::SORT_SEQUENCE_TYPE;
+    }
+    if (name.indexOf('<') != -1) {
+        return codemaker::UnoType::SORT_INSTANTIATED_POLYMORPHIC_STRUCT_TYPE;
+    }
+    rtl::Reference< unoidl::Entity > ent(manager_->findEntity(name));
+    if (!ent.is()) {
+        throw CannotDumpException("Unknown entity '" + name + "'");
+    }
+    if (entity != 0) {
+        *entity = ent;
+    }
+    switch (ent->getSort()) {
+    case unoidl::Entity::SORT_MODULE:
+        if (cursor != 0) {
+            *cursor = manager_->createCursor(name);
+        }
+        return codemaker::UnoType::SORT_MODULE;
+    case unoidl::Entity::SORT_ENUM_TYPE:
+        return codemaker::UnoType::SORT_ENUM_TYPE;
+    case unoidl::Entity::SORT_PLAIN_STRUCT_TYPE:
+        return codemaker::UnoType::SORT_PLAIN_STRUCT_TYPE;
+    case unoidl::Entity::SORT_POLYMORPHIC_STRUCT_TYPE_TEMPLATE:
+        return codemaker::UnoType::SORT_POLYMORPHIC_STRUCT_TYPE_TEMPLATE;
+    case unoidl::Entity::SORT_EXCEPTION_TYPE:
+        return codemaker::UnoType::SORT_EXCEPTION_TYPE;
+    case unoidl::Entity::SORT_INTERFACE_TYPE:
+        return codemaker::UnoType::SORT_INTERFACE_TYPE;
+    case unoidl::Entity::SORT_TYPEDEF:
+        return codemaker::UnoType::SORT_TYPEDEF;
+    case unoidl::Entity::SORT_CONSTANT_GROUP:
+        return codemaker::UnoType::SORT_CONSTANT_GROUP;
+    case unoidl::Entity::SORT_SINGLE_INTERFACE_BASED_SERVICE:
+        return codemaker::UnoType::SORT_SINGLE_INTERFACE_BASED_SERVICE;
+    case unoidl::Entity::SORT_ACCUMULATION_BASED_SERVICE:
+        return codemaker::UnoType::SORT_ACCUMULATION_BASED_SERVICE;
+    case unoidl::Entity::SORT_INTERFACE_BASED_SINGLETON:
+        return codemaker::UnoType::SORT_INTERFACE_BASED_SINGLETON;
+    case unoidl::Entity::SORT_SERVICE_BASED_SINGLETON:
+        return codemaker::UnoType::SORT_SERVICE_BASED_SINGLETON;
+    default:
+        for (;;) { std::abort(); } // this cannot happen
+    }
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/codemaker/source/codemaker/unotype.cxx b/codemaker/source/codemaker/unotype.cxx
index 8f2c895..a0872ea3 100644
--- a/codemaker/source/codemaker/unotype.cxx
+++ b/codemaker/source/codemaker/unotype.cxx
@@ -46,10 +46,6 @@ codemaker::UnoType::Sort codemaker::UnoType::getSort(OString const & type)
         : SORT_COMPLEX;
 }
 
-bool codemaker::UnoType::isSequenceType(OString const & type) {
-    return !type.isEmpty() && type[0] == '[';
-}
-
 OString codemaker::UnoType::decompose(
     OString const & type, sal_Int32 * rank,
     std::vector< OString > * arguments)
diff --git a/codemaker/source/cppumaker/cppumaker.cxx b/codemaker/source/cppumaker/cppumaker.cxx
index 1f63ef2..8869e87 100644
--- a/codemaker/source/cppumaker/cppumaker.cxx
+++ b/codemaker/source/cppumaker/cppumaker.cxx
@@ -17,221 +17,87 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include "sal/config.h"
 
-#include <stdio.h>
+#include <cstdlib>
+#include <cstring>
+#include <iostream>
+#include <vector>
 
+#include "codemaker/generatedtypeset.hxx"
+#include "codemaker/typemanager.hxx"
 #include "rtl/ref.hxx"
+#include "rtl/string.hxx"
+#include "rtl/ustring.hxx"
 #include "sal/main.h"
-
-#include "codemaker/typemanager.hxx"
-#include "codemaker/generatedtypeset.hxx"
+#include "sal/types.h"
+#include "unoidl/unoidl.hxx"
 
 #include "cppuoptions.hxx"
 #include "cpputype.hxx"
 
-
-namespace {
-
-void failed(OString const & typeName, CppuOptions * options) {
-    fprintf(stderr, "%s ERROR: %s\n", options->getProgramName().getStr(),
-            OString("cannot dump Type '" + typeName + "'").getStr());
-    exit(99);
-}
-
-void produce(
-    RegistryKey& rTypeKey, bool bIsExtraType,
-    rtl::Reference< TypeManager > const & typeMgr,
-    codemaker::GeneratedTypeSet & generated, CppuOptions * options)
-{
-    if (!produceType(rTypeKey, bIsExtraType, typeMgr, generated, options)) {
-        OString typeName = typeMgr->getTypeName(rTypeKey);
-        failed(typeName, options);
-    }
-}
-
-void produce(
-    OString const & typeName,
-    rtl::Reference< TypeManager > const & typeMgr,
-    codemaker::GeneratedTypeSet & generated, CppuOptions * options)
-{
-    if (!produceType(typeName, typeMgr, generated, options)) {
-        failed(typeName, options);
-    }
-}
-
-void produceAllTypes(RegistryKey& rTypeKey, bool bIsExtraType,
-                     rtl::Reference< TypeManager > const & typeMgr,
-                         codemaker::GeneratedTypeSet & generated,
-                         CppuOptions* pOptions,
-                         sal_Bool bFullScope)
-    throw( CannotDumpException )
-{
-    OString typeName = typeMgr->getTypeName(rTypeKey);
-
-    produce(rTypeKey, bIsExtraType, typeMgr, generated, pOptions);
-
-    RegistryKeyList typeKeys = typeMgr->getTypeKeys(typeName);
-    RegistryKeyList::const_iterator iter = typeKeys.begin();
-    RegistryKey key, subKey;
-    RegistryKeyArray subKeys;
-
-    while (iter != typeKeys.end())
-    {
-        key = (*iter).first;
-
-        if (!(*iter).second  && !key.openSubKeys(OUString(), subKeys))
-        {
-            for (sal_uInt32 i = 0; i < subKeys.getLength(); i++)
-            {
-                subKey = subKeys.getElement(i);
-                if (bFullScope)
-                {
-                    produceAllTypes(subKey, (*iter).second, typeMgr,
-                                    generated, pOptions, true);
-                } else
-                {
-                    produce(subKey, (*iter).second,
-                            typeMgr, generated, pOptions);
-                }
-            }
+SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) {
+    CppuOptions options;
+    try {
+        if (!options.initOptions(argc, argv)) {
+            return EXIT_FAILURE;
         }
-
-        ++iter;
+    } catch (IllegalArgument & e) {
+        std::cerr << "Illegal option " << e.m_message << '\n';
+        return EXIT_FAILURE;
     }
-}
-
-void produceAllTypes(const OString& typeName,
-                     rtl::Reference< TypeManager > const & typeMgr,
-                     codemaker::GeneratedTypeSet & generated,
-                     CppuOptions* pOptions,
-                     sal_Bool bFullScope)
-    throw( CannotDumpException )
-{
-    produce(typeName, typeMgr, generated, pOptions);
-
-    RegistryKeyList typeKeys = typeMgr->getTypeKeys(typeName);
-    RegistryKeyList::const_iterator iter = typeKeys.begin();
-    RegistryKey key, subKey;
-    RegistryKeyArray subKeys;
-
-    while (iter != typeKeys.end())
-    {
-        key = (*iter).first;
-        if (!(*iter).second  && !key.openSubKeys(OUString(), subKeys))
+    try {
+        rtl::Reference< TypeManager > typeMgr(new TypeManager);
+        for (std::vector< OString >::const_iterator i(
+                 options.getExtraInputFiles().begin());
+             i != options.getExtraInputFiles().end(); ++i)
         {
-            for (sal_uInt32 i = 0; i < subKeys.getLength(); i++)
-            {
-                subKey = subKeys.getElement(i);
-                if (bFullScope)
-                {
-                    produceAllTypes(subKey, (*iter).second, typeMgr,
-                                    generated, pOptions, true);
-                } else
-                {
-                    produce(subKey, (*iter).second,
-                            typeMgr, generated, pOptions);
-                }
-            }
+            typeMgr->loadProvider(b2u(*i), false);
         }
-
-        ++iter;
-    }
-}
-
-}
-
-SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
-{
-    CppuOptions options;
-
-    try
-    {
-        if (!options.initOptions(argc, argv))
+        for (std::vector< OString >::const_iterator i(
+                 options.getInputFiles().begin());
+             i != options.getInputFiles().end(); ++i)
         {
-            exit(1);
+            typeMgr->loadProvider(b2u(*i), true);
         }
-    }
-    catch( IllegalArgument& e)
-    {
-        fprintf(stderr, "Illegal option: %s\n", e.m_message.getStr());
-        exit(99);
-    }
-
-    rtl::Reference< TypeManager > typeMgr(new TypeManager);
-
-    if (!typeMgr->init(options.getInputFiles(), options.getExtraInputFiles()))
-    {
-        fprintf(stderr, "%s : init registries failed, check your registry files.\n", options.getProgramName().getStr());
-        exit(99);
-    }
-
-    if (options.isValid("-B"))
-    {
-        typeMgr->setBase(options.getOption("-B"));
-    }
-
-    codemaker::GeneratedTypeSet generated;
-    try
-    {
-        if (options.isValid("-T"))
-        {
-            OString tOption(options.getOption("-T"));
-
-            OString typeName, tmpName;
-            sal_Int32 nIndex = 0;
-            do
-            {
-                typeName = tOption.getToken(0, ';', nIndex);
-
-                sal_Int32 nPos = typeName.lastIndexOf( '.' );
-                tmpName = typeName.copy( nPos != -1 ? nPos+1 : 0 );
-                if (tmpName == "*")
-                {
-                    // produce this type and his scope
-                    if (typeName == "*")
-                    {
-                        tmpName = "/";
-                    } else
-                    {
-                        tmpName = typeName.copy(0, typeName.lastIndexOf('.')).replace('.', '/');
-                        if (tmpName.isEmpty())
-                            tmpName = "/";
-                        else
-                            tmpName = tmpName.replace('.', '/');
-                    }
-                    // related to task #116780# the scope is recursively
-                    // generated.  bFullScope = true
-                    produceAllTypes(
-                        tmpName, typeMgr, generated, &options, true);
-                } else
-                {
-                    // produce only this type
+        codemaker::GeneratedTypeSet generated;
+        if (options.isValid("-T")) {
+            OUString names(b2u(options.getOption("-T")));
+            for (sal_Int32 i = 0; i != -1;) {
+                OUString name(names.getToken(0, ';', i));
+                if (!name.isEmpty()) {
                     produce(
-                        typeName.replace('.', '/'), typeMgr, generated, &options);
+                        (name == "*"
+                         ? ""
+                         : name.endsWith(".*")
+                         ? name.copy(0, name.getLength() - std::strlen(".*"))
+                         : name),
+                        typeMgr, generated, options);
                 }
-            } while( nIndex != -1 );
-        } else
-        {
-            // produce all types
-            produceAllTypes("/", typeMgr, generated, &options, true);
+            }
+        } else {
+            produce("", typeMgr, generated, options);
         }
         // C++ header files generated for the following UNO types are included
         // in header files in cppu/inc/com/sun/star/uno (Any.hxx, Reference.hxx,
         // Type.h), so it seems best to always generate those C++ header files:
-        produce("com/sun/star/uno/RuntimeException", typeMgr, generated, &options);
-        produce("com/sun/star/uno/TypeClass", typeMgr, generated, &options);
-        produce("com/sun/star/uno/XInterface", typeMgr, generated, &options);
+        produce(
+            "com.sun.star.uno.RuntimeException", typeMgr, generated, options);
+        produce("com.sun.star.uno.TypeClass", typeMgr, generated, options);
+        produce("com.sun.star.uno.XInterface", typeMgr, generated, options);
+    } catch (CannotDumpException & e) {
+        std::cerr << "ERROR: " << e.getMessage() << '\n';
+        return EXIT_FAILURE;
+    } catch (unoidl::NoSuchFileException & e) {
+        std::cerr << "ERROR: No such file <" << e.getUri() << ">\n";
+        return EXIT_FAILURE;
+    } catch (unoidl::FileFormatException & e) {
+        std::cerr
+            << "ERROR: Bad format of <" << e.getUri() << ">, \""
+            << e.getDetail() << "\"\n";
+        return EXIT_FAILURE;
     }
-    catch( CannotDumpException& e)
-    {
-        fprintf(stderr, "%s ERROR: %s\n",
-                options.getProgramName().getStr(),
-                e.m_message.getStr());
-        exit(99);
-    }
-
-    return 0;
+    return EXIT_SUCCESS;
 }
 
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/codemaker/source/cppumaker/cppuoptions.cxx b/codemaker/source/cppumaker/cppuoptions.cxx
index 8affab2..3446134 100644
--- a/codemaker/source/cppumaker/cppuoptions.cxx
+++ b/codemaker/source/cppumaker/cppuoptions.cxx
@@ -24,6 +24,9 @@
 #include "osl/thread.h"
 #include "osl/process.h"
 
+using ::rtl::OUString;
+using ::rtl::OUStringToOString;
+using ::rtl::OString;
 
 #ifdef SAL_UNX
 #define SEPARATOR '/'
@@ -91,32 +94,6 @@ sal_Bool CppuOptions::initOptions(int ac, char* av[], sal_Bool bCmdFile)
 
                     m_options["-O"] = OString(s);
                     break;
-                case 'B':
-                    if (av[i][2] == '\0')
-                    {
-                        if (i < ac - 1 && av[i+1][0] != '-')
-                        {
-                            i++;
-                            s = av[i];
-                        }
-                        else
-                        {
-                            OString tmp("'-B', please check");
-                            if (i <= ac - 1)
-                            {
-                                tmp += " your input '" + OString(av[i+1]) + "'";
-                            }
-
-                            throw IllegalArgument(tmp);
-                        }
-                    }
-                    else
-                    {
-                        s = av[i] + 2;
-                    }
-
-                    m_options["-B"] = OString(s);
-                    break;
                 case 'T':
                     if (av[i][2] == '\0')
                     {
@@ -337,8 +314,6 @@ OString CppuOptions::prepareHelp()
     help += "      [t1;...]   type is generated. If no '-T' option is specified,\n";
     help += "                 then output for all types is generated.\n";
     help += "                 Example: 'com.sun.star.uno.XInterface' is a valid type.\n";
-    help += "    -B<name>   = name specifies the base node. All types are searched under this\n";
-    help += "                 node. Default is the root '/' of the registry files.\n";
     help += "    -L         = UNO type functions are generated lightweight, that means only\n";
     help += "                 the name and typeclass are given and everything else is retrieved\n";
     help += "                 from the type library dynamically. The default is that UNO type\n";
diff --git a/codemaker/source/cppumaker/cpputype.cxx b/codemaker/source/cppumaker/cpputype.cxx
old mode 100644
new mode 100755
index 4f90a53..511cffb
--- a/codemaker/source/cppumaker/cpputype.cxx
+++ b/codemaker/source/cppumaker/cpputype.cxx
@@ -17,159 +17,236 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include "sal/config.h"
 
 #include <algorithm>
+#include <cassert>
 #include <map>
 #include <set>
-#include <stdio.h>
-#include <string.h>
 #include <vector>
 
-#include "registry/reader.hxx"
+#include "boost/noncopyable.hpp"
 #include "rtl/alloc.h"
 #include "rtl/ref.hxx"
+#include "rtl/ustrbuf.hxx"
 #include "rtl/ustring.hxx"
 #include "rtl/strbuf.hxx"
+#include "unoidl/unoidl.hxx"
 
-#include "codemaker/dependencies.hxx"
+#include "codemaker/commoncpp.hxx"
 #include "codemaker/exceptiontree.hxx"
 #include "codemaker/generatedtypeset.hxx"
+#include "codemaker/typemanager.hxx"
 #include "codemaker/unotype.hxx"
 
 #include "cpputype.hxx"
 #include "cppuoptions.hxx"
+#include "dependencies.hxx"
 #include "dumputils.hxx"
 #include "includes.hxx"
 
-using namespace codemaker::cpp;
-
-
 namespace {
 
-OString translateSimpleUnoType(OString const & unoType, bool cppuUnoType=false) {
-    static OString const trans[codemaker::UnoType::SORT_COMPLEX + 1] = {
-        "void", "::sal_Bool", "::sal_Int8", "::sal_Int16", "::sal_uInt16",
-        "::sal_Int32", "::sal_uInt32", "::sal_Int64", "::sal_uInt64", "float",
-        "double", "::sal_Unicode", "rtl::OUString",
-        "::com::sun::star::uno::Type", "::com::sun::star::uno::Any",
-        OString() };
-
-    const codemaker::UnoType::Sort sort = codemaker::UnoType::getSort(unoType);
-    if (cppuUnoType &&
-        (sort == codemaker::UnoType::SORT_UNSIGNED_SHORT ||
-         sort == codemaker::UnoType::SORT_CHAR) )
-    {
-        if (sort == codemaker::UnoType::SORT_CHAR)
-            return "::cppu::UnoCharType";
-        else
-            return "::cppu::UnoUnsignedShortType";
-    }
-
-    return trans[sort];
-}
-
-bool isBootstrapType(OString const & name) {
+bool isBootstrapType(OUString const & name) {
     static char const * const names[] = {
-        "com/sun/star/beans/PropertyAttribute",
-        "com/sun/star/beans/PropertyState",
-        "com/sun/star/beans/PropertyValue",
-        "com/sun/star/beans/XFastPropertySet",
-        "com/sun/star/beans/XMultiPropertySet",
-        "com/sun/star/beans/XPropertyAccess",
-        "com/sun/star/beans/XPropertySet",
-        "com/sun/star/beans/XPropertySetOption",
-        "com/sun/star/bridge/UnoUrlResolver",
-        "com/sun/star/bridge/XUnoUrlResolver",
-        "com/sun/star/connection/SocketPermission",
-        "com/sun/star/container/XElementAccess",
-        "com/sun/star/container/XEnumerationAccess",
-        "com/sun/star/container/XHierarchicalNameAccess",
-        "com/sun/star/container/XNameAccess",
-        "com/sun/star/container/XNameContainer",
-        "com/sun/star/container/XNameReplace",
-        "com/sun/star/container/XSet",
-        "com/sun/star/io/FilePermission",
-        "com/sun/star/io/IOException",
-        "com/sun/star/lang/DisposedException",
-        "com/sun/star/lang/WrappedTargetRuntimeException",
-        "com/sun/star/lang/XComponent",
-        "com/sun/star/lang/XEventListener",
-        "com/sun/star/lang/XInitialization",
-        "com/sun/star/lang/XMultiComponentFactory",
-        "com/sun/star/lang/XMultiServiceFactory",
-        "com/sun/star/lang/XServiceInfo",
-        "com/sun/star/lang/XSingleComponentFactory",
-        "com/sun/star/lang/XSingleServiceFactory",
-        "com/sun/star/lang/XTypeProvider",
-        "com/sun/star/loader/XImplementationLoader",
-        "com/sun/star/reflection/XArrayTypeDescription",
-        "com/sun/star/reflection/XCompoundTypeDescription",
-        "com/sun/star/reflection/XEnumTypeDescription",
-        "com/sun/star/reflection/XIdlClass",
-        "com/sun/star/reflection/XIdlField2",
-        "com/sun/star/reflection/XIdlReflection",
-        "com/sun/star/reflection/XIndirectTypeDescription",
-        "com/sun/star/reflection/XInterfaceAttributeTypeDescription",
-        "com/sun/star/reflection/XInterfaceAttributeTypeDescription2",
-        "com/sun/star/reflection/XInterfaceMemberTypeDescription",
-        "com/sun/star/reflection/XInterfaceMethodTypeDescription",
-        "com/sun/star/reflection/XInterfaceTypeDescription",
-        "com/sun/star/reflection/XInterfaceTypeDescription2",
-        "com/sun/star/reflection/XMethodParameter",
-        "com/sun/star/reflection/XStructTypeDescription",
-        "com/sun/star/reflection/XTypeDescription",
-        "com/sun/star/reflection/XTypeDescriptionEnumerationAccess",
-        "com/sun/star/reflection/XUnionTypeDescription",
-        "com/sun/star/registry/XImplementationRegistration",
-        "com/sun/star/registry/XRegistryKey",
-        "com/sun/star/registry/XSimpleRegistry",
-        "com/sun/star/security/RuntimePermission",
-        "com/sun/star/security/XAccessController",
-        "com/sun/star/uno/DeploymentException",
-        "com/sun/star/uno/RuntimeException",
-        "com/sun/star/uno/XAggregation",
-        "com/sun/star/uno/XComponentContext",
-        "com/sun/star/uno/XCurrentContext",
-        "com/sun/star/uno/XUnloadingPreference",
-        "com/sun/star/uno/XWeak",
-        "com/sun/star/util/XMacroExpander"
-    }; // cf. cppuhelper/unotypes/Makefile UNOTYPES (plus missing dependencies)
+        "com.sun.star.beans.PropertyAttribute",
+        "com.sun.star.beans.PropertyState",
+        "com.sun.star.beans.PropertyValue",
+        "com.sun.star.beans.XFastPropertySet",
+        "com.sun.star.beans.XMultiPropertySet",
+        "com.sun.star.beans.XPropertyAccess",
+        "com.sun.star.beans.XPropertySet",
+        "com.sun.star.beans.XPropertySetOption",
+        "com.sun.star.bridge.UnoUrlResolver",
+        "com.sun.star.bridge.XUnoUrlResolver",
+        "com.sun.star.connection.SocketPermission",
+        "com.sun.star.container.XElementAccess",
+        "com.sun.star.container.XEnumerationAccess",
+        "com.sun.star.container.XHierarchicalNameAccess",
+        "com.sun.star.container.XNameAccess",
+        "com.sun.star.container.XNameContainer",
+        "com.sun.star.container.XNameReplace",
+        "com.sun.star.container.XSet",
+        "com.sun.star.io.FilePermission",
+        "com.sun.star.io.IOException",
+        "com.sun.star.lang.DisposedException",
+        "com.sun.star.lang.WrappedTargetRuntimeException",
+        "com.sun.star.lang.XComponent",
+        "com.sun.star.lang.XEventListener",
+        "com.sun.star.lang.XInitialization",
+        "com.sun.star.lang.XMultiComponentFactory",
+        "com.sun.star.lang.XMultiServiceFactory",
+        "com.sun.star.lang.XServiceInfo",
+        "com.sun.star.lang.XSingleComponentFactory",
+        "com.sun.star.lang.XSingleServiceFactory",
+        "com.sun.star.lang.XTypeProvider",
+        "com.sun.star.loader.XImplementationLoader",
+        "com.sun.star.reflection.XArrayTypeDescription",
+        "com.sun.star.reflection.XCompoundTypeDescription",
+        "com.sun.star.reflection.XEnumTypeDescription",
+        "com.sun.star.reflection.XIdlClass",
+        "com.sun.star.reflection.XIdlField2",
+        "com.sun.star.reflection.XIdlReflection",
+        "com.sun.star.reflection.XIndirectTypeDescription",
+        "com.sun.star.reflection.XInterfaceAttributeTypeDescription",
+        "com.sun.star.reflection.XInterfaceAttributeTypeDescription2",
+        "com.sun.star.reflection.XInterfaceMemberTypeDescription",
+        "com.sun.star.reflection.XInterfaceMethodTypeDescription",
+        "com.sun.star.reflection.XInterfaceTypeDescription",
+        "com.sun.star.reflection.XInterfaceTypeDescription2",
+        "com.sun.star.reflection.XMethodParameter",
+        "com.sun.star.reflection.XStructTypeDescription",
+        "com.sun.star.reflection.XTypeDescription",
+        "com.sun.star.reflection.XTypeDescriptionEnumerationAccess",
+        "com.sun.star.reflection.XUnionTypeDescription",
+        "com.sun.star.registry.XImplementationRegistration",
+        "com.sun.star.registry.XRegistryKey",
+        "com.sun.star.registry.XSimpleRegistry",
+        "com.sun.star.security.RuntimePermission",
+        "com.sun.star.security.XAccessController",
+        "com.sun.star.uno.DeploymentException",
+        "com.sun.star.uno.RuntimeException",
+        "com.sun.star.uno.XAggregation",
+        "com.sun.star.uno.XComponentContext",
+        "com.sun.star.uno.XCurrentContext",
+        "com.sun.star.uno.XUnloadingPreference",
+        "com.sun.star.uno.XWeak",
+        "com.sun.star.util.XMacroExpander" };
+        // cf. cppuhelper/unotypes/Makefile UNOTYPES (plus missing dependencies)
     for (std::size_t i = 0; i < SAL_N_ELEMENTS(names); ++i) {
-        if (name == names[i]) {
+        if (name.equalsAscii(names[i])) {
             return true;
         }
     }
     return false;
 }
 
-}
+class CppuType: private boost::noncopyable {
+public:
+    CppuType(
+        OUString const & name, rtl::Reference< TypeManager > const & typeMgr);
+
+    virtual ~CppuType() {}
+
+    void dump(CppuOptions const & options);
+
+    void dumpFile(
+        OUString const & uri, OUString const & name, bool hpp,
+        CppuOptions const & options);
+
+    void dumpDependedTypes(
+        codemaker::GeneratedTypeSet & generated, CppuOptions const & options);
+
+    virtual void dumpHFile(
+        FileStream & out, codemaker::cppumaker::Includes & includes)
+    { dumpHFileContent(out, includes); }
+
+    virtual void dumpHxxFile(FileStream& o, codemaker::cppumaker::Includes & includes) = 0;
+
+    OUString dumpHeaderDefine(FileStream& o, OUString const & extension);
+
+    void dumpGetCppuType(FileStream & out);
+
+    virtual void dumpLightGetCppuType(FileStream & out);
+
+    virtual void dumpNormalGetCppuType(FileStream &)
+    { assert(false); } // this cannot happen
+
+    virtual void dumpComprehensiveGetCppuType(FileStream &)
+    { assert(false); } // this cannot happen
+
+    void dumpType(
+        FileStream & out, OUString const & name, bool isConst = false,
+        bool isRef = false, bool native = false, bool cppuUnoType = false)
+        const;
+
+    OUString getTypeClass(OUString const & name, bool cStyle = false);
+
+    void dumpCppuGetType(FileStream & out, OUString const & name);
+
+    sal_uInt32 getInheritedMemberCount();
+
+    void            inc(sal_Int32 num=4);
+    void            dec(sal_Int32 num=4);
+    OUString indent() const;
+protected:
+    virtual sal_uInt32 checkInheritedMemberCount() const
+    { assert(false); return 0; } // this cannot happen
+
+    bool passByReference(OUString const & name) const;
+
+    OUString resolveOuterTypedefs(OUString const & name) const;
+
+    OUString resolveAllTypedefs(OUString const & name) const;
+
+    codemaker::cpp::IdentifierTranslationMode isGlobal() const;
+
+    virtual void dumpDeclaration(FileStream &)
+    { assert(false); } // this cannot happen
+
+    virtual void dumpFiles(OUString const & uri, CppuOptions const & options);
+
+    virtual void addLightGetCppuTypeIncludes(
+        codemaker::cppumaker::Includes & includes) const;
 
-//*************************************************************************
-// CppuType
-//*************************************************************************
-CppuType::CppuType(typereg::Reader& typeReader,
-                   const OString& typeName,
-                   rtl::Reference< TypeManager > const & typeMgr)
-    : m_inheritedMemberCount(0)
+    virtual void addNormalGetCppuTypeIncludes(
+        codemaker::cppumaker::Includes & includes) const;
+
+    virtual void addComprehensiveGetCppuTypeIncludes(
+        codemaker::cppumaker::Includes & includes) const;
+
+    virtual bool isPolymorphic() const;
+
+    virtual void dumpTemplateHead(FileStream &) const {}
+
+    virtual void dumpTemplateParameters(FileStream &) const {}
+
+    void dumpGetCppuTypePreamble(FileStream & out);
+
+    void dumpGetCppuTypePostamble(FileStream & out);
+
+    void addDefaultHIncludes(codemaker::cppumaker::Includes & includes) const;
+    void addDefaultHxxIncludes(codemaker::cppumaker::Includes & includes) const;
+
+    void dumpInitializer(
+        FileStream & out, bool parameterized, OUString const & name) const;
+
+    void dumpHFileContent(
+        FileStream & out, codemaker::cppumaker::Includes & includes);
+
+protected:
+    sal_uInt32          m_inheritedMemberCount;
+
+    bool                m_cppuTypeLeak;
+    bool                m_cppuTypeDynamic;
+    sal_Int32           m_indentLength;
+    OUString name_;
+    OUString id_;
+    rtl::Reference< TypeManager > m_typeMgr;
+    codemaker::cppumaker::Dependencies m_dependencies;
+
+private:
+    void addGetCppuTypeIncludes(codemaker::cppumaker::Includes & includes)
+        const;
+};
+
+CppuType::CppuType(
+    OUString const & name, rtl::Reference< TypeManager > const & typeMgr):
+    m_inheritedMemberCount(0)
     , m_cppuTypeLeak(false)
     , m_cppuTypeDynamic(true)
     , m_indentLength(0)
-    , m_typeName(typeName)
-    , m_name(typeName.copy(typeName.lastIndexOf('/') + 1))
-    , m_reader(typeReader)
+    , name_(name)
+    , id_(name_.copy(name_.lastIndexOf('.') + 1))
     , m_typeMgr(typeMgr)
-    , m_dependencies(typeMgr, typeName)
+    , m_dependencies(typeMgr, name_)
 {}
 
-CppuType::~CppuType()
-{
-
-}
-
 void CppuType::addGetCppuTypeIncludes(codemaker::cppumaker::Includes & includes)
     const
 {
-    if (m_typeName == "com/sun/star/uno/XInterface" || m_typeName == "com/sun/star/uno/Exception")
+    if (name_ == "com.sun.star.uno.XInterface"
+        || name_ == "com.sun.star.uno.Exception")
     {
         includes.addType();
         includes.addCppuUnotypeHxx();
@@ -185,13 +262,9 @@ void CppuType::addGetCppuTypeIncludes(codemaker::cppumaker::Includes & includes)
     }
 }
 
-void CppuType::dumpDeclaration(FileStream &) throw (CannotDumpException) {
-    OSL_ASSERT(false);
-}
-
-bool CppuType::dumpFiles(CppuOptions * options, OString const & outPath) {
-    return dumpFile(options, ".hdl", m_typeName, outPath)
-        && dumpFile(options, ".hpp", m_typeName, outPath);
+void CppuType::dumpFiles(OUString const & uri, CppuOptions const & options) {
+    dumpFile(uri, name_, false, options);
+    dumpFile(uri, name_, true, options);
 }
 
 void CppuType::addLightGetCppuTypeIncludes(
@@ -220,28 +293,24 @@ void CppuType::addComprehensiveGetCppuTypeIncludes(
 
 bool CppuType::isPolymorphic() const { return false; }
 
-void CppuType::dumpTemplateHead(FileStream &) const {}
-
-void CppuType::dumpTemplateParameters(FileStream &) const {}
-
 void CppuType::dumpGetCppuTypePreamble(FileStream & out) {
     if (isPolymorphic()) {
         out << "namespace cppu {\n\n";
         dumpTemplateHead(out);
         out << "class UnoType< ";
-        dumpType(out, m_typeName);
+        dumpType(out, name_);
         dumpTemplateParameters(out);
         out << " > {\npublic:\n";
         inc();
         out << indent()
             << "static inline ::com::sun::star::uno::Type const & get() {\n";
     } else {
-        if (codemaker::cppumaker::dumpNamespaceOpen(out, m_typeName, false)) {
+        if (codemaker::cppumaker::dumpNamespaceOpen(out, name_, false)) {
             out << "\n\n";
         }
         out << ("inline ::com::sun::star::uno::Type const &"
                 " cppu_detail_getUnoType(SAL_UNUSED_PARAMETER ");
-        dumpType(out, m_typeName, false, false, true);
+        dumpType(out, name_, false, false, true);
         out << " const *) {\n";
     }
     inc();
@@ -257,162 +326,105 @@ void CppuType::dumpGetCppuTypePostamble(FileStream & out) {
             << "void operator =(UnoType); // not defined\n};\n\n}\n\n";
     } else {
         out << "}\n\n";
-        if (codemaker::cppumaker::dumpNamespaceClose(out, m_typeName, false)) {
+        if (codemaker::cppumaker::dumpNamespaceClose(out, name_, false)) {
             out << "\n\n";
         }
     }
     dumpTemplateHead(out);
     out << ("inline ::com::sun::star::uno::Type const & SAL_CALL"
             " getCppuType(SAL_UNUSED_PARAMETER ");
-    dumpType(out, m_typeName);
+    dumpType(out, name_);
     dumpTemplateParameters(out);
     out << " const *) SAL_THROW(()) {\n";
     inc();
     out << indent() << "return ::cppu::UnoType< ";
-    dumpType(out, m_typeName);
+    dumpType(out, name_);
     dumpTemplateParameters(out);
     out << " >::get();\n";
     dec();
     out << indent() << "}\n";
 }
 
-sal_Bool CppuType::dump(CppuOptions* pOptions)
-    throw( CannotDumpException )
-{
-    if (!m_dependencies.isValid()) {
-        return false;
-    }
-    addSpecialDependencies();
-
-    if (isBootstrapType(m_typeName)) {
+void CppuType::dump(CppuOptions const & options) {
+    if (isBootstrapType(name_)) {
         m_cppuTypeDynamic = false;
     } else {
         // -CS was used as an undocumented option to generate static getCppuType
         // functions; since the introduction of cppu::UnoType this no longer is
         // meaningful (getCppuType is just a forward to cppu::UnoType::get now),
         // and -CS is handled the same way as -C now:
-        if (pOptions->isValid("-L"))
+        if (options.isValid("-L"))
             m_cppuTypeLeak = true;
-        if (pOptions->isValid("-C") || pOptions->isValid("-CS"))
+        if (options.isValid("-C") || options.isValid("-CS"))
             m_cppuTypeDynamic = false;
     }
-
-    OString outPath;
-    if (pOptions->isValid("-O"))
-        outPath = pOptions->getOption("-O");
-
-    return dumpFiles(pOptions, outPath);
+    dumpFiles(
+        options.isValid("-O") ? b2u(options.getOption("-O")) : "", options);
 }
 
-sal_Bool CppuType::dumpFile(CppuOptions* pOptions,
-                            const OString& sExtension,
-                            const OString& sName,
-                            const OString& sOutPath )
-    throw( CannotDumpException )
+void CppuType::dumpFile(
+    OUString const & uri, OUString const & name, bool hpp,
+    CppuOptions const & options)
 {
-    sal_Bool ret = sal_False;
-
-    OString sTmpExt(".tml");
-    sal_Bool bHdl = sal_True;    ;
-    if (sExtension == ".hpp") {
-        sTmpExt = ".tmp";
-        bHdl = sal_False;
+    OUString fileUri(
+        b2u(createFileNameFromType(
+                u2b(uri), u2b(name), hpp ? ".hpp" : ".hdl")));
+    if (fileUri.isEmpty()) {
+        throw CannotDumpException("empty target URI for entity " + name);
     }
-
-    OString sFileName = createFileNameFromType(sOutPath, sName, sExtension);
-    if (sFileName.isEmpty())
-        return sal_False;
-
-    sal_Bool bFileExists = fileExists( sFileName );
-    sal_Bool bFileCheck = sal_False;
-
-    if ( bFileExists && pOptions->isValid("-G") )
-        return sal_True;
-
-    if ( bFileExists && pOptions->isValid("-Gc") )
-        bFileCheck = sal_True;
-
-    OString sTmpDir = getTempDir(sFileName);
-    FileStream oFile;
-    oFile.createTempFile(sTmpDir);
-    OString sTmpFileName;
-
-    if(!oFile.isValid())
-    {
-        OString message("cannot open ");
-        message += sFileName + " for writing";
-        throw CannotDumpException(message);
-    } else
-        sTmpFileName = oFile.getName();
-
-    codemaker::cppumaker::Includes includes(m_typeMgr, m_dependencies, !bHdl);
-    if (bHdl)
-        ret = dumpHFile(oFile, includes);
-    else {
-        addGetCppuTypeIncludes(includes);
-        ret = dumpHxxFile(oFile, includes);
+    bool exists = fileExists(u2b(fileUri));
+    if (exists && options.isValid("-G")) {
+        return;
     }
-
-    oFile.close();
-
-    if (ret) {
-        ret = makeValidTypeFile(sFileName, sTmpFileName, bFileCheck);
-    } else {
-        // remove existing type file if something goes wrong to ensure consistency
-        if (fileExists(sFileName))
-            removeTypeFile(sFileName);
-
-        // remove tmp file if something goes wrong
-        removeTypeFile(sTmpFileName);
+    FileStream out;
+    out.createTempFile(getTempDir(u2b(fileUri)));
+    OUString tmpUri(b2u(out.getName()));
+    if(!out.isValid()) {
+        throw CannotDumpException("cannot open " + tmpUri + " for writing");
     }
-
-    return ret;
+    codemaker::cppumaker::Includes includes(m_typeMgr, m_dependencies, hpp);
+    try {
+        if (hpp) {
+            addGetCppuTypeIncludes(includes);
+            dumpHxxFile(out, includes);
+        } else {
+            dumpHFile(out, includes);
+        }
+    } catch (...) {
+        out.close();
+        // Remove existing type file if something goes wrong to ensure
+        // consistency:
+        if (fileExists(u2b(fileUri))) {
+            removeTypeFile(u2b(fileUri));
+        }
+        removeTypeFile(u2b(tmpUri));
+        throw;
+    }
+    out.close();
+    makeValidTypeFile(
+        u2b(fileUri), u2b(tmpUri), exists && options.isValid("-Gc"));
 }
 
 void CppuType::dumpDependedTypes(
-    codemaker::GeneratedTypeSet & generated, CppuOptions * options)
+    codemaker::GeneratedTypeSet & generated, CppuOptions const & options)
 {
-    codemaker::Dependencies::Map const & map(m_dependencies.getMap());
-    for (codemaker::Dependencies::Map::const_iterator i(map.begin());
+    codemaker::cppumaker::Dependencies::Map const & map
+        = m_dependencies.getMap();
+    for (codemaker::cppumaker::Dependencies::Map::const_iterator i(map.begin());
          i != map.end(); ++i)
     {
-        if (!produceType(i->first, m_typeMgr, generated, options)) {
-            fprintf(
-                stderr, "%s ERROR: cannot dump Type '%s'\n",
-                options->getProgramName().getStr(), i->first.getStr());
-            exit(99);
-        }
+        produce(i->first, m_typeMgr, generated, options);
     }
 }
 
-OString CppuType::dumpHeaderDefine(
-    FileStream& o, char const * prefix, sal_Bool bExtended)
+OUString CppuType::dumpHeaderDefine(
+    FileStream & out, OUString const & extension)
 {
-    if (m_typeName == "/")
-    {
-        bExtended = sal_False;
-        m_typeName = "global";
-    }
-
-    sal_uInt32 length = 3 + m_typeName.getLength() + strlen(prefix);
-
-    if (bExtended)
-        length += m_name.getLength() + 1;
-
-    OStringBuffer tmpBuf(length);
-
-    tmpBuf.append("INCLUDED_" + m_typeName + "_");
-    if (bExtended)
-    {
-        tmpBuf.append(m_name + "_");
-    }
-    tmpBuf.append(prefix);
-
-    OString tmp(tmpBuf.makeStringAndClear().replace('/', '_').toAsciiUpperCase());
-
-    o << "#ifndef " << tmp << "\n#define " << tmp << "\n";
-
-    return tmp;
+    OUString def(
+        "INCLUDED_" + name_.replace('.', '_').toAsciiUpperCase() + "_"
+        + extension);
+    out << "#ifndef " << def << "\n#define " << def << "\n";
+    return def;
 }
 
 void CppuType::addDefaultHIncludes(codemaker::cppumaker::Includes & includes)
@@ -420,7 +432,9 @@ void CppuType::addDefaultHIncludes(codemaker::cppumaker::Includes & includes)
 {
     //TODO: Only include what is really needed
     includes.addCppuMacrosHxx();
-    if (m_typeMgr->getTypeClass(m_typeName) == RT_TYPE_INTERFACE) {
+    if (m_typeMgr->getSort(name_)
+        == codemaker::UnoType::SORT_INTERFACE_TYPE)
+    {
         includes.addReference();
     }
 }
@@ -432,68 +446,58 @@ void CppuType::addDefaultHxxIncludes(codemaker::cppumaker::Includes & includes)
     includes.addRtlInstanceHxx();
     includes.addOslMutexHxx();
     includes.addType();
-    if (m_typeMgr->getTypeClass(m_typeName) == RT_TYPE_INTERFACE) {
+    if (m_typeMgr->getSort(name_)
+        == codemaker::UnoType::SORT_INTERFACE_TYPE)
+    {
         includes.addReference();
     }
 }
 
 void CppuType::dumpInitializer(
-    FileStream & out, bool parameterized, OUString const & type) const
+    FileStream & out, bool parameterized, OUString const & name) const
 {
     out << "(";
     if (!parameterized) {
-        for (OString t(
-                 OUStringToOString(type, RTL_TEXTENCODING_UTF8));;)
-        {
-            sal_Int32 rank;
-            std::vector< OString > args;
-            t = codemaker::UnoType::decompose(t, &rank, &args);
-            if (rank == 0) {
-                switch (codemaker::UnoType::getSort(t)) {
-                case codemaker::UnoType::SORT_BOOLEAN:
-                    out << "false";
-                    break;
-
-                case codemaker::UnoType::SORT_BYTE:
-                case codemaker::UnoType::SORT_SHORT:
-                case codemaker::UnoType::SORT_UNSIGNED_SHORT:
-                case codemaker::UnoType::SORT_LONG:
-                case codemaker::UnoType::SORT_UNSIGNED_LONG:
-                case codemaker::UnoType::SORT_HYPER:
-                case codemaker::UnoType::SORT_UNSIGNED_HYPER:
-                case codemaker::UnoType::SORT_FLOAT:
-                case codemaker::UnoType::SORT_DOUBLE:
-                case codemaker::UnoType::SORT_CHAR:
-                    out << "0";
-                    break;
-
-                case codemaker::UnoType::SORT_COMPLEX:
-                    switch (m_typeMgr->getTypeClass(t)) {
-                    case RT_TYPE_ENUM:
-                        {
-                            typereg::Reader reader(m_typeMgr->getTypeReader(t));
-                            OSL_ASSERT(reader.isValid());
-                            out << scopedCppName(t) << "_"
-                                << OUStringToOString(
-                                    reader.getFieldName(0),
-                                    RTL_TEXTENCODING_UTF8);
-                            break;
-                        }
-
-                    case RT_TYPE_TYPEDEF:
-                        t = resolveTypedefs(t);
-                        continue;
-
-                    default:
-                        break;
-                    }
-                    break;
-
-                default:
-                    break;
-                }
+        sal_Int32 k;
+        std::vector< OString > args;
+        OUString n(
+            b2u(codemaker::UnoType::decompose(
+                    u2b(resolveAllTypedefs(name)), &k, &args)));
+        if (k == 0) {
+            rtl::Reference< unoidl::Entity > ent;
+            switch (m_typeMgr->getSort(n, &ent)) {
+            case codemaker::UnoType::SORT_BOOLEAN:
+                out << "false";
+                break;
+            case codemaker::UnoType::SORT_BYTE:
+            case codemaker::UnoType::SORT_SHORT:
+            case codemaker::UnoType::SORT_UNSIGNED_SHORT:
+            case codemaker::UnoType::SORT_LONG:
+            case codemaker::UnoType::SORT_UNSIGNED_LONG:
+            case codemaker::UnoType::SORT_HYPER:
+            case codemaker::UnoType::SORT_UNSIGNED_HYPER:
+            case codemaker::UnoType::SORT_FLOAT:
+            case codemaker::UnoType::SORT_DOUBLE:
+            case codemaker::UnoType::SORT_CHAR:
+                out << "0";
+                break;
+            case codemaker::UnoType::SORT_ENUM_TYPE:
+                out << codemaker::cpp::scopedCppName(u2b(n)) << "_"
+                    << (dynamic_cast< unoidl::EnumTypeEntity * >(ent.get())->
+                        getMembers()[0].name);
+                break;
+            case codemaker::UnoType::SORT_STRING:
+            case codemaker::UnoType::SORT_TYPE:
+            case codemaker::UnoType::SORT_ANY:
+            case codemaker::UnoType::SORT_PLAIN_STRUCT_TYPE:
+            case codemaker::UnoType::SORT_POLYMORPHIC_STRUCT_TYPE_TEMPLATE:
+            case codemaker::UnoType::SORT_INTERFACE_TYPE:
+                break;
+            default:
+                throw CannotDumpException(
+                    "unexpected type \"" + name
+                    + "\" in call to CppuType::dumpInitializer");
             }
-            break;
         }
     }
     out << ")";
@@ -508,37 +512,37 @@ void CppuType::dumpHFileContent(
     includes.dump(out, 0);
     out << ("\nnamespace com { namespace sun { namespace star { namespace uno"
             " { class Type; } } } }\n\n");
-    if (codemaker::cppumaker::dumpNamespaceOpen(out, m_typeName, false)) {
+    if (codemaker::cppumaker::dumpNamespaceOpen(out, name_, false)) {
         out << "\n";
     }
     dumpDeclaration(out);
-    if (!(m_typeName == "com/sun/star/uno/XInterface" ||
-          m_typeName == "com/sun/star/uno/Exception" ||
-          isPolymorphic()))
+    if (!(name_ == "com.sun.star.uno.XInterface"
+          || name_ == "com.sun.star.uno.Exception"
+          || isPolymorphic()))
     {
         out << "\n" << indent()
             << ("inline ::com::sun::star::uno::Type const &"
                 " cppu_detail_getUnoType(SAL_UNUSED_PARAMETER ");
-        dumpType(out, m_typeName, false, false, true);
+        dumpType(out, name_, false, false, true);
         out << " const *);\n";
     }
-    if (codemaker::cppumaker::dumpNamespaceClose(out, m_typeName, false)) {
+    if (codemaker::cppumaker::dumpNamespaceClose(out, name_, false)) {
         out << "\n";
     }
     out << "\n";
     dumpTemplateHead(out);
     out << "inline ::com::sun::star::uno::Type const & SAL_CALL getCppuType(";
-    dumpType(out, m_typeName, true);
+    dumpType(out, name_, true);
     dumpTemplateParameters(out);
     out << " *) SAL_THROW(());\n\n#endif\n";
 }
 
 void CppuType::dumpGetCppuType(FileStream & out) {
-    if (m_typeName == "com/sun/star/uno/XInterface") {
+    if (name_ == "com.sun.star.uno.XInterface") {
         out << indent()
             << ("inline ::com::sun::star::uno::Type const & SAL_CALL"
                 " getCppuType(SAL_UNUSED_PARAMETER ");
-        dumpType(out, m_typeName, true, false);
+        dumpType(out, name_, true);
         out << " *) SAL_THROW(()) {\n";
         inc();
         out << indent()
@@ -546,11 +550,11 @@ void CppuType::dumpGetCppuType(FileStream & out) {
                 " >::get();\n");
         dec();
         out << indent() << "}\n";
-    } else if (m_typeName == "com/sun/star/uno/Exception") {
+    } else if (name_ == "com.sun.star.uno.Exception") {
         out << indent()
             << ("inline ::com::sun::star::uno::Type const & SAL_CALL"
                 " getCppuType(SAL_UNUSED_PARAMETER ");
-        dumpType(out, m_typeName, true, false);
+        dumpType(out, name_, true);
         out << " *) SAL_THROW(()) {\n";
         inc();
         out << indent()
@@ -567,2217 +571,1754 @@ void CppuType::dumpGetCppuType(FileStream & out) {
     }
 }
 
-void CppuType::dumpLightGetCppuType(FileStream& o)
-{
-    dumpGetCppuTypePreamble(o);
-    o << indent()
-      << "static typelib_TypeDescriptionReference * the_type = 0;\n";
-
-    o << indent() << "if ( !the_type )\n" << indent() << "{\n";
+void CppuType::dumpLightGetCppuType(FileStream & out) {
+    dumpGetCppuTypePreamble(out);
+    out << indent()
+        << "static typelib_TypeDescriptionReference * the_type = 0;\n"
+        << indent() << "if ( !the_type )\n" << indent() << "{\n";
     inc();
-    o << indent() << "typelib_static_type_init( &the_type, "
-      << getTypeClass(m_typeName, sal_True) << ", \"" << m_typeName.replace('/', '.') << "\" );\n";
+    out << indent() << "typelib_static_type_init( &the_type, "
+        << getTypeClass(name_, true) << ", \"" << name_ << "\" );\n";
     dec();
-    o << indent() << "}\n";
-    o << indent()
-      << ("return * reinterpret_cast< ::com::sun::star::uno::Type * >("
-          " &the_type );\n");
-    dumpGetCppuTypePostamble(o);
+    out << indent() << "}\n" << indent()
+        << ("return * reinterpret_cast< ::com::sun::star::uno::Type * >("
+            " &the_type );\n");
+    dumpGetCppuTypePostamble(out);
 }
 
-void CppuType::dumpNormalGetCppuType(FileStream& o)
-{
-    dumpGetCppuTypePreamble(o);
-
-    o << indent()
-      << "static typelib_TypeDescriptionReference * the_type = 0;\n";
-
-    o << indent() << "if ( !the_type )\n" << indent() << "{\n";
-    inc();
+codemaker::cpp::IdentifierTranslationMode CppuType::isGlobal() const {
+    return name_.indexOf('.') == -1
+        ? codemaker::cpp::ITM_GLOBAL : codemaker::cpp::ITM_NONGLOBAL;
+}
 
-    OString superType;
-    if (m_reader.getSuperTypeCount() >= 1) {
-        superType = OUStringToOString(
-            m_reader.getSuperTypeName(0), RTL_TEXTENCODING_UTF8);
-    }
-    sal_Bool bIsBaseException = sal_False;
-    if (!superType.isEmpty())
+sal_uInt32 CppuType::getInheritedMemberCount()
+{
+    if (m_inheritedMemberCount == 0)
     {
-        if ( superType == "com/sun/star/uno/Exception" )
-        {
-            bIsBaseException = sal_True;
-        } else
-        {
-            o << indent() << "const ::com::sun::star::uno::Type& rBaseType = ::cppu::UnoType< ";
-            dumpType(o, superType, true, false, false, true);
-            o << " >::get();\n\n";
-        }
+        m_inheritedMemberCount = checkInheritedMemberCount();
     }
 
-    sal_uInt32 count = getMemberCount();
-    if (count)
-    {
-        o << indent() << "typelib_TypeDescriptionReference * aMemberRefs[" << count << "];\n";
-
-        sal_uInt16      fieldCount = m_reader.getFieldCount();
-        RTFieldAccess   access = RT_ACCESS_INVALID;

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list