Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yaml-cpp
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
yaml-cpp
Commits
174f2c1f
Commit
174f2c1f
authored
Jul 10, 2009
by
Jesse Beder
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Set up the parse utility program to read from standard input if no file is specified
parent
11f98f1c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
9 deletions
+10
-9
util/parse.cpp
+10
-9
No files found.
util/parse.cpp
View file @
174f2c1f
...
...
@@ -4,16 +4,17 @@
int
main
(
int
argc
,
char
**
argv
)
{
if
(
argc
!=
2
)
{
std
::
cout
<<
"Usage: "
<<
argv
[
0
]
<<
" input-file
\n
"
;
return
0
;
}
std
::
ifstream
fin
(
argv
[
1
]);
std
::
ifstream
fin
;
if
(
argc
>
1
)
fin
.
open
(
argv
[
1
]);
std
::
istream
&
input
=
(
argc
>
1
?
fin
:
std
::
cin
);
try
{
YAML
::
Parser
parser
(
fin
);
YAML
::
Node
doc
;
parser
.
GetNextDocument
(
doc
);
YAML
::
Parser
parser
(
input
);
while
(
parser
)
{
YAML
::
Node
doc
;
parser
.
GetNextDocument
(
doc
);
}
}
catch
(
const
YAML
::
Exception
&
e
)
{
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