[med-svn] r16775 - in trunk/packages/camitk/trunk/debian: . patches tests
Emmanuel Promayon
promayon-guest at moszumanska.debian.org
Thu Apr 24 16:28:58 UTC 2014
Author: promayon-guest
Date: 2014-04-24 16:28:58 +0000 (Thu, 24 Apr 2014)
New Revision: 16775
Modified:
trunk/packages/camitk/trunk/debian/changelog
trunk/packages/camitk/trunk/debian/libcamitk3.lintian-overrides
trunk/packages/camitk/trunk/debian/patches/applications-man-pixmap-desktop.diff
trunk/packages/camitk/trunk/debian/patches/config-console-redirection.diff
trunk/packages/camitk/trunk/debian/rules
trunk/packages/camitk/trunk/debian/tests/config
Log:
updated for the last upstream version 3.3.1
Modified: trunk/packages/camitk/trunk/debian/changelog
===================================================================
--- trunk/packages/camitk/trunk/debian/changelog 2014-04-24 14:51:06 UTC (rev 16774)
+++ trunk/packages/camitk/trunk/debian/changelog 2014-04-24 16:28:58 UTC (rev 16775)
@@ -1,4 +1,4 @@
-camitk (3.3.0-1) UNRELEASED; urgency=low
+camitk (3.3.1-1) UNRELEASED; urgency=low
* New upstream release.
* Patches:
@@ -8,7 +8,7 @@
* Added some debian/tests files for autopkgtest
* New dicom components now directly based on gdcm
- -- Emmanuel Promayon <Emmanuel.Promayon at imag.fr> Fri, 28 Mar 2014 19:44:50 +0100
+ -- Emmanuel Promayon <Emmanuel.Promayon at imag.fr> Thu, 24 Apr 2014 07:33:12 +0200
camitk (3.2.2-2) unstable; urgency=medium
Modified: trunk/packages/camitk/trunk/debian/libcamitk3.lintian-overrides
===================================================================
--- trunk/packages/camitk/trunk/debian/libcamitk3.lintian-overrides 2014-04-24 14:51:06 UTC (rev 16774)
+++ trunk/packages/camitk/trunk/debian/libcamitk3.lintian-overrides 2014-04-24 16:28:58 UTC (rev 16775)
@@ -1,6 +1,6 @@
# W overrides for package-name-doesnt-match-sonames
# The produced lib given by
-# objdump -p ./obj-x86_64-linux-gnu/lib/libcamitkcore.so.3.2.0 | sed -n -e's/^[[:space:]]*SONAME[[:space:]]*//p' | sed -r -e's/([0-9])\.so\./\1-/; s/\.so(\.|$)//; y/_/-/; s/(.*)/\L&/'
+# objdump -p camitk-build/lib/libcamitkcore.so.3.3.1 | sed -n -e's/^[[:space:]]*SONAME[[:space:]]*//p' | sed -r -e's/([0-9])\.so\./\1-/; s/\.so(\.|$)//; y/_/-/; s/(.*)/\L&/'
# is "libcamitkcore3"
# but the package is called libcamitk3 (which is more than just the corelib)
libcamitk3: package-name-doesnt-match-sonames libcamitkcore3
Modified: trunk/packages/camitk/trunk/debian/patches/applications-man-pixmap-desktop.diff
===================================================================
--- trunk/packages/camitk/trunk/debian/patches/applications-man-pixmap-desktop.diff 2014-04-24 14:51:06 UTC (rev 16774)
+++ trunk/packages/camitk/trunk/debian/patches/applications-man-pixmap-desktop.diff 2014-04-24 16:28:58 UTC (rev 16775)
@@ -1,480 +1,6 @@
-Index: camitk/sdk/applications/wizard/CommandLineOptions.cxx
-===================================================================
---- camitk/sdk/applications/wizard/CommandLineOptions.cxx (revision 0)
-+++ camitk/sdk/applications/wizard/CommandLineOptions.cxx (revision 1369)
-@@ -0,0 +1,472 @@
-+// This code was generated by CLI, a command line interface
-+// compiler for C++.
-+//
-+
-+#include "CommandLineOptions.hxx"
-+
-+#include <map>
-+#include <set>
-+#include <string>
-+#include <vector>
-+#include <ostream>
-+#include <sstream>
-+
-+namespace cli
-+{
-+ // unknown_option
-+ //
-+ unknown_option::
-+ ~unknown_option () throw ()
-+ {
-+ }
-+
-+ void unknown_option::
-+ print (std::ostream& os) const
-+ {
-+ os << "unknown option '" << option () << "'";
-+ }
-+
-+ const char* unknown_option::
-+ what () const throw ()
-+ {
-+ return "unknown option";
-+ }
-+
-+ // unknown_argument
-+ //
-+ unknown_argument::
-+ ~unknown_argument () throw ()
-+ {
-+ }
-+
-+ void unknown_argument::
-+ print (std::ostream& os) const
-+ {
-+ os << "unknown argument '" << argument () << "'";
-+ }
-+
-+ const char* unknown_argument::
-+ what () const throw ()
-+ {
-+ return "unknown argument";
-+ }
-+
-+ // missing_value
-+ //
-+ missing_value::
-+ ~missing_value () throw ()
-+ {
-+ }
-+
-+ void missing_value::
-+ print (std::ostream& os) const
-+ {
-+ os << "missing value for option '" << option () << "'";
-+ }
-+
-+ const char* missing_value::
-+ what () const throw ()
-+ {
-+ return "missing option value";
-+ }
-+
-+ // invalid_value
-+ //
-+ invalid_value::
-+ ~invalid_value () throw ()
-+ {
-+ }
-+
-+ void invalid_value::
-+ print (std::ostream& os) const
-+ {
-+ os << "invalid value '" << value () << "' for option '"
-+ << option () << "'";
-+ }
-+
-+ const char* invalid_value::
-+ what () const throw ()
-+ {
-+ return "invalid option value";
-+ }
-+
-+ // eos_reached
-+ //
-+ void eos_reached::
-+ print (std::ostream& os) const
-+ {
-+ os << what ();
-+ }
-+
-+ const char* eos_reached::
-+ what () const throw ()
-+ {
-+ return "end of argument stream reached";
-+ }
-+
-+ // scanner
-+ //
-+ scanner::
-+ ~scanner ()
-+ {
-+ }
-+
-+ // argv_scanner
-+ //
-+ bool argv_scanner::
-+ more ()
-+ {
-+ return i_ < argc_;
-+ }
-+
-+ const char* argv_scanner::
-+ peek ()
-+ {
-+ if (i_ < argc_)
-+ return argv_[i_];
-+ else
-+ throw eos_reached ();
-+ }
-+
-+ const char* argv_scanner::
-+ next ()
-+ {
-+ if (i_ < argc_)
-+ {
-+ const char* r (argv_[i_]);
-+
-+ if (erase_)
-+ {
-+ for (int i (i_ + 1); i < argc_; ++i)
-+ argv_[i - 1] = argv_[i];
-+
-+ --argc_;
-+ argv_[argc_] = 0;
-+ }
-+ else
-+ ++i_;
-+
-+ return r;
-+ }
-+ else
-+ throw eos_reached ();
-+ }
-+
-+ void argv_scanner::
-+ skip ()
-+ {
-+ if (i_ < argc_)
-+ ++i_;
-+ else
-+ throw eos_reached ();
-+ }
-+
-+ template <typename X>
-+ struct parser
-+ {
-+ static void
-+ parse (X& x, scanner& s)
-+ {
-+ const char* o (s.next ());
-+
-+ if (s.more ())
-+ {
-+ const char* v (s.next ());
-+ std::istringstream is (v);
-+ if (!(is >> x && is.eof ()))
-+ throw invalid_value (o, v);
-+ }
-+ else
-+ throw missing_value (o);
-+ }
-+ };
-+
-+ template <>
-+ struct parser<bool>
-+ {
-+ static void
-+ parse (bool& x, scanner& s)
-+ {
-+ s.next ();
-+ x = true;
-+ }
-+ };
-+
-+ template <>
-+ struct parser<std::string>
-+ {
-+ static void
-+ parse (std::string& x, scanner& s)
-+ {
-+ const char* o (s.next ());
-+
-+ if (s.more ())
-+ x = s.next ();
-+ else
-+ throw missing_value (o);
-+ }
-+ };
-+
-+ template <typename X>
-+ struct parser<std::vector<X> >
-+ {
-+ static void
-+ parse (std::vector<X>& c, scanner& s)
-+ {
-+ X x;
-+ parser<X>::parse (x, s);
-+ c.push_back (x);
-+ }
-+ };
-+
-+ template <typename X>
-+ struct parser<std::set<X> >
-+ {
-+ static void
-+ parse (std::set<X>& c, scanner& s)
-+ {
-+ X x;
-+ parser<X>::parse (x, s);
-+ c.insert (x);
-+ }
-+ };
-+
-+ template <typename K, typename V>
-+ struct parser<std::map<K, V> >
-+ {
-+ static void
-+ parse (std::map<K, V>& m, scanner& s)
-+ {
-+ const char* o (s.next ());
-+
-+ if (s.more ())
-+ {
-+ std::string ov (s.next ());
-+ std::string::size_type p = ov.find ('=');
-+
-+ if (p == std::string::npos)
-+ {
-+ K k = K ();
-+
-+ if (!ov.empty ())
-+ {
-+ std::istringstream ks (ov);
-+
-+ if (!(ks >> k && ks.eof ()))
-+ throw invalid_value (o, ov);
-+ }
-+
-+ m[k] = V ();
-+ }
-+ else
-+ {
-+ K k = K ();
-+ V v = V ();
-+ std::string kstr (ov, 0, p);
-+ std::string vstr (ov, p + 1);
-+
-+ if (!kstr.empty ())
-+ {
-+ std::istringstream ks (kstr);
-+
-+ if (!(ks >> k && ks.eof ()))
-+ throw invalid_value (o, ov);
-+ }
-+
-+ if (!vstr.empty ())
-+ {
-+ std::istringstream vs (vstr);
-+
-+ if (!(vs >> v && vs.eof ()))
-+ throw invalid_value (o, ov);
-+ }
-+
-+ m[k] = v;
-+ }
-+ }
-+ else
-+ throw missing_value (o);
-+ }
-+ };
-+
-+ template <typename X, typename T, T X::*P>
-+ void
-+ thunk (X& x, scanner& s)
-+ {
-+ parser<T>::parse (x.*P, s);
-+ }
-+}
-+
-+#include <map>
-+#include <cstring>
-+
-+// options
-+//
-+
-+options::
-+options (int& argc,
-+ char** argv,
-+ bool erase,
-+ ::cli::unknown_mode opt,
-+ ::cli::unknown_mode arg)
-+: help_ (),
-+ version_ ()
-+{
-+ ::cli::argv_scanner s (argc, argv, erase);
-+ _parse (s, opt, arg);
-+}
-+
-+options::
-+options (int start,
-+ int& argc,
-+ char** argv,
-+ bool erase,
-+ ::cli::unknown_mode opt,
-+ ::cli::unknown_mode arg)
-+: help_ (),
-+ version_ ()
-+{
-+ ::cli::argv_scanner s (start, argc, argv, erase);
-+ _parse (s, opt, arg);
-+}
-+
-+options::
-+options (int& argc,
-+ char** argv,
-+ int& end,
-+ bool erase,
-+ ::cli::unknown_mode opt,
-+ ::cli::unknown_mode arg)
-+: help_ (),
-+ version_ ()
-+{
-+ ::cli::argv_scanner s (argc, argv, erase);
-+ _parse (s, opt, arg);
-+ end = s.end ();
-+}
-+
-+options::
-+options (int start,
-+ int& argc,
-+ char** argv,
-+ int& end,
-+ bool erase,
-+ ::cli::unknown_mode opt,
-+ ::cli::unknown_mode arg)
-+: help_ (),
-+ version_ ()
-+{
-+ ::cli::argv_scanner s (start, argc, argv, erase);
-+ _parse (s, opt, arg);
-+ end = s.end ();
-+}
-+
-+options::
-+options (::cli::scanner& s,
-+ ::cli::unknown_mode opt,
-+ ::cli::unknown_mode arg)
-+: help_ (),
-+ version_ ()
-+{
-+ _parse (s, opt, arg);
-+}
-+
-+void options::
-+print_usage (::std::ostream& os)
-+{
-+ os << "--help|-h Print usage information and exit." << ::std::endl;
-+
-+ os << "--version|-v Print CamiTK version message and exit" << ::std::endl;
-+}
-+
-+typedef
-+std::map<std::string, void (*) (options&, ::cli::scanner&)>
-+_cli_options_map;
-+
-+static _cli_options_map _cli_options_map_;
-+
-+struct _cli_options_map_init
-+{
-+ _cli_options_map_init ()
-+ {
-+ _cli_options_map_["--help"] =
-+ &::cli::thunk< options, bool, &options::help_ >;
-+ _cli_options_map_["-h"] =
-+ &::cli::thunk< options, bool, &options::help_ >;
-+ _cli_options_map_["--version"] =
-+ &::cli::thunk< options, bool, &options::version_ >;
-+ _cli_options_map_["-v"] =
-+ &::cli::thunk< options, bool, &options::version_ >;
-+ }
-+} _cli_options_map_init_;
-+
-+void options::
-+_parse (::cli::scanner& s,
-+ ::cli::unknown_mode opt_mode,
-+ ::cli::unknown_mode arg_mode)
-+{
-+ bool opt = true;
-+
-+ while (s.more ())
-+ {
-+ const char* o = s.peek ();
-+
-+ if (std::strcmp (o, "--") == 0)
-+ {
-+ s.skip ();
-+ opt = false;
-+ continue;
-+ }
-+
-+ _cli_options_map::const_iterator i (
-+ opt ? _cli_options_map_.find (o) : _cli_options_map_.end ());
-+
-+ if (i != _cli_options_map_.end ())
-+ {
-+ (*(i->second)) (*this, s);
-+ }
-+ else if (opt && std::strncmp (o, "-", 1) == 0 && o[1] != '\0')
-+ {
-+ switch (opt_mode)
-+ {
-+ case ::cli::unknown_mode::skip:
-+ {
-+ s.skip ();
-+ continue;
-+ }
-+ case ::cli::unknown_mode::stop:
-+ {
-+ break;
-+ }
-+ case ::cli::unknown_mode::fail:
-+ {
-+ throw ::cli::unknown_option (o);
-+ }
-+ }
-+
-+ break;
-+ }
-+ else
-+ {
-+ switch (arg_mode)
-+ {
-+ case ::cli::unknown_mode::skip:
-+ {
-+ s.skip ();
-+ continue;
-+ }
-+ case ::cli::unknown_mode::stop:
-+ {
-+ break;
-+ }
-+ case ::cli::unknown_mode::fail:
-+ {
-+ throw ::cli::unknown_argument (o);
-+ }
-+ }
-+
-+ break;
-+ }
-+ }
-+}
-+
+Description: cepgenerator and wizard needs a manpage, wizard needs an xpm and desktop file
+Author: Emmanuel Promayon <Emmanuel.Promayon at imag.fr>
+Last-Update: 2014-04-23
Index: camitk/sdk/applications/wizard/resources/manpage-prologue.1.in
===================================================================
--- camitk/sdk/applications/wizard/resources/manpage-prologue.1.in (revision 0)
@@ -493,7 +19,7 @@
+.br
+(c) UJF\-Grenoble 1, CNRS, TIMC\-IMAG UMR 5525
+.PP
-+camitk\- at APPLICATION_NAME@ is a developer tool for CamiTK, the Computer
++camitk\- at APPLICATION_NAME@ is a developer tool for CamiTK, the Computer
+Assisted Medical Intervention Tool Kit.
+It is a GUI only application that helps you start with CamiTK Extension
+Projects (CEP).
@@ -502,7 +28,7 @@
+for you, and guides you through the different steps to add your own Actions
+and Components extensions.
+The wizard generate your CEP's files and the skeleton of your C++ classes of
-+your extensions.
++your extensions.
+.PP
+Using this application you can generate a new component extension or a
+new action extension. It helps you fill all the needed information
@@ -4748,1624 +4274,6 @@
+Categories=Development;Building
+Keywords=CamiTK;Extension;CEP;Plugin
\ No newline at end of file
-Index: camitk/sdk/applications/wizard/Main.cpp
-===================================================================
---- camitk/sdk/applications/wizard/Main.cpp (revision 1367)
-+++ camitk/sdk/applications/wizard/Main.cpp (revision 1369)
-@@ -22,23 +22,73 @@
- *
- * $CAMITK_LICENCE_END$
- ****************************************************************************/
--//Import .h file
-+
- #include "WizardController.h"
-
--//#include "DataWizard.h"
-+// CamiTK stuff
-+#include <Core.h>
-
- //Imports from Qt
- #include <QApplication>
- #include <iostream>
-
-+// CLI stuff
-+#include "CommandLineOptions.hxx"
-+
-+// usage for this application
-+void usage(char *appName) {
-+ std::cerr << appName << std::endl;
-+ std::cerr << std::endl;
-+ std::cerr << "Usage: " << appName << " [options]" << std::endl;
-+ std::cerr << "Build using " << camitk::Core::version << std::endl;
-+ std::cerr << std::endl;
-+ std::cerr << "Options:" << endl;
-+ options::print_usage(std::cerr);
-+}
-+
-+
- int main(int argc, char * argv[]) {
-- QApplication app(argc, argv);
-+ try {
-+ QApplication app(argc, argv);
-
-- // call to controller
-- WizardController *controller = new WizardController();
-- controller->launch();
-- return app.exec();
-+ int end; // End of options.
-+ options o(argc, argv, end);
-
-+ if (o.help()) {
-+ usage(argv[0]);
-+ return EXIT_SUCCESS;
-+ }
-+ else {
-+ // print all types of versions (just using the char* defined in CamiTKVersion.h at configuration time)
-+ if (o.version()) {
-+ std::cout << argv[0] << " build using " << camitk::Core::version << std::endl;
-+ return EXIT_SUCCESS;
-+ }
-+ else {
-+ // call to controller
-+ WizardController *controller = new WizardController();
-+ controller->launch();
-+ return app.exec();
-+ }
-+ }
-+ }
-+ catch (const cli::exception& e) {
-+ cerr << e << endl;
-+ usage(argv[0]);
-+ return EXIT_FAILURE;
-+ }
-+ catch (camitk::AbortException& e) {
-+ std::cout << argv[0] << " aborted..." << std::endl << "camitk AbortException:" << std::endl << e.what() << std::endl;
-+ return EXIT_FAILURE;
-+ }
-+ catch (std::exception& e) {
-+ std::cout << argv[0] << " aborted..." << std::endl << "std AbortException:" << std::endl << e.what() << std::endl;
-+ return EXIT_FAILURE;
-+ }
-+ catch (...) {
-+ std::cout << argv[0] << " aborted..." << std::endl << "Unknown Exception" << std::endl;
-+ return EXIT_FAILURE;
-+ }
- }
-
-
-Index: camitk/sdk/applications/wizard/CommandLineOptions.hxx
-===================================================================
---- camitk/sdk/applications/wizard/CommandLineOptions.hxx (revision 0)
-+++ camitk/sdk/applications/wizard/CommandLineOptions.hxx (revision 1369)
-@@ -0,0 +1,260 @@
-+// This code was generated by CLI, a command line interface
-+// compiler for C++.
-+//
-+
-+#ifndef COMMAND_LINE_OPTIONS_HXX
-+#define COMMAND_LINE_OPTIONS_HXX
-+
-+#include <iosfwd>
-+#include <string>
-+#include <exception>
-+
-+namespace cli
-+{
-+ class unknown_mode
-+ {
-+ public:
-+ enum value
-+ {
-+ skip,
-+ stop,
-+ fail
-+ };
-+
-+ unknown_mode (value v);
-+
-+ operator value () const
-+ {
-+ return v_;
-+ }
-+
-+ private:
-+ value v_;
-+ };
-+
-+ // Exceptions.
-+ //
-+
-+ class exception: public std::exception
-+ {
-+ public:
-+ virtual void
-+ print (std::ostream&) const = 0;
-+ };
-+
-+ std::ostream&
-+ operator<< (std::ostream&, const exception&);
-+
-+ class unknown_option: public exception
-+ {
-+ public:
-+ virtual
-+ ~unknown_option () throw ();
-+
-+ unknown_option (const std::string& option);
-+
-+ const std::string&
-+ option () const;
-+
-+ virtual void
-+ print (std::ostream&) const;
-+
-+ virtual const char*
-+ what () const throw ();
-+
-+ private:
-+ std::string option_;
-+ };
-+
-+ class unknown_argument: public exception
-+ {
-+ public:
-+ virtual
-+ ~unknown_argument () throw ();
-+
-+ unknown_argument (const std::string& argument);
-+
-+ const std::string&
-+ argument () const;
-+
-+ virtual void
-+ print (std::ostream&) const;
-+
-+ virtual const char*
-+ what () const throw ();
-+
-+ private:
-+ std::string argument_;
-+ };
-+
-+ class missing_value: public exception
-+ {
-+ public:
-+ virtual
-+ ~missing_value () throw ();
-+
-+ missing_value (const std::string& option);
-+
-+ const std::string&
-+ option () const;
-+
-+ virtual void
-+ print (std::ostream&) const;
-+
-+ virtual const char*
-+ what () const throw ();
-+
-+ private:
-+ std::string option_;
-+ };
-+
-+ class invalid_value: public exception
-+ {
-+ public:
-+ virtual
-+ ~invalid_value () throw ();
-+
-+ invalid_value (const std::string& option,
-+ const std::string& value);
-+
-+ const std::string&
-+ option () const;
-+
-+ const std::string&
-+ value () const;
-+
-+ virtual void
-+ print (std::ostream&) const;
-+
-+ virtual const char*
-+ what () const throw ();
-+
-+ private:
-+ std::string option_;
-+ std::string value_;
-+ };
-+
-+ class eos_reached: public exception
-+ {
-+ public:
-+ virtual void
-+ print (std::ostream&) const;
-+
-+ virtual const char*
-+ what () const throw ();
-+ };
-+
-+ class scanner
-+ {
-+ public:
-+ virtual
-+ ~scanner ();
-+
-+ virtual bool
-+ more () = 0;
-+
-+ virtual const char*
-+ peek () = 0;
-+
-+ virtual const char*
-+ next () = 0;
-+
-+ virtual void
-+ skip () = 0;
-+ };
-+
-+ class argv_scanner: public scanner
-+ {
-+ public:
-+ argv_scanner (int& argc, char** argv, bool erase = false);
-+ argv_scanner (int start, int& argc, char** argv, bool erase = false);
-+
-+ int
-+ end () const;
-+
-+ virtual bool
-+ more ();
-+
-+ virtual const char*
-+ peek ();
-+
-+ virtual const char*
-+ next ();
-+
-+ virtual void
-+ skip ();
-+
-+ private:
-+ int i_;
-+ int& argc_;
-+ char** argv_;
-+ bool erase_;
-+ };
-+}
-+
-+#include <string>
-+
-+class options
-+{
-+ public:
-+
-+ options (int& argc,
-+ char** argv,
-+ bool erase = false,
-+ ::cli::unknown_mode option = ::cli::unknown_mode::fail,
-+ ::cli::unknown_mode argument = ::cli::unknown_mode::stop);
-+
-+ options (int start,
-+ int& argc,
-+ char** argv,
-+ bool erase = false,
-+ ::cli::unknown_mode option = ::cli::unknown_mode::fail,
-+ ::cli::unknown_mode argument = ::cli::unknown_mode::stop);
-+
-+ options (int& argc,
-+ char** argv,
-+ int& end,
-+ bool erase = false,
-+ ::cli::unknown_mode option = ::cli::unknown_mode::fail,
-+ ::cli::unknown_mode argument = ::cli::unknown_mode::stop);
-+
-+ options (int start,
-+ int& argc,
-+ char** argv,
-+ int& end,
-+ bool erase = false,
-+ ::cli::unknown_mode option = ::cli::unknown_mode::fail,
-+ ::cli::unknown_mode argument = ::cli::unknown_mode::stop);
-+
-+ options (::cli::scanner&,
-+ ::cli::unknown_mode option = ::cli::unknown_mode::fail,
-+ ::cli::unknown_mode argument = ::cli::unknown_mode::stop);
-+
-+ // Option accessors.
-+ //
-+
-+ const bool&
-+ help () const;
-+
-+ const bool&
-+ version () const;
-+
-+ // Print usage information.
-+ //
-+ static void
-+ print_usage (::std::ostream&);
-+
-+ private:
-+ void
-+ _parse (::cli::scanner&,
-+ ::cli::unknown_mode option,
-+ ::cli::unknown_mode argument);
-+
-+ public:
-+ bool help_;
-+ bool version_;
-+};
-+
-+#include "CommandLineOptions.ixx"
-+
-+#endif // COMMAND_LINE_OPTIONS_HXX
-Index: camitk/sdk/applications/wizard/CommandLineOptions.cli
-===================================================================
---- camitk/sdk/applications/wizard/CommandLineOptions.cli (revision 0)
-+++ camitk/sdk/applications/wizard/CommandLineOptions.cli (revision 1369)
-@@ -0,0 +1,15 @@
-+// Code Synthesis CLI configuration
-+// see http://codesynthesis.com/projects/cli
-+//
-+// cli must be run everytime this file is modified:
-+// clicxx CommandLineOptions.cli
-+//
-+// to update the manpage:
-+// clicxx --stdout --man-prologue manpage-prologue.1.in --man-epilogue manpage-epilogue.1.in --generate-man CommandLineOptions.cli > camitk-wizard.1.in
-+
-+include <string>;
-+
-+class options {
-+ bool --help | -h {"Print usage information and exit."};
-+ bool --version | -v {"Print CamiTK version message and exit"};
-+};
-\ No newline at end of file
-Index: camitk/sdk/applications/wizard/CMakeLists.txt
-===================================================================
---- camitk/sdk/applications/wizard/CMakeLists.txt (revision 1367)
-+++ camitk/sdk/applications/wizard/CMakeLists.txt (revision 1369)
-@@ -1,8 +1,9 @@
--camitk_application( DEFAULT
-- NEEDS_XSD
-- NEEDS_XERCESC
-- NEEDS_CEP_LIBRARIES cepgenerator cepcoreschema
-- CEP_NAME OZ
-- DESCRIPTION "Create CEP and file skeletons from GUI"
-+camitk_application(DEFAULT
-+ NEEDS_XSD
-+ NEEDS_XERCESC
-+ NEEDS_CEP_LIBRARIES cepgenerator cepcoreschema
-+ CEP_NAME SDK
-+ ADDITIONAL_SOURCES CommandLineOptions.cxx CommandLineOptions.hxx CommandLineOptions.ixx
-+ DESCRIPTION "Create CEP and file skeletons from GUI"
- )
-
-Index: camitk/sdk/applications/wizard/CommandLineOptions.ixx
-===================================================================
---- camitk/sdk/applications/wizard/CommandLineOptions.ixx (revision 0)
-+++ camitk/sdk/applications/wizard/CommandLineOptions.ixx (revision 1369)
-@@ -0,0 +1,122 @@
-+// This code was generated by CLI, a command line interface
-+// compiler for C++.
-+//
-+
-+namespace cli
-+{
-+ // unknown_mode
-+ //
-+ inline unknown_mode::
-+ unknown_mode (value v)
-+ : v_ (v)
-+ {
-+ }
-+
-+ // exception
-+ //
-+ inline std::ostream&
-+ operator<< (std::ostream& os, const exception& e)
-+ {
-+ e.print (os);
-+ return os;
-+ }
-+
-+ // unknown_option
-+ //
-+ inline unknown_option::
-+ unknown_option (const std::string& option)
-+ : option_ (option)
-+ {
-+ }
-+
-+ inline const std::string& unknown_option::
-+ option () const
-+ {
-+ return option_;
-+ }
-+
-+ // unknown_argument
-+ //
-+ inline unknown_argument::
-+ unknown_argument (const std::string& argument)
-+ : argument_ (argument)
-+ {
-+ }
-+
-+ inline const std::string& unknown_argument::
-+ argument () const
-+ {
-+ return argument_;
-+ }
-+
-+ // missing_value
-+ //
-+ inline missing_value::
-+ missing_value (const std::string& option)
-+ : option_ (option)
-+ {
-+ }
-+
-+ inline const std::string& missing_value::
-+ option () const
-+ {
-+ return option_;
-+ }
-+
-+ // invalid_value
-+ //
-+ inline invalid_value::
-+ invalid_value (const std::string& option,
-+ const std::string& value)
-+ : option_ (option), value_ (value)
-+ {
-+ }
-+
-+ inline const std::string& invalid_value::
-+ option () const
-+ {
-+ return option_;
-+ }
-+
-+ inline const std::string& invalid_value::
-+ value () const
-+ {
-+ return value_;
-+ }
-+
-+ // argv_scanner
-+ //
-+ inline argv_scanner::
-+ argv_scanner (int& argc, char** argv, bool erase)
-+ : i_ (1), argc_ (argc), argv_ (argv), erase_ (erase)
-+ {
-+ }
-+
-+ inline argv_scanner::
-+ argv_scanner (int start, int& argc, char** argv, bool erase)
-+ : i_ (start), argc_ (argc), argv_ (argv), erase_ (erase)
-+ {
-+ }
-+
-+ inline int argv_scanner::
-+ end () const
-+ {
-+ return i_;
-+ }
-+}
-+
-+// options
-+//
-+
-+inline const bool& options::
-+help () const
-+{
-+ return this->help_;
-+}
-+
-+inline const bool& options::
-+version () const
-+{
-+ return this->version_;
-+}
-+
-Index: camitk/sdk/applications/cepgenerator/CommandLineOptions.cxx
-===================================================================
---- camitk/sdk/applications/cepgenerator/CommandLineOptions.cxx (revision 0)
-+++ camitk/sdk/applications/cepgenerator/CommandLineOptions.cxx (revision 1369)
-@@ -0,0 +1,495 @@
-+// This code was generated by CLI, a command line interface
-+// compiler for C++.
-+//
-+
-+#include "CommandLineOptions.hxx"
-+
-+#include <map>
-+#include <set>
-+#include <string>
-+#include <vector>
-+#include <ostream>
-+#include <sstream>
-+
-+namespace cli
-+{
-+ // unknown_option
-+ //
-+ unknown_option::
-+ ~unknown_option () throw ()
-+ {
-+ }
-+
-+ void unknown_option::
-+ print (std::ostream& os) const
-+ {
-+ os << "unknown option '" << option () << "'";
-+ }
-+
-+ const char* unknown_option::
-+ what () const throw ()
-+ {
-+ return "unknown option";
-+ }
-+
-+ // unknown_argument
-+ //
-+ unknown_argument::
-+ ~unknown_argument () throw ()
-+ {
-+ }
-+
-+ void unknown_argument::
-+ print (std::ostream& os) const
-+ {
-+ os << "unknown argument '" << argument () << "'";
-+ }
-+
-+ const char* unknown_argument::
-+ what () const throw ()
-+ {
-+ return "unknown argument";
-+ }
-+
-+ // missing_value
-+ //
-+ missing_value::
-+ ~missing_value () throw ()
-+ {
-+ }
-+
-+ void missing_value::
-+ print (std::ostream& os) const
-+ {
-+ os << "missing value for option '" << option () << "'";
-+ }
-+
-+ const char* missing_value::
-+ what () const throw ()
-+ {
-+ return "missing option value";
-+ }
-+
-+ // invalid_value
-+ //
-+ invalid_value::
-+ ~invalid_value () throw ()
-+ {
-+ }
-+
-+ void invalid_value::
-+ print (std::ostream& os) const
-+ {
-+ os << "invalid value '" << value () << "' for option '"
-+ << option () << "'";
-+ }
-+
-+ const char* invalid_value::
-+ what () const throw ()
-+ {
-+ return "invalid option value";
-+ }
-+
-+ // eos_reached
-+ //
-+ void eos_reached::
-+ print (std::ostream& os) const
-+ {
-+ os << what ();
-+ }
-+
-+ const char* eos_reached::
-+ what () const throw ()
-+ {
-+ return "end of argument stream reached";
-+ }
-+
-+ // scanner
-+ //
-+ scanner::
-+ ~scanner ()
-+ {
-+ }
-+
-+ // argv_scanner
-+ //
-+ bool argv_scanner::
-+ more ()
-+ {
-+ return i_ < argc_;
-+ }
-+
-+ const char* argv_scanner::
-+ peek ()
-+ {
-+ if (i_ < argc_)
-+ return argv_[i_];
-+ else
-+ throw eos_reached ();
-+ }
-+
-+ const char* argv_scanner::
-+ next ()
-+ {
-+ if (i_ < argc_)
-+ {
-+ const char* r (argv_[i_]);
-+
-+ if (erase_)
-+ {
-+ for (int i (i_ + 1); i < argc_; ++i)
-+ argv_[i - 1] = argv_[i];
-+
-+ --argc_;
-+ argv_[argc_] = 0;
-+ }
-+ else
-+ ++i_;
-+
-+ return r;
-+ }
-+ else
-+ throw eos_reached ();
-+ }
-+
-+ void argv_scanner::
-+ skip ()
-+ {
-+ if (i_ < argc_)
-+ ++i_;
-+ else
-+ throw eos_reached ();
-+ }
-+
-+ template <typename X>
-+ struct parser
-+ {
-+ static void
-+ parse (X& x, scanner& s)
-+ {
-+ const char* o (s.next ());
-+
-+ if (s.more ())
-+ {
-+ const char* v (s.next ());
-+ std::istringstream is (v);
-+ if (!(is >> x && is.eof ()))
-+ throw invalid_value (o, v);
-+ }
-+ else
-+ throw missing_value (o);
-+ }
-+ };
-+
-+ template <>
-+ struct parser<bool>
-+ {
-+ static void
-+ parse (bool& x, scanner& s)
-+ {
-+ s.next ();
-+ x = true;
-+ }
-+ };
-+
-+ template <>
-+ struct parser<std::string>
-+ {
-+ static void
-+ parse (std::string& x, scanner& s)
-+ {
-+ const char* o (s.next ());
-+
-+ if (s.more ())
-+ x = s.next ();
-+ else
-+ throw missing_value (o);
-+ }
-+ };
-+
-+ template <typename X>
-+ struct parser<std::vector<X> >
-+ {
-+ static void
-+ parse (std::vector<X>& c, scanner& s)
-+ {
-+ X x;
-+ parser<X>::parse (x, s);
-+ c.push_back (x);
-+ }
-+ };
-+
-+ template <typename X>
-+ struct parser<std::set<X> >
-+ {
-+ static void
-+ parse (std::set<X>& c, scanner& s)
-+ {
-+ X x;
-+ parser<X>::parse (x, s);
-+ c.insert (x);
-+ }
-+ };
-+
-+ template <typename K, typename V>
-+ struct parser<std::map<K, V> >
-+ {
-+ static void
-+ parse (std::map<K, V>& m, scanner& s)
-+ {
-+ const char* o (s.next ());
-+
-+ if (s.more ())
-+ {
-+ std::string ov (s.next ());
-+ std::string::size_type p = ov.find ('=');
-+
-+ if (p == std::string::npos)
-+ {
-+ K k = K ();
-+
-+ if (!ov.empty ())
-+ {
-+ std::istringstream ks (ov);
-+
-+ if (!(ks >> k && ks.eof ()))
-+ throw invalid_value (o, ov);
-+ }
-+
-+ m[k] = V ();
-+ }
-+ else
-+ {
-+ K k = K ();
-+ V v = V ();
-+ std::string kstr (ov, 0, p);
-+ std::string vstr (ov, p + 1);
-+
-+ if (!kstr.empty ())
-+ {
-+ std::istringstream ks (kstr);
-+
-+ if (!(ks >> k && ks.eof ()))
-+ throw invalid_value (o, ov);
-+ }
-+
-+ if (!vstr.empty ())
-+ {
-+ std::istringstream vs (vstr);
-+
-+ if (!(vs >> v && vs.eof ()))
-+ throw invalid_value (o, ov);
-+ }
-+
-+ m[k] = v;
-+ }
-+ }
-+ else
-+ throw missing_value (o);
-+ }
-+ };
-+
-+ template <typename X, typename T, T X::*P>
-+ void
-+ thunk (X& x, scanner& s)
-+ {
-+ parser<T>::parse (x.*P, s);
-+ }
-+}
-+
-+#include <map>
-+#include <cstring>
-+
-+// options
-+//
-+
-+options::
-+options (int& argc,
-+ char** argv,
-+ bool erase,
-+ ::cli::unknown_mode opt,
-+ ::cli::unknown_mode arg)
-+: help_ (),
-+ version_ (),
-+ file_ (),
-+ directory_ ()
-+{
-+ ::cli::argv_scanner s (argc, argv, erase);
-+ _parse (s, opt, arg);
-+}
-+
-+options::
-+options (int start,
-+ int& argc,
-+ char** argv,
-+ bool erase,
-+ ::cli::unknown_mode opt,
-+ ::cli::unknown_mode arg)
-+: help_ (),
-+ version_ (),
-+ file_ (),
-+ directory_ ()
-+{
-+ ::cli::argv_scanner s (start, argc, argv, erase);
-+ _parse (s, opt, arg);
-+}
-+
-+options::
-+options (int& argc,
-+ char** argv,
-+ int& end,
-+ bool erase,
-+ ::cli::unknown_mode opt,
-+ ::cli::unknown_mode arg)
-+: help_ (),
-+ version_ (),
-+ file_ (),
-+ directory_ ()
-+{
-+ ::cli::argv_scanner s (argc, argv, erase);
-+ _parse (s, opt, arg);
-+ end = s.end ();
-+}
-+
-+options::
-+options (int start,
-+ int& argc,
-+ char** argv,
-+ int& end,
-+ bool erase,
-+ ::cli::unknown_mode opt,
-+ ::cli::unknown_mode arg)
-+: help_ (),
-+ version_ (),
-+ file_ (),
-+ directory_ ()
-+{
-+ ::cli::argv_scanner s (start, argc, argv, erase);
-+ _parse (s, opt, arg);
-+ end = s.end ();
-+}
-+
-+options::
-+options (::cli::scanner& s,
-+ ::cli::unknown_mode opt,
-+ ::cli::unknown_mode arg)
-+: help_ (),
-+ version_ (),
-+ file_ (),
-+ directory_ ()
-+{
-+ _parse (s, opt, arg);
-+}
-+
-+void options::
-+print_usage (::std::ostream& os)
-+{
-+ os << "--help|-h Print usage information and exit." << ::std::endl;
-+
-+ os << "--version|-v Print CamiTK version message and exit" << ::std::endl;
-+
-+ os << "--file|-f <file> input CamiTK CEPCoreSchema XML document describing the" << ::std::endl
-+ << " extension to generate (needed)." << ::std::endl;
-+
-+ os << "--directory|-d <path> CamiTK Extension Project output directory (needed)." << ::std::endl;
-+}
-+
-+typedef
-+std::map<std::string, void (*) (options&, ::cli::scanner&)>
-+_cli_options_map;
-+
-+static _cli_options_map _cli_options_map_;
-+
-+struct _cli_options_map_init
-+{
-+ _cli_options_map_init ()
-+ {
-+ _cli_options_map_["--help"] =
-+ &::cli::thunk< options, bool, &options::help_ >;
-+ _cli_options_map_["-h"] =
-+ &::cli::thunk< options, bool, &options::help_ >;
-+ _cli_options_map_["--version"] =
-+ &::cli::thunk< options, bool, &options::version_ >;
-+ _cli_options_map_["-v"] =
-+ &::cli::thunk< options, bool, &options::version_ >;
-+ _cli_options_map_["--file"] =
-+ &::cli::thunk< options, std::string, &options::file_ >;
-+ _cli_options_map_["-f"] =
-+ &::cli::thunk< options, std::string, &options::file_ >;
-+ _cli_options_map_["--directory"] =
-+ &::cli::thunk< options, std::string, &options::directory_ >;
-+ _cli_options_map_["-d"] =
-+ &::cli::thunk< options, std::string, &options::directory_ >;
-+ }
-+} _cli_options_map_init_;
-+
-+void options::
-+_parse (::cli::scanner& s,
-+ ::cli::unknown_mode opt_mode,
-+ ::cli::unknown_mode arg_mode)
-+{
-+ bool opt = true;
-+
-+ while (s.more ())
-+ {
-+ const char* o = s.peek ();
-+
-+ if (std::strcmp (o, "--") == 0)
-+ {
-+ s.skip ();
-+ opt = false;
-+ continue;
-+ }
-+
-+ _cli_options_map::const_iterator i (
-+ opt ? _cli_options_map_.find (o) : _cli_options_map_.end ());
-+
-+ if (i != _cli_options_map_.end ())
-+ {
-+ (*(i->second)) (*this, s);
-+ }
-+ else if (opt && std::strncmp (o, "-", 1) == 0 && o[1] != '\0')
-+ {
-+ switch (opt_mode)
-+ {
-+ case ::cli::unknown_mode::skip:
-+ {
-+ s.skip ();
-+ continue;
-+ }
-+ case ::cli::unknown_mode::stop:
-+ {
-+ break;
-+ }
-+ case ::cli::unknown_mode::fail:
-+ {
-+ throw ::cli::unknown_option (o);
-+ }
-+ }
-+
-+ break;
-+ }
-+ else
-+ {
-+ switch (arg_mode)
-+ {
-+ case ::cli::unknown_mode::skip:
-+ {
-+ s.skip ();
-+ continue;
-+ }
-+ case ::cli::unknown_mode::stop:
-+ {
-+ break;
-+ }
-+ case ::cli::unknown_mode::fail:
-+ {
-+ throw ::cli::unknown_argument (o);
-+ }
-+ }
-+
-+ break;
-+ }
-+ }
-+}
-+
-Index: camitk/sdk/applications/cepgenerator/main.cpp
-===================================================================
---- camitk/sdk/applications/cepgenerator/main.cpp (revision 1367)
-+++ camitk/sdk/applications/cepgenerator/main.cpp (revision 1369)
-@@ -24,28 +24,35 @@
- ****************************************************************************/
- #include "CepGenerator.h"
-
-+// CamiTK stuff
-+#include <Core.h>
-+
- // includes from std
- #include <iostream>
-
--static const char* DESCRIPTION="cepgenerator aims at creating CamiTK Extension Project files skeleton from\
-- a description given in a XML file.\
-- Parameters:\n \
-- --help | -h display this message. \n \
-- --file | -f <file> is the XML description filename.\n \
-- --directory | -d <path> is the path to the directory where the CEP skeleton files will be stored.\n \
--";
-+// CLI stuff
-+#include "CommandLineOptions.hxx"
-
-+// description of the application. Please update the manpage-prologue.1.in also if you modify this string.
-+const char* description="Please visit http://camitk.imag.fr for more information.\n"
-+ "(c) UJF-Grenoble 1, CNRS, TIMC-IMAG UMR 5525\n\n"
-+ "camitk-cepgenerator aims at creating CamiTK Extension Project skeleton from\n"
-+ "a description given in a XML file (valid CamiTK cepcoreschema language).";
-
--static void usage() {
-- std::cout << "cepgenerator" << std::endl;
-+// usage for this application
-+void usage(char *appName) {
-+ std::cerr << appName << std::endl;
-+ std::cerr << std::endl;
-+ std::cerr << "Usage: " << appName << " [options]" << std::endl;
-+ std::cerr << "Built using " << camitk::Core::version << std::endl;
-+ std::cerr << std::endl;
-+ std::cout << description << std::endl;
- std::cout << std::endl;
-- std::cout << DESCRIPTION << std::endl;
-- std::cout << std::endl;
-- std::cout << "Usage: " << "cepgenerator " << "-f <file> -d <path>" << std::endl;
-- std::cout << std::endl;
--
-+ std::cerr << "Options:" << endl;
-+ options::print_usage(cerr);
- }
-
-+
- /**
- * @ingroup group_sdk_application_cepgenerator
- *
-@@ -54,63 +61,58 @@
- *
- */
- int main(int argc, char * argv[]) {
--
--
- try {
-- bool helpTest = false;
-- bool inputTest = false;
-- bool outputTest = false;
-+ int end; // End of options.
-+ options o(argc, argv, end);
-
-- QString filename;
-- QString dirname;
--
-- for (int i = 1; i < argc-1; i++)
-- {
-- if ((strcmp(argv[i], "-h") ==0) || (strcmp(argv[i], "--help") == 0)) {
-- helpTest = true;
-+ // if specific help or no options provided
-+ if (o.help()) {
-+ usage(argv[0]);
-+ return EXIT_SUCCESS;
-+ }
-+ else {
-+ // print the CamiTK version
-+ if (o.version()) {
-+ std::cout << argv[0] << " build using " << camitk::Core::version << std::endl;
-+ return EXIT_SUCCESS;
- }
-- if ((strcmp( argv[i],"-f" ) == 0) || (strcmp(argv[i], "--file") == 0)) {
-- filename = QString(argv[i+1]);
-- inputTest = true;
-+ else {
-+ // file and directory are mandatory options!
-+ if (o.file().empty()) {
-+ std::cout << "Argument error: Please provide an input XML file" << std::endl << std::endl;
-+ usage(argv[0]);
-+ return EXIT_FAILURE;
-+ }
-+ else if (o.directory().empty()) {
-+ std::cout << "Argument error: Please provide an output directory" << std::endl << std::endl;
-+ usage(argv[0]);
-+ return EXIT_FAILURE;
-+ }
-+ else {
-+ // now we can work!
-+ // for the translation from argument to QString, see http://qt-project.org/doc/qt-4.8/qcoreapplication.html#accessing-command-line-arguments
-+ CepGenerator::generateCEP(QString::fromLocal8Bit(o.file().c_str()), QString::fromLocal8Bit(o.directory().c_str()));
-+ }
- }
-- if ((strcmp( argv[i],"-d" ) == 0) || (strcmp(argv[i], "--directory") == 0)) {
-- dirname = QString(argv[i+1]);
-- outputTest = true;
-- }
- }
-- // also test -h or --help option even if it is the last argument
-- if ((strcmp(argv[argc-1], "-h") ==0) || (strcmp(argv[argc-1], "--help") == 0)) {
-- helpTest = true;
-- }
--
-- if (helpTest) {
-- usage();
-- return 0;
-- }
-- else if ((inputTest) && (outputTest)) {
-- CepGenerator::generateCEP(filename, dirname);
-- }
-- else if (! inputTest) {
-- std::cout << "Please provide an input XML file (-f <file>)" << std::endl;
-- usage();
-- return 0;
-- }
-- else { // ! outputTest
-- std::cout << "Please provide an input XML file (-f <file>)" << std::endl;
-- usage();
-- return 0;
-- }
--
- }
-+ catch (const cli::exception& e) {
-+ cerr << e << endl;
-+ usage(argv[0]);
-+ return EXIT_FAILURE;
-+ }
-+ catch (camitk::AbortException& e) {
-+ std::cout << argv[0] << " aborted..." << std::endl << "camitk AbortException:" << std::endl << e.what() << std::endl;
-+ return EXIT_FAILURE;
-+ }
- catch (std::exception& e) {
- std::cout << argv[0] << " aborted..." << std::endl << "std AbortException:" << std::endl << e.what() << std::endl;
-- return 1;
-+ return EXIT_FAILURE;
- }
- catch (...) {
- std::cout << argv[0] << " aborted..." << std::endl << "Unknown Exception" << std::endl;
-- return 1;
-+ return EXIT_FAILURE;
- }
-
-- return 0;
- }
-
-Index: camitk/sdk/applications/cepgenerator/CommandLineOptions.cli
-===================================================================
---- camitk/sdk/applications/cepgenerator/CommandLineOptions.cli (revision 0)
-+++ camitk/sdk/applications/cepgenerator/CommandLineOptions.cli (revision 1369)
-@@ -0,0 +1,25 @@
-+// Code Synthesis CLI configuration
-+// see http://codesynthesis.com/projects/cli
-+//
-+// cli must be run everytime this file is modified:
-+// clicxx CommandLineOptions.cli
-+//
-+// to update the manpage:
-+// clicxx --stdout --man-prologue manpage-prologue.1.in --man-epilogue manpage-epilogue.1.in --generate-man CommandLineOptions.cli > camitk-cepgenerator.1.in
-+
-+include <string>;
-+
-+class options {
-+ bool --help | -h {"Print usage information and exit."};
-+ bool --version | -v {"Print CamiTK version message and exit"};
-+ std::string --file | -f {"<file>",
-+ "input CamiTK CEPCoreSchema XML document describing the extension to generate (needed).
-+
-+ This should be a valid CEPCoreSchema XML document.
-+ The input XML <file> is \b{mandatory}."};
-+ std::string --directory | -d {"<path>",
-+ "CamiTK Extension Project output directory (needed).
-+
-+ This is the path to the directory where the CEP skeleton files will be generated.
-+ The output <path> is \b{mandatory}."};
-+};
-Index: camitk/sdk/applications/cepgenerator/CommandLineOptions.hxx
-===================================================================
---- camitk/sdk/applications/cepgenerator/CommandLineOptions.hxx (revision 0)
-+++ camitk/sdk/applications/cepgenerator/CommandLineOptions.hxx (revision 1369)
-@@ -0,0 +1,268 @@
-+// This code was generated by CLI, a command line interface
-+// compiler for C++.
-+//
-+
-+#ifndef COMMAND_LINE_OPTIONS_HXX
-+#define COMMAND_LINE_OPTIONS_HXX
-+
-+#include <iosfwd>
-+#include <string>
-+#include <exception>
-+
-+namespace cli
-+{
-+ class unknown_mode
-+ {
-+ public:
-+ enum value
-+ {
-+ skip,
-+ stop,
-+ fail
-+ };
-+
-+ unknown_mode (value v);
-+
-+ operator value () const
-+ {
-+ return v_;
-+ }
-+
-+ private:
-+ value v_;
-+ };
-+
-+ // Exceptions.
-+ //
-+
-+ class exception: public std::exception
-+ {
-+ public:
-+ virtual void
-+ print (std::ostream&) const = 0;
-+ };
-+
-+ std::ostream&
-+ operator<< (std::ostream&, const exception&);
-+
-+ class unknown_option: public exception
-+ {
-+ public:
-+ virtual
-+ ~unknown_option () throw ();
-+
-+ unknown_option (const std::string& option);
-+
-+ const std::string&
-+ option () const;
-+
-+ virtual void
-+ print (std::ostream&) const;
-+
-+ virtual const char*
-+ what () const throw ();
-+
-+ private:
-+ std::string option_;
-+ };
-+
-+ class unknown_argument: public exception
-+ {
-+ public:
-+ virtual
-+ ~unknown_argument () throw ();
-+
-+ unknown_argument (const std::string& argument);
-+
-+ const std::string&
-+ argument () const;
-+
-+ virtual void
-+ print (std::ostream&) const;
-+
-+ virtual const char*
-+ what () const throw ();
-+
-+ private:
-+ std::string argument_;
-+ };
-+
-+ class missing_value: public exception
-+ {
-+ public:
-+ virtual
-+ ~missing_value () throw ();
-+
-+ missing_value (const std::string& option);
-+
-+ const std::string&
-+ option () const;
-+
-+ virtual void
-+ print (std::ostream&) const;
-+
-+ virtual const char*
-+ what () const throw ();
-+
-+ private:
-+ std::string option_;
-+ };
-+
-+ class invalid_value: public exception
-+ {
-+ public:
-+ virtual
-+ ~invalid_value () throw ();
-+
-+ invalid_value (const std::string& option,
-+ const std::string& value);
-+
-+ const std::string&
-+ option () const;
-+
-+ const std::string&
-+ value () const;
-+
-+ virtual void
-+ print (std::ostream&) const;
-+
-+ virtual const char*
-+ what () const throw ();
-+
-+ private:
-+ std::string option_;
-+ std::string value_;
-+ };
-+
-+ class eos_reached: public exception
-+ {
-+ public:
-+ virtual void
-+ print (std::ostream&) const;
-+
-+ virtual const char*
-+ what () const throw ();
-+ };
-+
-+ class scanner
-+ {
-+ public:
-+ virtual
-+ ~scanner ();
-+
-+ virtual bool
-+ more () = 0;
-+
-+ virtual const char*
-+ peek () = 0;
-+
-+ virtual const char*
-+ next () = 0;
-+
-+ virtual void
-+ skip () = 0;
-+ };
-+
-+ class argv_scanner: public scanner
-+ {
-+ public:
-+ argv_scanner (int& argc, char** argv, bool erase = false);
-+ argv_scanner (int start, int& argc, char** argv, bool erase = false);
-+
-+ int
-+ end () const;
-+
-+ virtual bool
-+ more ();
-+
-+ virtual const char*
-+ peek ();
-+
-+ virtual const char*
-+ next ();
-+
-+ virtual void
-+ skip ();
-+
-+ private:
-+ int i_;
-+ int& argc_;
-+ char** argv_;
-+ bool erase_;
-+ };
-+}
-+
-+#include <string>
-+
-+class options
-+{
-+ public:
-+
-+ options (int& argc,
-+ char** argv,
-+ bool erase = false,
-+ ::cli::unknown_mode option = ::cli::unknown_mode::fail,
-+ ::cli::unknown_mode argument = ::cli::unknown_mode::stop);
-+
-+ options (int start,
-+ int& argc,
-+ char** argv,
-+ bool erase = false,
-+ ::cli::unknown_mode option = ::cli::unknown_mode::fail,
-+ ::cli::unknown_mode argument = ::cli::unknown_mode::stop);
-+
-+ options (int& argc,
-+ char** argv,
-+ int& end,
-+ bool erase = false,
-+ ::cli::unknown_mode option = ::cli::unknown_mode::fail,
-+ ::cli::unknown_mode argument = ::cli::unknown_mode::stop);
-+
-+ options (int start,
-+ int& argc,
-+ char** argv,
-+ int& end,
-+ bool erase = false,
-+ ::cli::unknown_mode option = ::cli::unknown_mode::fail,
-+ ::cli::unknown_mode argument = ::cli::unknown_mode::stop);
-+
-+ options (::cli::scanner&,
-+ ::cli::unknown_mode option = ::cli::unknown_mode::fail,
-+ ::cli::unknown_mode argument = ::cli::unknown_mode::stop);
-+
-+ // Option accessors.
-+ //
-+
-+ const bool&
-+ help () const;
-+
-+ const bool&
-+ version () const;
-+
-+ const std::string&
-+ file () const;
-+
-+ const std::string&
-+ directory () const;
-+
-+ // Print usage information.
-+ //
-+ static void
-+ print_usage (::std::ostream&);
-+
-+ private:
-+ void
-+ _parse (::cli::scanner&,
-+ ::cli::unknown_mode option,
-+ ::cli::unknown_mode argument);
-+
-+ public:
-+ bool help_;
-+ bool version_;
-+ std::string file_;
-+ std::string directory_;
-+};
-+
-+#include "CommandLineOptions.ixx"
-+
-+#endif // COMMAND_LINE_OPTIONS_HXX
-Index: camitk/sdk/applications/cepgenerator/CommandLineOptions.ixx
-===================================================================
---- camitk/sdk/applications/cepgenerator/CommandLineOptions.ixx (revision 0)
-+++ camitk/sdk/applications/cepgenerator/CommandLineOptions.ixx (revision 1369)
-@@ -0,0 +1,134 @@
-+// This code was generated by CLI, a command line interface
-+// compiler for C++.
-+//
-+
-+namespace cli
-+{
-+ // unknown_mode
-+ //
-+ inline unknown_mode::
-+ unknown_mode (value v)
-+ : v_ (v)
-+ {
-+ }
-+
-+ // exception
-+ //
-+ inline std::ostream&
-+ operator<< (std::ostream& os, const exception& e)
-+ {
-+ e.print (os);
-+ return os;
-+ }
-+
-+ // unknown_option
-+ //
-+ inline unknown_option::
-+ unknown_option (const std::string& option)
-+ : option_ (option)
-+ {
-+ }
-+
-+ inline const std::string& unknown_option::
-+ option () const
-+ {
-+ return option_;
-+ }
-+
-+ // unknown_argument
-+ //
-+ inline unknown_argument::
-+ unknown_argument (const std::string& argument)
-+ : argument_ (argument)
-+ {
-+ }
-+
-+ inline const std::string& unknown_argument::
-+ argument () const
-+ {
-+ return argument_;
-+ }
-+
-+ // missing_value
-+ //
-+ inline missing_value::
-+ missing_value (const std::string& option)
-+ : option_ (option)
-+ {
-+ }
-+
-+ inline const std::string& missing_value::
-+ option () const
-+ {
-+ return option_;
-+ }
-+
-+ // invalid_value
-+ //
-+ inline invalid_value::
-+ invalid_value (const std::string& option,
-+ const std::string& value)
-+ : option_ (option), value_ (value)
-+ {
-+ }
-+
-+ inline const std::string& invalid_value::
-+ option () const
-+ {
-+ return option_;
-+ }
-+
-+ inline const std::string& invalid_value::
-+ value () const
-+ {
-+ return value_;
-+ }
-+
-+ // argv_scanner
-+ //
-+ inline argv_scanner::
-+ argv_scanner (int& argc, char** argv, bool erase)
-+ : i_ (1), argc_ (argc), argv_ (argv), erase_ (erase)
-+ {
-+ }
-+
-+ inline argv_scanner::
-+ argv_scanner (int start, int& argc, char** argv, bool erase)
-+ : i_ (start), argc_ (argc), argv_ (argv), erase_ (erase)
-+ {
-+ }
-+
-+ inline int argv_scanner::
-+ end () const
-+ {
-+ return i_;
-+ }
-+}
-+
-+// options
-+//
-+
-+inline const bool& options::
-+help () const
-+{
-+ return this->help_;
-+}
-+
-+inline const bool& options::
-+version () const
-+{
-+ return this->version_;
-+}
-+
-+inline const std::string& options::
-+file () const
-+{
-+ return this->file_;
-+}
-+
-+inline const std::string& options::
-+directory () const
-+{
-+ return this->directory_;
-+}
-+
Index: camitk/sdk/applications/cepgenerator/resources/manpage-epilogue.1.in
===================================================================
--- camitk/sdk/applications/cepgenerator/resources/manpage-epilogue.1.in (revision 0)
@@ -6435,11 +4343,11 @@
+camitk\- at APPLICATION_NAME@ is a developer tool for CamiTK, the Computer Assisted
+Medical Intervention Tool Kit.
+.PP
-+camitk-cepgenerator aims at creating CamiTK Extension Project (CEP) skeleton
++camitk-cepgenerator aims at creating CamiTK Extension Project (CEP) skeleton
+from a description given in a XML file (valid CamiTK cepcoreschema language)
+.PP
+Using this command line only you can generate a CEP directory tree and
-+the component and action extension C++ code corresponding to the
++the component and action extension C++ code corresponding to the
+content of the given XML file.
+.PP
+To successfully run camitk\- at APPLICATION_NAME@ you need to provide two
@@ -6480,23 +4388,3 @@
+The full documentation and tutorials for
+.B CamiTK
+are available at <\fBhttp://camitk.imag.fr\fR>
-Index: camitk/sdk/applications/cepgenerator/CMakeLists.txt
-===================================================================
---- camitk/sdk/applications/cepgenerator/CMakeLists.txt (revision 1367)
-+++ camitk/sdk/applications/cepgenerator/CMakeLists.txt (revision 1369)
-@@ -1,8 +1,9 @@
--camitk_application( DEFAULT
-- NEEDS_XSD
-- NEEDS_XERCESC
-- NEEDS_CEP_LIBRARIES cepgenerator cepcoreschema
-- CEP_NAME OZ
-- DESCRIPTION "Create CEP and file skeletons from XML files (without GUI)"
-+camitk_application(DEFAULT
-+ NEEDS_XSD
-+ NEEDS_XERCESC
-+ NEEDS_CEP_LIBRARIES cepgenerator cepcoreschema
-+ CEP_NAME SDK
-+ ADDITIONAL_SOURCES CommandLineOptions.cxx CommandLineOptions.hxx CommandLineOptions.ixx
-+ DESCRIPTION "Create CEP and file skeletons from XML files (no GUI)"
- )
-
Modified: trunk/packages/camitk/trunk/debian/patches/config-console-redirection.diff
===================================================================
--- trunk/packages/camitk/trunk/debian/patches/config-console-redirection.diff 2014-04-24 14:51:06 UTC (rev 16774)
+++ trunk/packages/camitk/trunk/debian/patches/config-console-redirection.diff 2014-04-24 16:28:58 UTC (rev 16775)
@@ -1,3 +1,6 @@
+Description: cep generator needs a manpage
+Author: Emmanuel Promayon <Emmanuel.Promayon at imag.fr>
+Last-Update: 2014-04-23
Index: camitk/sdk/applications/config/main.cpp
===================================================================
--- camitk/sdk/applications/config/main.cpp (revision 1365)
Modified: trunk/packages/camitk/trunk/debian/rules
===================================================================
--- trunk/packages/camitk/trunk/debian/rules 2014-04-24 14:51:06 UTC (rev 16774)
+++ trunk/packages/camitk/trunk/debian/rules 2014-04-24 16:28:58 UTC (rev 16775)
@@ -55,7 +55,10 @@
-DCOMPONENT_DICOMIMAGE=TRUE
%:
+ # For debian buildd, do not authorize parallel build (too much RAM needed for Imaging CEP)
dh $@ --builddirectory=camitk-build
+ # For local personal build, parallel is ok as there is enough RAM for heavy-templated Imaging CEP
+ #dh $@ --parallel --builddirectory=camitk-build
override_dh_auto_configure:
dh_auto_configure -- $(CMAKE_EXTRA_FLAGS)
@@ -77,8 +80,8 @@
# Note: all tests require an X server, xvfb-run is needed to have a virtual one
# Component extension tests
ldd -r camitk-build/bin/camitk-testcomponents || echo "ok"
- # Another way: xvfb-run --auto-servernum $(MAKE) -C camitk-build ARGS="-V -I 1,1,,1,6,16" test
- (cd camitk-build && xvfb-run --auto-servernum ctest -V -I 1,1,,1,6,16 --timeout 300)
+ # Another way: xvfb-run --auto-servernum $(MAKE) -C camitk-build ARGS="-V -I 1,1,,1,...etc..." test
+ (cd camitk-build && xvfb-run --auto-servernum ctest -V -I 1,1,,1,6,9,15 --timeout 300)
# Action extensions tests (100% coverage here)
(cd camitk-build && xvfb-run --auto-servernum ctest -V -I 20,20,,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35 --timeout 300)
# Standalone lib test (0% coverage)
Modified: trunk/packages/camitk/trunk/debian/tests/config
===================================================================
--- trunk/packages/camitk/trunk/debian/tests/config 2014-04-24 14:51:06 UTC (rev 16774)
+++ trunk/packages/camitk/trunk/debian/tests/config 2014-04-24 16:28:58 UTC (rev 16775)
@@ -19,10 +19,11 @@
# depending on the CamiTK version, the output is different
expectedConfigOutput () {
- if [ "$1" = "3.3.0" ]; then
+
+ if [ "$1" = "3.3.1" ]; then
cat <<EOF > $EXPECTED_CONFIG_OUTPUT
-CamiTK 3.3.0
-- CamiTK version......................... CamiTK 3.3.0
+CamiTK 3.3.1
+- CamiTK version......................... CamiTK 3.3.1
- CamiTK Short Version................... camitk-3.3
- CamiTK SO NAME......................... 3
- CamiTK Global Installation Directory... /usr
More information about the debian-med-commit
mailing list