diff options
author | RĂ¼diger Timm <rt@openoffice.org> | 2004-05-18 12:40:57 +0000 |
---|---|---|
committer | RĂ¼diger Timm <rt@openoffice.org> | 2004-05-18 12:40:57 +0000 |
commit | 15bd5d6f3907ccaec68fd95f9045256c5ab77a88 (patch) | |
tree | 27aa4cf7ec55a9e41d59a98d2037558d0f3258d5 /idlc/source/idlcmain.cxx | |
parent | 4ad36d7047c93ccec11fe5768b285d7ffeef51f1 (diff) |
INTEGRATION: CWS sdk13 (1.8.16); FILE MERGED
2004/05/13 20:02:02 jsc 1.8.16.3: #116180# use vector iterator
2004/05/12 09:55:20 jsc 1.8.16.2: RESYNC: (1.8-1.9); FILE MERGED
2004/05/07 07:19:41 jsc 1.8.16.1: #116180# change default for generation urd files
Diffstat (limited to 'idlc/source/idlcmain.cxx')
-rw-r--r-- | idlc/source/idlcmain.cxx | 65 |
1 files changed, 34 insertions, 31 deletions
diff --git a/idlc/source/idlcmain.cxx b/idlc/source/idlcmain.cxx index f39b9e0d440e..74f5527f2751 100644 --- a/idlc/source/idlcmain.cxx +++ b/idlc/source/idlcmain.cxx @@ -2,9 +2,9 @@ * * $RCSfile: idlcmain.cxx,v $ * - * $Revision: 1.9 $ + * $Revision: 1.10 $ * - * last change: $Author: rt $ $Date: 2004-03-30 16:47:32 $ + * last change: $Author: rt $ $Date: 2004-05-18 13:40:57 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -114,36 +114,39 @@ int SAL_CALL main( int argc, char** argv ) for (StringVector::const_iterator i(files.begin()); i != files.end() && nErrors == 0; ++i) { - fprintf( - stdout, "%s: compile file %s...\n", - options.getProgramName().getStr(), i->getStr()); - OString pathname(convertToAbsoluteSystemPath(*i)); - nErrors = compileFile(&pathname); - if (idlc()->getWarningCount() > 0) { - fprintf( - stdout, "%s: detected %d warnings compiling file %s\n", - options.getProgramName().getStr(), idlc()->getWarningCount(), - i->getStr()); - } - sal_Int32 n = pathname.lastIndexOf(SEPARATOR) + 1; - OString filenameBase( - pathname.copy( - n, pathname.getLength() - n - RTL_CONSTASCII_LENGTH(".idl"))); - if (nErrors > 0) { - OString outputPathname; - if (options.isValid("-O")) { - OString outputPathname = convertToAbsoluteSystemPath( - options.getOption("-O")); - if (outputPathname[outputPathname.getLength() - 1] != '/') { - outputPathname += "/"; - } - } - outputPathname += filenameBase; - outputPathname += ".urd"; - removeIfExists(outputPathname); - } else { - nErrors = produceFile(filenameBase); + OString sysFileName( convertToAbsoluteSystemPath(*i) ); + + fprintf(stdout, "%s: compile '%s' ... \n", + options.getProgramName().getStr(), (*i).getStr()); + nErrors = compileFile(&sysFileName); + + if ( idlc()->getWarningCount() ) + fprintf(stdout, "%s: detected %d warnings compiling file '%s'\n", + options.getProgramName().getStr(), idlc()->getWarningCount(), + (*i).getStr(), options.prepareVersion().getStr()); + + // prepare output file name + OString outputFileUrl; + if ( options.isValid("-O") ) + { + OString strippedFileName(sysFileName.copy(sysFileName.lastIndexOf(SEPARATOR) + 1)); + outputFileUrl = convertToFileUrl(options.getOption("-O")); + sal_Char c = outputFileUrl.getStr()[outputFileUrl.getLength()-1]; + + if ( c != '/' ) + outputFileUrl += OString::valueOf('/'); + + outputFileUrl += strippedFileName.replaceAt(strippedFileName.getLength() -3 , 3, "urd"); + } else + { + outputFileUrl = convertToFileUrl(sysFileName.replaceAt(sysFileName.getLength() -3 , 3, "urd")); } + + if ( nErrors ) + removeIfExists(outputFileUrl); + else + nErrors = produceFile(outputFileUrl); + idlc()->reset(); } |