Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ISC Open Source Projects
Kea
Commits
6725cdd4
Commit
6725cdd4
authored
Apr 18, 2014
by
Marcin Siodelski
Browse files
[3408] Added a few comments in the data.cc concerning element position.
parent
9ae173d4
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/lib/cc/data.cc
View file @
6725cdd4
...
...
@@ -401,7 +401,10 @@ numberFromStringstream(std::istream& in, int& pos) {
ElementPtr
fromStringstreamNumber
(
std
::
istream
&
in
,
const
std
::
string
&
file
,
const
int
&
line
,
int
&
pos
)
{
// Remember position where the value starts. It will be set in the
// Position structure of the Element to be created.
const
uint32_t
start_pos
=
pos
;
// This will move the pos to the end of the value.
const
std
::
string
number
=
numberFromStringstream
(
in
,
pos
);
if
(
number
.
find_first_of
(
".eE"
)
<
number
.
size
())
{
...
...
@@ -427,7 +430,10 @@ ElementPtr
fromStringstreamBool
(
std
::
istream
&
in
,
const
std
::
string
&
file
,
const
int
line
,
int
&
pos
)
{
// Remember position where the value starts. It will be set in the
// Position structure of the Element to be created.
const
uint32_t
start_pos
=
pos
;
// This will move the pos to the end of the value.
const
std
::
string
word
=
wordFromStringstream
(
in
,
pos
);
if
(
boost
::
iequals
(
word
,
"True"
))
{
...
...
@@ -445,7 +451,10 @@ ElementPtr
fromStringstreamNull
(
std
::
istream
&
in
,
const
std
::
string
&
file
,
const
int
line
,
int
&
pos
)
{
// Remember position where the value starts. It will be set in the
// Position structure of the Element to be created.
const
uint32_t
start_pos
=
pos
;
// This will move the pos to the end of the value.
const
std
::
string
word
=
wordFromStringstream
(
in
,
pos
);
if
(
boost
::
iequals
(
word
,
"null"
))
{
return
(
Element
::
create
(
Element
::
Position
(
line
,
start_pos
)));
...
...
@@ -460,7 +469,10 @@ ElementPtr
fromStringstreamString
(
std
::
istream
&
in
,
const
std
::
string
&
file
,
int
&
line
,
int
&
pos
)
{
// Remember position where the value starts. It will be set in the
// Position structure of the Element to be created.
const
uint32_t
start_pos
=
pos
;
// This will move the pos to the end of the value.
const
std
::
string
string_value
=
strFromStringstream
(
in
,
file
,
line
,
pos
);
return
(
Element
::
create
(
string_value
,
Element
::
Position
(
line
,
start_pos
)));
}
...
...
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