Doxygen
首页
模块
命名空间
命名空间列表
命名空间成员
全部
_
a
b
c
d
e
f
g
i
l
m
n
o
p
q
r
s
t
u
v
w
x
函数
a
c
d
f
g
i
m
p
r
s
u
w
变量
_
a
b
c
d
e
f
g
i
l
m
n
o
p
q
r
s
t
u
v
w
x
枚举
枚举值
类
类列表
类索引
类继承关系
类成员
全部
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
函数
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
变量
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
类型定义
a
c
d
e
f
h
i
k
m
n
p
r
s
t
u
v
枚举
a
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
v
w
枚举值
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
相关函数
文件
文件列表
文件成员
全部
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
x
y
函数
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
x
y
变量
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
r
s
t
u
v
y
类型定义
a
b
c
d
e
f
i
j
l
m
n
o
p
r
s
t
u
v
y
枚举
a
c
d
e
f
g
h
i
m
n
p
r
s
t
枚举值
a
c
d
e
f
g
h
i
m
n
p
r
s
t
u
v
x
宏定义
a
b
c
d
e
f
g
h
i
j
l
m
n
p
q
r
s
t
w
x
y
cppvalue.h
浏览该文件的文档.
1
/******************************************************************************
2
*
3
* Copyright (C) 1997-2021 by Dimitri van Heesch.
4
*
5
* Permission to use, copy, modify, and distribute this software and its
6
* documentation under the terms of the GNU General Public License is hereby
7
* granted. No representations are made about the suitability of this software
8
* for any purpose. It is provided "as is" without express or implied warranty.
9
* See the GNU General Public License for more details.
10
*
11
* Documents produced by Doxygen are derivative works derived from the
12
* input used in their production; they are not affected by this license.
13
*
14
*/
15
16
#ifndef CPPVALUE_H
17
#define CPPVALUE_H
18
19
#include <cstdio>
20
#include <string>
21
22
/** A class representing a C-preprocessor value. */
23
class
CPPValue
24
{
25
public
:
26
enum
Type
{
Int
,
Float
};
27
28
CPPValue
(
long
val=0) :
type
(
Int
) {
v
.l = val; }
29
CPPValue
(
double
val) :
type
(
Float
) {
v
.d = val; }
30
31
operator
double ()
const
{
return
type
==
Int
? (double)
v
.l :
v
.d; }
32
operator
long ()
const
{
return
type
==
Int
?
v
.l : (long)
v
.d; }
33
34
bool
isInt
()
const
{
return
type
==
Int
; }
35
36
void
print
()
const
37
{
38
if
(
type
==
Int
)
39
printf(
"(%ld)\n"
,
v
.l);
40
else
41
printf(
"(%f)\n"
,
v
.d);
42
}
43
44
private
:
45
Type
type
;
46
union
{
47
double
d
;
48
long
l
;
49
}
v
;
50
};
51
52
extern
CPPValue
parseOctal
(
const
std::string& token);
53
extern
CPPValue
parseDecimal
(
const
std::string& token);
54
extern
CPPValue
parseHexadecimal
(
const
std::string& token);
55
extern
CPPValue
parseBinary
(
const
std::string& token);
56
extern
CPPValue
parseCharacter
(
const
std::string& token);
57
extern
CPPValue
parseFloat
(
const
std::string& token);
58
59
#endif
CPPValue::CPPValue
CPPValue(long val=0)
Definition:
cppvalue.h:41
CPPValue::v
union CPPValue::@1 v
CPPValue::isInt
bool isInt() const
Definition:
cppvalue.h:47
parseOctal
CPPValue parseOctal(const std::string &token)
Definition:
cppvalue.cpp:21
CPPValue::type
Type type
Definition:
cppvalue.h:58
CPPValue::d
double d
Definition:
cppvalue.h:60
CPPValue::Int
@ Int
Definition:
cppvalue.h:52
CPPValue
A class representing a C-preprocessor value.
Definition:
cppvalue.h:23
parseFloat
CPPValue parseFloat(const std::string &token)
Definition:
cppvalue.cpp:99
parseBinary
CPPValue parseBinary(const std::string &token)
Definition:
cppvalue.cpp:54
parseDecimal
CPPValue parseDecimal(const std::string &token)
Definition:
cppvalue.cpp:31
parseHexadecimal
CPPValue parseHexadecimal(const std::string &token)
Definition:
cppvalue.cpp:41
CPPValue::Type
Type
Definition:
cppvalue.h:39
CPPValue::Float
@ Float
Definition:
cppvalue.h:52
CPPValue::print
void print() const
Definition:
cppvalue.h:49
CPPValue::l
long l
Definition:
cppvalue.h:61
parseCharacter
CPPValue parseCharacter(const std::string &token)
Definition:
cppvalue.cpp:64
src
cppvalue.h
生成于 2021年 十一月 27日 星期六 08:40:52 , 为 Doxygen使用
1.8.17