kpilot Library API Documentation

options.cc

00001 /* options.cc                   KPilot
00002 **
00003 ** Copyright (C) 2000-2001 by Adriaan de Groot
00004 **
00005 ** This is a file of odds and ends, with debugging functions and stuff.
00006 */
00007 
00008 /*
00009 ** This program is free software; you can redistribute it and/or modify
00010 ** it under the terms of the GNU Lesser General Public License as published by
00011 ** the Free Software Foundation; either version 2.1 of the License, or
00012 ** (at your option) any later version.
00013 **
00014 ** This program is distributed in the hope that it will be useful,
00015 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00016 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00017 ** GNU Lesser General Public License for more details.
00018 **
00019 ** You should have received a copy of the GNU Lesser General Public License
00020 ** along with this program in a file called COPYING; if not, write to
00021 ** the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, 
00022 ** MA 02111-1307, USA.
00023 */
00024 
00025 /*
00026 ** Bug reports and questions can be sent to kde-pim@kde.org
00027 */
00028 
00029 
00030 static const char *options_id =
00031         "$Id: options.cc,v 1.7.4.5 2003/03/12 23:31:15 adridg Exp $";
00032 
00033 #include "options.h"
00034 
00035 
00036 #include <iostream>
00037 
00038 #include <qsize.h>
00039 
00040 #include <kconfig.h>
00041 #include <kdebug.h>
00042 #include <kcmdlineargs.h>
00043 
00044 // The daemon also has a debug level; debug_spaces is 60 spaces,
00045 // to align FUNCTIONSETUP output.
00046 //
00047 //
00048 #ifdef DEBUG
00049 int debug_level = 1;
00050 #else
00051 int debug_level = 0;
00052 #endif
00053 const char *debug_spaces =
00054         "                                                    ";
00055 
00056 QString qstringExpansion(const QString & s)
00057 {
00058         QString t;
00059 
00060         for (unsigned i = 0; i < s.length(); i++)
00061         {
00062                 t += s[i];
00063                 t += ' ';
00064                 t += QString::number((int) s[i].unicode());
00065                 t += ' ';
00066         }
00067 
00068         return t;
00069 }
00070 
00071 QString charExpansion(const char *s)
00072 {
00073         QString t;
00074 
00075         while (*s)
00076         {
00077                 t += QChar(*s);
00078                 t += ' ';
00079                 t += QString::number(*s);
00080                 t += ' ';
00081                 s++;
00082         }
00083 
00084         return t;
00085 }
00086 
00087 static KCmdLineOptions debug_options_[] = {
00088         {"debug <level>", I18N_NOOP("Set debugging level"), "0"},
00089         {0, 0, 0}
00090 };
00091 
00092 KCmdLineOptions *debug_options = debug_options_;
00093 
00094 
00095 int const fname = ((int) options_id);
00096 
00097 
KDE Logo
This file is part of the documentation for kdelibs Version 3.1.4.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Sat Oct 18 02:47:14 2003 by doxygen 1.3.4 written by Dimitri van Heesch, © 1997-2001