2004-06-03 21:12:23 -05:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
2008-04-11 06:08:55 -05:00
|
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
2004-06-03 21:12:23 -05:00
|
|
|
*
|
2008-04-11 06:08:55 -05:00
|
|
|
* Copyright 2008 by Sun Microsystems, Inc.
|
2004-06-03 21:12:23 -05:00
|
|
|
*
|
2008-04-11 06:08:55 -05:00
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2004-06-03 21:12:23 -05:00
|
|
|
*
|
2008-04-11 06:08:55 -05:00
|
|
|
* $RCSfile: dumputils.cxx,v $
|
|
|
|
* $Revision: 1.7 $
|
2004-06-03 21:12:23 -05:00
|
|
|
*
|
2008-04-11 06:08:55 -05:00
|
|
|
* This file is part of OpenOffice.org.
|
2004-06-03 21:12:23 -05:00
|
|
|
*
|
2008-04-11 06:08:55 -05:00
|
|
|
* OpenOffice.org is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Lesser General Public License version 3
|
|
|
|
* only, as published by the Free Software Foundation.
|
2004-06-03 21:12:23 -05:00
|
|
|
*
|
2008-04-11 06:08:55 -05:00
|
|
|
* OpenOffice.org is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Lesser General Public License version 3 for more details
|
|
|
|
* (a copy is included in the LICENSE file that accompanied this code).
|
2004-06-03 21:12:23 -05:00
|
|
|
*
|
2008-04-11 06:08:55 -05:00
|
|
|
* You should have received a copy of the GNU Lesser General Public License
|
|
|
|
* version 3 along with OpenOffice.org. If not, see
|
|
|
|
* <http://www.openoffice.org/license.html>
|
|
|
|
* for a copy of the LGPLv3 License.
|
2004-06-03 21:12:23 -05:00
|
|
|
*
|
|
|
|
************************************************************************/
|
|
|
|
|
2006-09-16 21:37:08 -05:00
|
|
|
// MARKER(update_precomp.py): autogen include statement, do not remove
|
|
|
|
#include "precompiled_codemaker.hxx"
|
|
|
|
|
2004-06-03 21:12:23 -05:00
|
|
|
#include "dumputils.hxx"
|
|
|
|
|
|
|
|
#include "codemaker/global.hxx"
|
2006-03-15 02:14:19 -06:00
|
|
|
#include "codemaker/commoncpp.hxx"
|
2004-06-03 21:12:23 -05:00
|
|
|
|
|
|
|
#include "rtl/ustring.hxx"
|
|
|
|
#include "sal/types.h"
|
|
|
|
|
2006-03-15 02:14:19 -06:00
|
|
|
|
2004-06-03 21:12:23 -05:00
|
|
|
namespace codemaker { namespace cppumaker {
|
|
|
|
|
|
|
|
bool dumpNamespaceOpen(
|
2006-06-19 20:24:21 -05:00
|
|
|
FileStream & out, rtl::OString const & registryType, bool fullModuleType)
|
2004-06-03 21:12:23 -05:00
|
|
|
{
|
|
|
|
bool output = false;
|
|
|
|
if (registryType != "/") {
|
|
|
|
bool first = true;
|
|
|
|
for (sal_Int32 i = 0; i >= 0;) {
|
|
|
|
rtl::OString id(registryType.getToken(0, '/', i));
|
|
|
|
if (fullModuleType || i >= 0) {
|
|
|
|
if (!first) {
|
|
|
|
out << " ";
|
|
|
|
}
|
|
|
|
out << "namespace " << id << " {";
|
|
|
|
first = false;
|
|
|
|
output = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return output;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool dumpNamespaceClose(
|
|
|
|
FileStream & out, rtl::OString const & registryType, bool fullModuleType)
|
|
|
|
{
|
|
|
|
bool output = false;
|
|
|
|
if (registryType != "/") {
|
|
|
|
bool first = true;
|
|
|
|
for (sal_Int32 i = 0; i >= 0;) {
|
|
|
|
i = registryType.indexOf('/', i);
|
|
|
|
if (i >= 0) {
|
|
|
|
++i;
|
|
|
|
}
|
|
|
|
if (fullModuleType || i >= 0) {
|
|
|
|
if (!first) {
|
|
|
|
out << " ";
|
|
|
|
}
|
|
|
|
out << "}";
|
|
|
|
first = false;
|
|
|
|
output = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return output;
|
|
|
|
}
|
|
|
|
|
2006-06-19 20:24:21 -05:00
|
|
|
void dumpTypeIdentifier(FileStream & out, rtl::OString const & registryType) {
|
2004-06-03 21:12:23 -05:00
|
|
|
out << registryType.copy(registryType.lastIndexOf('/') + 1);
|
|
|
|
}
|
|
|
|
|
|
|
|
} }
|