~ubuntu-branches/debian/sid/universalindentgui/sid

« back to all changes in this revision

Viewing changes to src/tclap/StandardTraits.h

  • Committer: Package Import Robot
  • Author(s): Fathi Boudra
  • Date: 2012-05-22 08:49:27 UTC
  • mfrom: (1.1.4)
  • Revision ID: package-import@ubuntu.com-20120522084927-oijnyby6gedsinbh
Tags: 1.2.0-1
* New upstream release.
* Drop 02_fix_gcc_4.5_build.patch - merged upstream.
* Update debian/contol:
  - bump debhelper to 9.
  - bump Standards-Version to 3.9.3 (no changes needed).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// -*- Mode: c++; c-basic-offset: 4; tab-width: 4; -*-
 
2
 
 
3
/******************************************************************************
 
4
 *
 
5
 *  file:  StandardTraits.h
 
6
 *
 
7
 *  Copyright (c) 2007, Daniel Aarno, Michael E. Smoot .
 
8
 *  All rights reverved.
 
9
 *
 
10
 *  See the file COPYING in the top directory of this distribution for
 
11
 *  more information.
 
12
 *
 
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.
 
20
 *
 
21
 *****************************************************************************/
 
22
 
 
23
// This is an internal tclap file, you should probably not have to
 
24
// include this directly
 
25
 
 
26
#ifndef TCLAP_STANDARD_TRAITS_H
 
27
#define TCLAP_STANDARD_TRAITS_H
 
28
 
 
29
#ifdef HAVE_CONFIG_H
 
30
#include <config.h> // To check for long long
 
31
#endif
 
32
 
 
33
namespace TCLAP {
 
34
 
 
35
// ======================================================================
 
36
// Integer types
 
37
// ======================================================================
 
38
 
 
39
/**
 
40
 * longs have value-like semantics.
 
41
 */
 
42
template<>
 
43
struct ArgTraits<long> {
 
44
    typedef ValueLike ValueCategory;
 
45
};
 
46
 
 
47
/**
 
48
 * ints have value-like semantics.
 
49
 */
 
50
template<>
 
51
struct ArgTraits<int> {
 
52
    typedef ValueLike ValueCategory;
 
53
};
 
54
 
 
55
/**
 
56
 * shorts have value-like semantics.
 
57
 */
 
58
template<>
 
59
struct ArgTraits<short> {
 
60
    typedef ValueLike ValueCategory;
 
61
};
 
62
 
 
63
/**
 
64
 * chars have value-like semantics.
 
65
 */
 
66
template<>
 
67
struct ArgTraits<char> {
 
68
    typedef ValueLike ValueCategory;
 
69
};
 
70
 
 
71
#ifdef HAVE_LONG_LONG
 
72
/**
 
73
 * long longs have value-like semantics.
 
74
 */
 
75
template<>
 
76
struct ArgTraits<long long> {
 
77
    typedef ValueLike ValueCategory;
 
78
};
 
79
#endif
 
80
 
 
81
// ======================================================================
 
82
// Unsigned integer types
 
83
// ======================================================================
 
84
 
 
85
/**
 
86
 * unsigned longs have value-like semantics.
 
87
 */
 
88
template<>
 
89
struct ArgTraits<unsigned long> {
 
90
    typedef ValueLike ValueCategory;
 
91
};
 
92
 
 
93
/**
 
94
 * unsigned ints have value-like semantics.
 
95
 */
 
96
template<>
 
97
struct ArgTraits<unsigned int> {
 
98
    typedef ValueLike ValueCategory;
 
99
};
 
100
 
 
101
/**
 
102
 * unsigned shorts have value-like semantics.
 
103
 */
 
104
template<>
 
105
struct ArgTraits<unsigned short> {
 
106
    typedef ValueLike ValueCategory;
 
107
};
 
108
 
 
109
/**
 
110
 * unsigned chars have value-like semantics.
 
111
 */
 
112
template<>
 
113
struct ArgTraits<unsigned char> {
 
114
    typedef ValueLike ValueCategory;
 
115
};
 
116
 
 
117
#ifdef HAVE_LONG_LONG
 
118
/**
 
119
 * unsigned long longs have value-like semantics.
 
120
 */
 
121
template<>
 
122
struct ArgTraits<unsigned long long> {
 
123
    typedef ValueLike ValueCategory;
 
124
};
 
125
#endif
 
126
 
 
127
// ======================================================================
 
128
// Float types
 
129
// ======================================================================
 
130
 
 
131
/**
 
132
 * floats have value-like semantics.
 
133
 */
 
134
template<>
 
135
struct ArgTraits<float> {
 
136
    typedef ValueLike ValueCategory;
 
137
};
 
138
 
 
139
/**
 
140
 * doubles have value-like semantics.
 
141
 */
 
142
template<>
 
143
struct ArgTraits<double> {
 
144
    typedef ValueLike ValueCategory;
 
145
};
 
146
 
 
147
// ======================================================================
 
148
// Other types
 
149
// ======================================================================
 
150
 
 
151
/**
 
152
 * bools have value-like semantics.
 
153
 */
 
154
template<>
 
155
struct ArgTraits<bool> {
 
156
    typedef ValueLike ValueCategory;
 
157
};
 
158
 
 
159
/**
 
160
 * wchar_ts have value-like semantics.
 
161
 */
 
162
/*
 
163
template<>
 
164
struct ArgTraits<wchar_t> {
 
165
    typedef ValueLike ValueCategory;
 
166
};
 
167
*/
 
168
 
 
169
/**
 
170
 * Strings have string like argument traits.
 
171
 */
 
172
template<>
 
173
struct ArgTraits<std::string> {
 
174
    typedef StringLike ValueCategory;
 
175
};
 
176
 
 
177
template<typename T>
 
178
void SetString(T &dst, const std::string &src)
 
179
{
 
180
    dst = src;
 
181
}
 
182
 
 
183
} // namespace
 
184
 
 
185
#endif
 
186