166 Commits

Author SHA1 Message Date
Daniel Aarno
10103edd7c Merge branch '1.2' 2019-11-24 22:20:20 +00:00
Stefan Büttner
df5303b06c Initialize ValueConstraint from const reference.
This allows the following in post the c++11 world:
```
    tclap::ValueConstraint<std::string> constraints({"foo", "bar"});
```
instead of
```
    std::vector<std::string> constraint_choices({"foo", "bar"});
    tclap::ValueConstraint<std::string> constraints(constraint_choices);
```
2019-09-11 11:05:12 +02:00
Daniel Aarno
0a475929b8 Update copyright notices. 2019-05-06 19:44:57 +01:00
Daniel Aarno
c51fb519d6 Merge branch '1.2' 2018-08-02 12:12:56 -07:00
Daniel Aarno
81e4e8bba5 Add emacs mode-lines to all header files 2018-03-19 10:13:46 +00:00
Daniel Aarno
1e1cc4fb9a Merge branch '1.2' 2018-01-15 22:44:59 +00:00
Daniel Aarno
9a310a7c39 Check that all .h files in include/tclap are in Makefile.am
check_dead_headers.py can be called as a pre-commit hook.
2018-01-15 22:44:38 +00:00
Daniel Aarno
420fe8e13d Merge branch '1.2' 2018-01-02 16:24:10 +01:00
Daniel Aarno
de93e6b2ca Remove some unused code related to sstream fixes. 2018-01-02 16:21:29 +01:00
Daniel Aarno
642e48a667 Merge branch '1.2'
# Conflicts:
#	include/tclap/ZshCompletionOutput.h
#	tests/Makefile.am
#	tests/runtests.sh
#	tests/test79.sh
2017-12-26 21:28:10 +01:00
Daniel Aarno
6c2ef7d6ef Fix sstream/strstream (and config.h) compiler issues.
Code would not compile with HAVE_STRSTREAM defined.

Code would not compile without HAVE_CONFIG_H defined (unless
-DHAVE_STRSTREAM or -DHAVE_SSTREAM was specified).

Code would not compile with HAVE_CONFIG_H defined if config.h did not
also define HAVE_SSTREAM.

This patch moves annoying logic for sstream/strstream logic to it's
own file and fixes the above mentioned issues.

https://sourceforge.net/p/tclap/bugs/23/
2017-12-26 15:28:52 +01:00
Daniel Aarno
68fb0f35a2 Quick fix for ZshCompletionOutput test
The test was failing because elipsis changed from "..." to
"... ". This is a quick and dirty fix and should be cleaned up.

Also updated copyright notice

# Conflicts:
#	tests/test85.out
#	tests/test85.sh
2017-12-26 14:03:13 +01:00
Daniel Aarno
5879dff268 Fixed more typos 2017-12-26 14:00:18 +01:00
Daniel Aarno
4c04f3e965 Fixed typo 2017-12-26 14:00:13 +01:00
Daniel Aarno
221a79bf17 Fix } outside of include guards
You get an extra brace if ArgTraits.h ends up included more than once

https://sourceforge.net/p/tclap/patches/13/
2017-12-26 13:56:34 +01:00
Daniel Aarno
ad5345dfb7 Initialize theDelimiter (supress warning), found by test23. 2017-12-26 13:55:34 +01:00
Mike Smoot
0980af54f2 added patch to fix brief output with TCLAP_NAMESTRING defined 2017-12-26 13:54:15 +01:00
Daniel Aarno
5489dc9597 Formatting change: Don't print space after elipsis in usage 2017-12-26 08:01:03 +01:00
Daniel Aarno
d2e5525760 Fix sstream/strstream (and config.h) compiler issues.
Code would not compile with HAVE_STRSTREAM defined.

Code would not compile without HAVE_CONFIG_H defined (unless
-DHAVE_STRSTREAM or -DHAVE_SSTREAM was specified).

Code would not compile with HAVE_CONFIG_H defined if config.h did not
also define HAVE_SSTREAM.

This patch moves annoying logic for sstream/strstream logic to it's
own file and fixes the above mentioned issues.

https://sourceforge.net/p/tclap/bugs/23/
2017-12-23 16:55:56 +01:00
Daniel Aarno
3d02fed104 Fixed more typos 2017-09-02 17:37:56 +01:00
Daniel Aarno
3ccab57178 Fixed typo 2017-09-02 17:16:53 +01:00
Daniel Aarno
7ab738957c Quick fix for ZshCompletionOutput test
The test was failing because elipsis changed from "..." to
"... ". This is a quick and dirty fix and should be cleaned up.

Also updated copyright notice
2017-08-30 14:26:02 +01:00
Daniel Aarno
1a40e8f5a8 Add const to iterators and xorAdd
No need to modify the passed vector, it should be a const reference.

https://sourceforge.net/p/tclap/patches/14/
2017-08-24 21:50:17 +01:00
Daniel Aarno
0333b277a5 Fix } outside of include guards
You get an extra brace if ArgTraits.h ends up included more than once

