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
Development
openfoam
Commits
02ef85fa
Commit
02ef85fa
authored
Dec 15, 2009
by
Mark Olesen
Browse files
Use first() and last() methods in primitiveEntry.
parent
3f0b6ec8
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/OpenFOAM/db/dictionary/primitiveEntry/primitiveEntry.C
View file @
02ef85fa
...
...
@@ -60,34 +60,39 @@ Foam::primitiveEntry::primitiveEntry
Foam
::
label
Foam
::
primitiveEntry
::
startLineNumber
()
const
{
if
(
size
())
const
tokenList
&
tokens
=
*
this
;
if
(
tokens
.
empty
())
{
return
operator
[](
0
).
lineNumber
()
;
return
-
1
;
}
else
{
return
-
1
;
return
tokens
.
first
().
lineNumber
()
;
}
}
Foam
::
label
Foam
::
primitiveEntry
::
endLineNumber
()
const
{
if
(
size
())
const
tokenList
&
tokens
=
*
this
;
if
(
tokens
.
empty
())
{
return
operator
[](
size
()
-
1
).
lineNumber
()
;
return
-
1
;
}
else
{
return
-
1
;
return
tokens
.
last
().
lineNumber
()
;
}
}
Foam
::
ITstream
&
Foam
::
primitiveEntry
::
stream
()
const
{
ITstream
&
dataStream
=
const_cast
<
primitiveEntry
&>
(
*
this
);
dataStream
.
rewind
();
return
dataStream
;
ITstream
&
is
=
const_cast
<
primitiveEntry
&>
(
*
this
);
is
.
rewind
();
return
is
;
}
...
...
@@ -125,7 +130,7 @@ void Foam::primitiveEntry::insert
{
label
end
=
tokens
.
size
()
-
1
;
for
(
label
j
=
posI
;
j
<
end
;
j
++
)
for
(
label
j
=
posI
;
j
<
end
;
j
++
)
{
tokens
[
j
]
=
tokens
[
j
+
1
];
}
...
...
@@ -139,7 +144,7 @@ void Foam::primitiveEntry::insert
label
end
=
tokens
.
size
()
-
1
;
label
offset
=
varTokens
.
size
()
-
1
;
for
(
label
j
=
end
;
j
>
posI
;
j
--
)
for
(
label
j
=
end
;
j
>
posI
;
j
--
)
{
tokens
[
j
]
=
tokens
[
j
-
offset
];
}
...
...
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