74 Commits

Author SHA1 Message Date
mes5k
10f0b3c1e8 removed value required 2005-01-24 03:14:47 +00:00
mes5k
46328568c4 now optionally required 2005-01-24 01:54:06 +00:00
mes5k
4921db78a1 MultiSwitchArg 2005-01-24 00:27:29 +00:00
mes5k
2f941785c3 added a bool to the constructor that allows automatic -h and -v to be turned off 2005-01-24 00:26:41 +00:00
mes5k
0d11e3f288 fixed typo 2005-01-23 22:33:33 +00:00
mes5k
266a86b84d Fixed minor bug involving combined switch error messages: now they're consistent. 2005-01-23 22:29:10 +00:00
mes5k
69e038b365 initial checkin 2005-01-23 22:28:14 +00:00
mes5k
af8b7b6877 added alreadySet 2005-01-23 04:41:47 +00:00
mes5k
ee4e8d9783 fixed xor bug 2005-01-21 04:03:20 +00:00
macbishop
505936eb05 Removed check on description in Arg::operator== since multiple args should be able to have the same description. 2005-01-17 20:48:52 +00:00
mes5k
f08a70dbd7 fixed exceptions and typeDesc for constraints 2005-01-07 04:00:48 +00:00
mes5k
eaf90478ac added constraints 2005-01-07 03:06:37 +00:00
mes5k
2217fc885f initial checkin 2005-01-07 03:05:50 +00:00
mes5k
7aedc28856 comment change 2005-01-07 03:05:24 +00:00
mes5k
efdd70ec6f added Constraint includes 2005-01-07 03:01:34 +00:00
mes5k
6471476a4d Changed allowedList to Constraint 2005-01-07 02:55:52 +00:00
mes5k
aa7d526623 fixed output bug 2005-01-05 18:22:15 +00:00
mes5k
3c4771b03c fixed output memory leak 2005-01-04 20:21:20 +00:00
mes5k
8497556541 hacky fix to long prog name bug 2004-12-09 05:10:10 +00:00
mes5k
c35e842ddc fixed a bug involving blank _flags and - as an UnlabeledValueArg 2004-12-08 02:16:54 +00:00
mes5k
dda57405ab removed ostream include 2004-12-03 19:39:04 +00:00
mes5k
e02172004f cleaned up iterator names 2004-12-01 03:11:25 +00:00
mes5k
d584e762ce removed ostream 2004-12-01 03:10:40 +00:00
mes5k
a42880b72d removed two stage lookup ifdefs 2004-11-25 03:57:34 +00:00
mes5k
3bbbfa92b9 adding docbook stuff 2004-11-06 05:05:03 +00:00
mes5k
6f2d4828a8 changed output around 2004-11-05 05:07:12 +00:00
mes5k
c0aa4a9042 subsumed by StdOutput 2004-11-05 05:06:43 +00:00
mes5k
cb1517921f yet another fix for HAVE_SSTREAM stuff 2004-10-30 22:26:58 +00:00
mes5k
1375557476 fixed config.h problems 2004-10-28 16:41:10 +00:00
mes5k
b1cb010ec6 catch by ref 2004-10-22 01:02:32 +00:00
mes5k
a7e9dcdc20 changed enum names because of alpha conflicts 2004-10-21 16:02:48 +00:00
mes5k
cf64287c40 cleaned up some includes and added ifdefs for sstream 2004-10-21 03:04:13 +00:00
mes5k
db4d37cd7c added failure to the interface 2004-10-14 19:03:32 +00:00
mes5k
e827de8d60 doh. now what() is proper 2004-10-14 18:07:45 +00:00
mes5k
885da739a6 made destructor virtual 2004-10-14 17:44:17 +00:00
mes5k
fdd28e3711 moved all output handling into separate methods 2004-10-14 17:20:12 +00:00
mes5k
706f0b28b7 made processArg pure virtual 2004-10-14 17:19:27 +00:00
mes5k
cd1bf5af14 fixed documentation omission 2004-10-14 17:19:01 +00:00
mes5k
2a98aad894 added type description 2004-10-01 17:54:00 +00:00
mes5k
babf6baac6 added new Exception classes 2004-09-27 21:30:57 +00:00
mes5k
66b04fdd11 minor tweaks 2004-09-27 19:53:33 +00:00
mes5k
ad7f3fdab3 minor formatting 2004-09-26 23:54:16 +00:00
macbishop
35aa53232d Moving the implementation of tclap to the header files presented me with two
major problems. 1) There where static functions and variables that could cause
link errors if tclap where used in different files (e.g. file1.cc and file2.cc
included tclap then compiling both files would give hard symbols for some
variables which would produce multiple definition when linking) 2) The
dependencies of tclap was a bit strange (CmdLine depends on Args and Args
depends on CmdLine for instance)

The first problem I solved by removing all static variables putting them in
static member functions (which are weak-symbols). So for instance every where
there previously was something like x = _delimiter there now is x = delimiter()
or in case of write acces delimiterRef() = x instead of _delimiter = x (I had
to append the Ref because there where already functions with the same name as
the variables). To solve the problem with static functions I simply inlined
them. This causes the compiler to produce a weak symbol or inline if
appropriate. We can put the functions inside the class declaration later to
make the code look better. This worked fine in all but two cases. In the
ValueArg and MultiArg classes I had to do a "hack" to work around the
specialization template for extractValue<std::string>. The code for this is
very simple but it might look strange an stupid at first but it is only to
resolve the specialisation to a weak symbol. What I did was I put the
implementations of extractValue in a helper class and I could then create a
specialized class instead of function and everything worked out. I think now in
retrospect there might be better solutions to this but I'll think a bit more on
it (maybe some type of inlining on the specialized version would suffice but
I'm not sure).

To handle the dependencies I had to do some rewriting. The first step was to
introduce a new class CmdLineInterface that is a purely abstract base of
CmdLine that specifies the functions needed by Arg and friends. Thus Arg
classes now takes an CmdLineInterface object as input instead (however only
CmdLine can ever be instantiated of-course). With this extra class cleaning up
the dependencies was quite simple, I've attached a dependency graph to the mail
(depgraph.png). I also cleaned up the #includes so now only what actually needs
inclusion is included. A nice side effect of this is that the impl. of CmdLine
is now put back into CmdLine.h (where I guess you wanted it) which (recursivly)
includes everything else needed.

Just to make things clear for myself regarding the class dependencies I made a
class TCLAP::Exception that inherits from std::exception and is a base of
ArgException (Exception does nothing currently). If we don't want the Exception
class it can be removed, however I think it could be a nice logic to have a
base Exception class that every exception inherits from, but we can discuss
that when we decide how to handle exceptions.
2004-09-26 18:27:47 +00:00
mes5k
289b1a1396 added some comments 2004-09-21 00:09:50 +00:00
macbishop
4362a50705 Recommit because something is strange. The changes are that memory allocated in _construct is deallocated when the CmdLine obj is destroyed 2004-09-20 17:05:15 +00:00
mes5k
6cd0c3db78 changed ifndef labels 2004-09-18 16:54:21 +00:00
macbishop
4ae30a9aa5 Had to make ~Arg() public because it won't be possible to delete Arg*s if it is not, and we want that (I think). 2004-09-18 14:53:47 +00:00
mes5k
67c8ff84e1 cleaned up a bunch of things 2004-09-16 03:54:08 +00:00
mes5k
389a4f87b1 got CmdLine arg working 2004-09-12 02:32:37 +00:00
macbishop
35a072e0b6 Support for automatic addition to a CmdLine parser 2004-09-09 19:55:33 +00:00