https://sourceforge.net/p/tclap/patches/13/
2017-08-24 21:44:33 +01:00
Daniel Aarno
4970b7e793 Check for NULL constraint and raise exception if found.
User is not allowed to provide a NULL constraint to the various ARG
constructors. This patch makes sure the Constraint is not NULL before
dereferencing and raises a logic_error if it is NULL.

Also included the two new tests test88 and test89 in runtests script.
2015-05-11 22:47:42 +02:00
Daniel Aarno
e006d96c53 Mark getValue functions as const.
The various getValue functions should not modify the underlying class,
so they have been turned into const. The only exception is ValueArg
where a non-const version is kept for backward compatibility (it
should be removed if we allow an API break). The other instances are
safe since the return value is not changed and the new function
signature is less restrictive.
2015-05-11 22:19:34 +02:00
Daniel Aarno
b3f85f4965 Cleanup: Unify indentation and line length across files.
Consistenly use 4 space indent (no tabs) and < 80 char lines. The
files were very inconsistent and hard to edit.
2015-05-11 22:08:25 +02:00
Daniel Aarno
b162f59fcb Feature Request #8 Implicit Conversion Operators for SwitchArg and ValueArg. 2015-05-11 21:41:56 +02:00
Daniel Aarno
bd0440fdbd Merge branch 'traits'
Make all types have ValueLike traits by default.

This allows new types to be added without any fuzz (no need to specify
the traits) if it has operator>>. It also removes the need to manually
specify the ArgTrait for all built in types (such as long, bool, char,
float etc).

ArgTraits now works in the following way:

1) If there exists a specialization of ArgTraits for type X, use it.

2) If no specialization exists but X has the typename
X::ValueCategory, use the specialization for X::ValueCategory.

3) If neither (1) nor (2) defines the trait, use the default which is
ValueLike.

Conflicts:
	examples/Makefile.am
	examples/test24.cpp
	tests/Makefile.am
	tests/runtests.sh
	tests/test83.out
	tests/test83.sh
2013-10-26 13:56:31 +02:00
Daniel Aarno
6e236d28db Initialize theDelimiter (supress warning), found by test23. 2013-10-26 13:38:56 +02:00
Daniel Aarno
b96e42cf76 Make "visit" method pure virtual (needs to be implemented by subclass
to make sense).
2013-10-26 12:56:27 +02:00
Daniel Aarno
5d4ffbf2db Make all types have ValueLike traits by default.
This allows new types to be added without any fuzz (no need to specify
the traits) if it has operator>>. It also removes the need to manually
specify the ArgTrait for all built in types (such as long, bool, char,
float etc).

ArgTraits now works in the following way:

1) If there exists a specialization of ArgTraits for type X, use it.

2) If no specialization exists but X has the typename
X::ValueCategory, use the specialization for X::ValueCategory.

3) If neither (1) nor (2) defines the trait, use the default which is
ValueLike.
2013-05-18 15:02:30 +02:00
Mike Smoot
14ac7a1c17 Merged master into branch. 2012-11-25 13:40:11 -08:00
Mike Smoot
2fee9bc48e reverted changes? 2011-05-22 12:41:48 -07:00
Mike Smoot
fdce4f38f0 Allows xor args to be optional 2011-05-22 12:05:21 -07:00
Mike Smoot
a5105dc72a added patch to fix brief output with TCLAP_NAMESTRING defined 2011-05-22 11:50:16 -07:00
Michael Smoot
f946bb210d added support for ignoring unmatched args 2011-04-17 15:04:28 -07:00
mes5k
122b50e26d patch that allows arg start strings to be pound defined to easily conform to different platforms 2011-04-11 00:08:41 +00:00
mes5k
89f4aacf98 fixed shadow variable name problem 2011-04-09 18:30:32 +00:00
mes5k
cbc24a3b58 fixed minor memory leak 2011-04-09 18:05:35 +00:00
macbishop
e2eb7b522e Updated documentation for ArgTraits to reference StringLike and ValueLike classes. 2011-01-15 17:45:17 +00:00
mes5k
fc9d87a003 finally fixed bug relating to mutually exclusive combined switched 2011-01-03 00:20:46 +00:00
mes5k
4ba45abdb9 minor reformat 2011-01-02 23:12:56 +00:00
mes5k
82d187771b minor reformatting 2011-01-02 23:10:18 +00:00
mes5k
09c1d2a113 applied Tom Fogal's win64 patch for size_t 2011-01-02 19:52:54 +00:00
mes5k
e9dfb0394b fixed all effective c++ warnings based on patch from Andrew Marlow 2011-01-02 18:50:47 +00:00
mes5k
b8b1bb2467 make error message a bit more meaningful 2009-10-25 03:49:00 +00:00
mes5k
ab82cc7f87 added a check for wchar_t to deal with a potential problem with MS compilers 2009-10-23 21:42:43 +00:00
mes5k
6db71e94af updated incorrect api docs again 2009-07-15 15:09:44 +00:00
mes5k
b9340c617d updated incorrect api doc 2009-07-15 15:04:39 +00:00