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
b12e4b07
Commit
b12e4b07
authored
Nov 08, 2012
by
Jesse Beder
Browse files
Options
Browse Files
Download
Plain Diff
Merged from core, rfaef276b1f6e
parents
0c772c4c
979a9169
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
1 deletions
+34
-1
test/core/parsertests.cpp
+1
-1
util/CMakeLists.txt
+3
-0
util/read.cpp
+30
-0
No files found.
test/core/parsertests.cpp
View file @
b12e4b07
...
@@ -29,7 +29,7 @@ namespace Test
...
@@ -29,7 +29,7 @@ namespace Test
}
}
if
(
!
ret
.
ok
)
{
if
(
!
ret
.
ok
)
{
std
::
cout
<<
"
Spec test "
<<
index
<<
"
failed: "
<<
name
<<
"
\n
"
;
std
::
cout
<<
"
Parser test
failed: "
<<
name
<<
"
\n
"
;
std
::
cout
<<
ret
.
error
<<
"
\n
"
;
std
::
cout
<<
ret
.
error
<<
"
\n
"
;
}
}
...
...
util/CMakeLists.txt
View file @
b12e4b07
...
@@ -3,3 +3,6 @@ target_link_libraries(parse yaml-cpp)
...
@@ -3,3 +3,6 @@ target_link_libraries(parse yaml-cpp)
add_executable
(
sandbox sandbox.cpp
)
add_executable
(
sandbox sandbox.cpp
)
target_link_libraries
(
sandbox yaml-cpp
)
target_link_libraries
(
sandbox yaml-cpp
)
add_executable
(
read read.cpp
)
target_link_libraries
(
read yaml-cpp
)
util/read.cpp
0 → 100644
View file @
b12e4b07
#include "yaml-cpp/yaml.h"
#include "yaml-cpp/eventhandler.h"
#include <iostream>
class
NullEventHandler
:
public
YAML
::
EventHandler
{
public
:
typedef
YAML
::
Mark
Mark
;
typedef
YAML
::
anchor_t
anchor_t
;
NullEventHandler
()
{}
virtual
void
OnDocumentStart
(
const
Mark
&
)
{}
virtual
void
OnDocumentEnd
()
{}
virtual
void
OnNull
(
const
Mark
&
,
anchor_t
)
{}
virtual
void
OnAlias
(
const
Mark
&
,
anchor_t
)
{}
virtual
void
OnScalar
(
const
Mark
&
,
const
std
::
string
&
,
anchor_t
,
const
std
::
string
&
)
{}
virtual
void
OnSequenceStart
(
const
Mark
&
,
const
std
::
string
&
,
anchor_t
)
{}
virtual
void
OnSequenceEnd
()
{}
virtual
void
OnMapStart
(
const
Mark
&
,
const
std
::
string
&
,
anchor_t
)
{}
virtual
void
OnMapEnd
()
{}
};
int
main
()
{
YAML
::
Parser
parser
(
std
::
cin
);
NullEventHandler
handler
;
parser
.
HandleNextDocument
(
handler
);
return
0
;
}
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