1
// -*- Mode: c++; c-basic-offset: 4; tab-width: 4; -*-
3
/******************************************************************************
5
* file: StandardTraits.h
7
* Copyright (c) 2007, Daniel Aarno, Michael E. Smoot .
10
* See the file COPYING in the top directory of this distribution for
13
* THE SOFTWARE IS PROVIDED _AS IS_, WITHOUT WARRANTY OF ANY KIND, EXPRESS
14
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
16
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
19
* DEALINGS IN THE SOFTWARE.
21
*****************************************************************************/
23
// This is an internal tclap file, you should probably not have to
24
// include this directly
26
#ifndef TCLAP_STANDARD_TRAITS_H
27
#define TCLAP_STANDARD_TRAITS_H
30
#include <config.h> // To check for long long
35
// ======================================================================
37
// ======================================================================
40
* longs have value-like semantics.
43
struct ArgTraits<long> {
44
typedef ValueLike ValueCategory;
48
* ints have value-like semantics.
51
struct ArgTraits<int> {
52
typedef ValueLike ValueCategory;
56
* shorts have value-like semantics.
59
struct ArgTraits<short> {
60
typedef ValueLike ValueCategory;
64
* chars have value-like semantics.
67
struct ArgTraits<char> {
68
typedef ValueLike ValueCategory;
73
* long longs have value-like semantics.
76
struct ArgTraits<long long> {
77
typedef ValueLike ValueCategory;
81
// ======================================================================
82
// Unsigned integer types
83
// ======================================================================
86
* unsigned longs have value-like semantics.
89
struct ArgTraits<unsigned long> {
90
typedef ValueLike ValueCategory;
94
* unsigned ints have value-like semantics.
97
struct ArgTraits<unsigned int> {
98
typedef ValueLike ValueCategory;
102
* unsigned shorts have value-like semantics.
105
struct ArgTraits<unsigned short> {
106
typedef ValueLike ValueCategory;
110
* unsigned chars have value-like semantics.
113
struct ArgTraits<unsigned char> {
114
typedef ValueLike ValueCategory;
117
#ifdef HAVE_LONG_LONG
119
* unsigned long longs have value-like semantics.
122
struct ArgTraits<unsigned long long> {
123
typedef ValueLike ValueCategory;
127
// ======================================================================
129
// ======================================================================
132
* floats have value-like semantics.
135
struct ArgTraits<float> {
136
typedef ValueLike ValueCategory;
140
* doubles have value-like semantics.
143
struct ArgTraits<double> {
144
typedef ValueLike ValueCategory;
147
// ======================================================================
149
// ======================================================================
152
* bools have value-like semantics.
155
struct ArgTraits<bool> {
156
typedef ValueLike ValueCategory;
160
* wchar_ts have value-like semantics.
164
struct ArgTraits<wchar_t> {
165
typedef ValueLike ValueCategory;
170
* Strings have string like argument traits.
173
struct ArgTraits<std::string> {
174
typedef StringLike ValueCategory;
178
void SetString(T &dst, const std::string &src)