summaryrefslogtreecommitdiff
path: root/codemaker/source/cunomaker/cunooptions.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'codemaker/source/cunomaker/cunooptions.cxx')
-rw-r--r--codemaker/source/cunomaker/cunooptions.cxx72
1 files changed, 36 insertions, 36 deletions
diff --git a/codemaker/source/cunomaker/cunooptions.cxx b/codemaker/source/cunomaker/cunooptions.cxx
index ababcc32b79c..a26efe18361e 100644
--- a/codemaker/source/cunomaker/cunooptions.cxx
+++ b/codemaker/source/cunomaker/cunooptions.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -28,22 +28,22 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_codemaker.hxx"
-#include <stdio.h>
+#include <stdio.h>
-#include "cunooptions.hxx"
+#include "cunooptions.hxx"
using namespace rtl;
-sal_Bool CunoOptions::initOptions(int ac, char* av[], sal_Bool bCmdFile)
+sal_Bool CunoOptions::initOptions(int ac, char* av[], sal_Bool bCmdFile)
throw( IllegalArgument )
{
- sal_Bool ret = sal_True;
- sal_uInt16 i=0;
+ sal_Bool ret = sal_True;
+ sal_uInt16 i=0;
if (!bCmdFile)
{
bCmdFile = sal_True;
-
+
m_program = av[0];
if (ac < 2)
@@ -58,7 +58,7 @@ sal_Bool CunoOptions::initOptions(int ac, char* av[], sal_Bool bCmdFile)
i = 0;
}
- char *s=NULL;
+ char *s=NULL;
for (i; i < ac; i++)
{
if (av[i][0] == '-')
@@ -81,7 +81,7 @@ sal_Bool CunoOptions::initOptions(int ac, char* av[], sal_Bool bCmdFile)
{
tmp += " your input '" + OString(av[i+1]) + "'";
}
-
+
throw IllegalArgument(tmp);
}
} else
@@ -105,14 +105,14 @@ sal_Bool CunoOptions::initOptions(int ac, char* av[], sal_Bool bCmdFile)
{
tmp += " your input '" + OString(av[i+1]) + "'";
}
-
+
throw IllegalArgument(tmp);
}
} else
{
s = av[i] + 2;
}
-
+
m_options["-O"] = OString(s);
break;
case 'B':
@@ -129,14 +129,14 @@ sal_Bool CunoOptions::initOptions(int ac, char* av[], sal_Bool bCmdFile)
{
tmp += " your input '" + OString(av[i+1]) + "'";
}
-
+
throw IllegalArgument(tmp);
}
} else
{
s = av[i] + 2;
}
-
+
m_options["-B"] = OString(s);
break;
case 'T':
@@ -153,14 +153,14 @@ sal_Bool CunoOptions::initOptions(int ac, char* av[], sal_Bool bCmdFile)
{
tmp += " your input '" + OString(av[i+1]) + "'";
}
-
+
throw IllegalArgument(tmp);
}
} else
{
s = av[i] + 2;
}
-
+
if (m_options.count("-T") > 0)
{
OString tmp(m_options["-T"]);
@@ -182,7 +182,7 @@ sal_Bool CunoOptions::initOptions(int ac, char* av[], sal_Bool bCmdFile)
throw IllegalArgument(tmp);
}
-
+
m_options["-U"] = OString("");
break;
/*
@@ -197,7 +197,7 @@ sal_Bool CunoOptions::initOptions(int ac, char* av[], sal_Bool bCmdFile)
throw IllegalArgument(tmp);
}
-
+
if (isValid("-C") || isValid("-CS"))
{
OString tmp("'-L' could not be combined with '-C' or '-CS' option");
@@ -217,7 +217,7 @@ sal_Bool CunoOptions::initOptions(int ac, char* av[], sal_Bool bCmdFile)
throw IllegalArgument(tmp);
}
-
+
if (isValid("-L") || isValid("-CS"))
{
OString tmp("'-C' could not be combined with '-L' or '-CS' option");
@@ -252,12 +252,12 @@ sal_Bool CunoOptions::initOptions(int ac, char* av[], sal_Bool bCmdFile)
throw IllegalArgument(tmp);
}
-
+
m_options["-G"] = OString("");
break;
default:
throw IllegalArgument("the option is unknown" + OString(av[i]));
- break;
+ break;
}
} else
{
@@ -280,25 +280,25 @@ sal_Bool CunoOptions::initOptions(int ac, char* av[], sal_Bool bCmdFile)
rargc++;
}
fclose(cmdFile);
-
+
ret = initOptions(rargc, rargv, bCmdFile);
-
- for (long i=0; i < rargc; i++)
+
+ for (long i=0; i < rargc; i++)
{
free(rargv[i]);
}
- }
+ }
} else
{
m_inputFiles.push_back(av[i]);
- }
+ }
}
}
+
+ return ret;
+}
- return ret;
-}
-
-OString CunoOptions::prepareHelp()
+OString CunoOptions::prepareHelp()
{
OString help("\nusing: ");
help += m_program + " [-options] file_1 ... file_n\nOptions:\n";
@@ -307,27 +307,27 @@ OString CunoOptions::prepareHelp()
help += " -T<name> = name specifies a type or a list of types. The output for this\n";
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 += " 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 += " -U = activate the generating of a getCppuType_<name> function.\n";
-// help += " -L = getCppuType function with a known leak.\n";
+// help += " -L = getCppuType function with a known leak.\n";
help += " -C = getCppuType_<name> function keeps comprehensive type information.\n";
help += " -G = generate only target files which does not exists.\n";
help += " -Gc = generate only target files which content will be changed.\n";
help += prepareVersion();
-
+
return help;
-}
+}
-OString CunoOptions::prepareVersion()
+OString CunoOptions::prepareVersion()
{
OString version("\nSun Microsystems (R) ");
version += m_program + " Version 1.0\n\n";
return version;
-}
-
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */