/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ /* * 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/.
*/
void map_uno_type_to_net(typelib_TypeDescriptionReference* pTDRef, OUStringBuffer& buffer)
{ switch (pTDRef->eTypeClass)
{ case typelib_TypeClass_VOID:
buffer.append(u"System.Void"); break; case typelib_TypeClass_CHAR:
buffer.append(u"System.Char"); break; case typelib_TypeClass_BOOLEAN:
buffer.append(u"System.Boolean"); break; case typelib_TypeClass_BYTE:
buffer.append(u"System.SByte"); break; case typelib_TypeClass_SHORT:
buffer.append(u"System.Int16"); break; case typelib_TypeClass_UNSIGNED_SHORT:
buffer.append(u"System.UInt16"); break; case typelib_TypeClass_LONG:
buffer.append(u"System.Int32"); break; case typelib_TypeClass_UNSIGNED_LONG:
buffer.append(u"System.UInt32"); break; case typelib_TypeClass_HYPER:
buffer.append(u"System.Int64"); break; case typelib_TypeClass_UNSIGNED_HYPER:
buffer.append(u"System.UInt64"); break; case typelib_TypeClass_FLOAT:
buffer.append(u"System.Single"); break; case typelib_TypeClass_DOUBLE:
buffer.append(u"System.Double"); break; case typelib_TypeClass_STRING:
buffer.append(u"System.String"); break; case typelib_TypeClass_TYPE:
buffer.append(u"System.Type"); break; case typelib_TypeClass_ANY:
buffer.append(u"com.sun.star.uno.Any"); break;
case typelib_TypeClass_ENUM: case typelib_TypeClass_EXCEPTION: // These have the same name on both sides
buffer.append(OUString::unacquired(&pTDRef->pTypeName)); break;
case typelib_TypeClass_STRUCT: // These have the same name on both sides // TODO: What about polymorphic structs? Merge this with above cases if fine
buffer.append(OUString::unacquired(&pTDRef->pTypeName)); break;
case typelib_TypeClass_INTERFACE:
{ // These have the same name on both sides if (u"com.sun.star.uno.XInterface"_ustr.equals(pTDRef->pTypeName)) // Except XInterface, which does not exist on the .NET side
buffer.append(u"com.sun.star.uno.IQueryInterface"); else
buffer.append(OUString::unacquired(&pTDRef->pTypeName)); break;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.