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
b12e4b07
Commit
b12e4b07
authored
Nov 08, 2012
by
Jesse Beder
Browse files
Merged from core, rfaef276b1f6e
parents
0c772c4c
979a9169
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
1 deletion
+34
-1
test/core/parsertests.cpp
test/core/parsertests.cpp
+1
-1
util/CMakeLists.txt
util/CMakeLists.txt
+3
-0
util/read.cpp
util/read.cpp
+30
-0
No files found.
test/core/parsertests.cpp
View file @
b12e4b07
...
...
@@ -29,7 +29,7 @@ namespace Test
}
if
(
!
ret
.
ok
)
{
std
::
cout
<<
"
Spec test "
<<
index
<<
"
failed: "
<<
name
<<
"
\n
"
;
std
::
cout
<<
"
Parser test
failed: "
<<
name
<<
"
\n
"
;
std
::
cout
<<
ret
.
error
<<
"
\n
"
;
}
...
...
util/CMakeLists.txt
View file @
b12e4b07
...
...
@@ -3,3 +3,6 @@ target_link_libraries(parse yaml-cpp)
add_executable
(
sandbox sandbox.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