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
gaoqiong
yaml-cpp
Commits
10b5961f
"scanscalar.cpp" did not exist on "45dfc719e1eb9eda5aa04f4f638d71aa499d4110"
Commit
10b5961f
authored
Jul 10, 2009
by
jbeder
Browse files
Set up the parse utility program to read from standard input if no file is specified
parent
6752e25b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
9 deletions
+10
-9
util/parse.cpp
util/parse.cpp
+10
-9
No files found.
util/parse.cpp
View file @
10b5961f
...
@@ -4,16 +4,17 @@
...
@@ -4,16 +4,17 @@
int
main
(
int
argc
,
char
**
argv
)
int
main
(
int
argc
,
char
**
argv
)
{
{
if
(
argc
!=
2
)
{
std
::
ifstream
fin
;
std
::
cout
<<
"Usage: "
<<
argv
[
0
]
<<
" input-file
\n
"
;
if
(
argc
>
1
)
return
0
;
fin
.
open
(
argv
[
1
]);
}
std
::
istream
&
input
=
(
argc
>
1
?
fin
:
std
::
cin
);
std
::
ifstream
fin
(
argv
[
1
]);
try
{
try
{
YAML
::
Parser
parser
(
fin
);
YAML
::
Parser
parser
(
input
);
YAML
::
Node
doc
;
while
(
parser
)
{
parser
.
GetNextDocument
(
doc
);
YAML
::
Node
doc
;
parser
.
GetNextDocument
(
doc
);
}
}
catch
(
const
YAML
::
Exception
&
e
)
{
}
catch
(
const
YAML
::
Exception
&
e
)
{
std
::
cerr
<<
e
.
what
()
<<
"
\n
"
;
std
::
cerr
<<
e
.
what
()
<<
"
\n
"
;
}
}
...
...
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