Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Kea
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Sebastian Schrader
Kea
Commits
c180526d
Commit
c180526d
authored
Apr 18, 2014
by
Marcin Siodelski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[3408] Addressed review comments.
parent
51720f50
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
14 deletions
+23
-14
src/lib/cc/data.cc
src/lib/cc/data.cc
+19
-3
src/lib/cc/data.h
src/lib/cc/data.h
+4
-11
No files found.
src/lib/cc/data.cc
View file @
c180526d
...
...
@@ -218,19 +218,34 @@ Element::create(const long long int i, const Position& pos) {
return
(
ElementPtr
(
new
IntElement
(
static_cast
<
int64_t
>
(
i
),
pos
)));
}
ElementPtr
Element
::
create
(
const
int
i
,
const
Position
&
pos
)
{
return
(
create
(
static_cast
<
long
long
int
>
(
i
),
pos
));
};
ElementPtr
Element
::
create
(
const
long
int
i
,
const
Position
&
pos
)
{
return
(
create
(
static_cast
<
long
long
int
>
(
i
),
pos
));
};
ElementPtr
Element
::
create
(
const
double
d
,
const
Position
&
pos
)
{
return
(
ElementPtr
(
new
DoubleElement
(
d
,
pos
)));
}
ElementPtr
Element
::
create
(
const
bool
b
,
const
Position
&
pos
)
{
return
(
ElementPtr
(
new
BoolElement
(
b
,
pos
)));
}
ElementPtr
Element
::
create
(
const
std
::
string
&
s
,
const
Position
&
pos
)
{
return
(
ElementPtr
(
new
StringElement
(
s
,
pos
)));
}
ElementPtr
Element
::
create
(
const
bool
b
,
const
Position
&
pos
)
{
return
(
ElementPtr
(
new
BoolElement
(
b
,
pos
)
));
Element
::
create
(
const
char
*
s
,
const
Position
&
pos
)
{
return
(
create
(
std
::
string
(
s
),
pos
));
}
ElementPtr
...
...
@@ -412,7 +427,8 @@ fromStringstreamNumber(std::istream& in, const std::string& file,
return
(
Element
::
create
(
boost
::
lexical_cast
<
double
>
(
number
),
Element
::
Position
(
line
,
start_pos
)));
}
catch
(
const
boost
::
bad_lexical_cast
&
)
{
isc_throw
(
JSONError
,
std
::
string
(
"Number overflow: "
)
+
number
);
throwJSONError
(
std
::
string
(
"Number overflow: "
)
+
number
,
file
,
line
,
start_pos
);
}
}
else
{
try
{
...
...
src/lib/cc/data.h
View file @
c180526d
...
...
@@ -351,16 +351,11 @@ public:
static
ElementPtr
create
(
const
long
long
int
i
,
const
Position
&
pos
=
ZERO_POSITION
());
static
ElementPtr
create
(
const
int
i
,
const
Position
&
pos
=
ZERO_POSITION
())
{
return
(
create
(
static_cast
<
long
long
int
>
(
i
),
pos
));
};
const
Position
&
pos
=
ZERO_POSITION
());
static
ElementPtr
create
(
const
long
int
i
,
const
Position
&
pos
=
ZERO_POSITION
())
{
return
(
create
(
static_cast
<
long
long
int
>
(
i
),
pos
));
};
const
Position
&
pos
=
ZERO_POSITION
());
static
ElementPtr
create
(
const
double
d
,
const
Position
&
pos
=
ZERO_POSITION
());
static
ElementPtr
create
(
const
bool
b
,
const
Position
&
pos
=
ZERO_POSITION
());
static
ElementPtr
create
(
const
std
::
string
&
s
,
...
...
@@ -368,9 +363,7 @@ public:
// need both std:string and char *, since c++ will match
// bool before std::string when you pass it a char *
static
ElementPtr
create
(
const
char
*
s
,
const
Position
&
pos
=
ZERO_POSITION
())
{
return
(
create
(
std
::
string
(
s
),
pos
));
}
const
Position
&
pos
=
ZERO_POSITION
());
/// \brief Creates an empty ListElement type ElementPtr.
///
...
...
@@ -474,7 +467,7 @@ public:
/// (C++ tries to convert integer type values and reference/pointer
/// if value types do not match exactly)
/// We decided the storage as int64_t,
/// three (long long, long, int) override function defintions
/// three (long long, long, int) override function defin
i
tions
/// and cast int/long/long long to int64_t via long long.
/// Therefore, call by value methods (create, setValue) have three
/// (int,long,long long) definitions. Others use int64_t.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment