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
bf2865a0
Commit
bf2865a0
authored
Dec 11, 2009
by
Mark Olesen
Browse files
Add missing low-level peek() to ISstream.
parent
d016db1b
Changes
3
Hide whitespace changes
Inline
Side-by-side
applications/test/tokenizeTest/tokenizeTest.C
View file @
bf2865a0
...
...
@@ -67,9 +67,15 @@ int main(int argc, char *argv[])
while
(
is
.
good
())
{
token
tok
(
is
);
// char ch;
// is.get(ch);
// is.putback(ch);
int
lookahead
=
is
.
peek
();
if
(
count
==
0
)
{
Info
<<
"token: "
<<
tok
.
info
()
<<
endl
;
Info
<<
"token: "
<<
tok
.
info
();
Info
<<
" lookahead: '"
<<
char
(
lookahead
)
<<
"'"
<<
endl
;
}
}
...
...
src/OpenFOAM/db/IOstreams/Sstreams/ISstream.H
View file @
bf2865a0
...
...
@@ -137,6 +137,12 @@ public:
//- Raw, low-level get character function.
inline
ISstream
&
get
(
char
&
);
//- Raw, low-level peek function.
// Does not remove the character from the stream.
// Returns the next character in the stream or EOF if the
// end of file is read.
inline
int
peek
();
//- Raw, low-level getline into a string function.
inline
ISstream
&
getLine
(
string
&
);
...
...
src/OpenFOAM/db/IOstreams/Sstreams/ISstreamI.H
View file @
bf2865a0
...
...
@@ -69,6 +69,12 @@ inline Foam::ISstream& Foam::ISstream::get(char& c)
}
inline
int
Foam
::
ISstream
::
peek
()
{
return
is_
.
peek
();
}
inline
Foam
::
ISstream
&
Foam
::
ISstream
::
getLine
(
string
&
s
)
{
getline
(
is_
,
s
);
...
...
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