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
07e88a78
Commit
07e88a78
authored
May 21, 2012
by
Jesse Beder
Browse files
Added alias
parent
c5e4bdee
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
3 deletions
+15
-3
src/emitter.cpp
src/emitter.cpp
+12
-0
util/sandbox.cpp
util/sandbox.cpp
+3
-3
No files found.
src/emitter.cpp
View file @
07e88a78
...
@@ -513,6 +513,18 @@ namespace YAML
...
@@ -513,6 +513,18 @@ namespace YAML
if
(
!
good
())
if
(
!
good
())
return
*
this
;
return
*
this
;
if
(
m_pState
->
HasAnchor
()
||
m_pState
->
HasTag
())
{
m_pState
->
SetError
(
ErrorMsg
::
INVALID_ALIAS
);
return
*
this
;
}
PrepareNode
(
EmitterNodeType
::
Scalar
);
if
(
!
Utils
::
WriteAlias
(
m_stream
,
alias
.
content
))
{
m_pState
->
SetError
(
ErrorMsg
::
INVALID_ALIAS
);
return
*
this
;
}
m_pState
->
BeginScalar
();
m_pState
->
BeginScalar
();
return
*
this
;
return
*
this
;
...
...
util/sandbox.cpp
View file @
07e88a78
...
@@ -9,13 +9,13 @@ int main()
...
@@ -9,13 +9,13 @@ int main()
out
<<
"foo"
;
out
<<
"foo"
;
out
<<
YAML
::
LocalTag
(
"hi"
)
<<
"bar"
;
out
<<
YAML
::
LocalTag
(
"hi"
)
<<
"bar"
;
out
<<
YAML
::
Anchor
(
"asdf"
)
<<
YAML
::
BeginMap
;
out
<<
YAML
::
Anchor
(
"asdf"
)
<<
YAML
::
BeginMap
;
out
<<
"a"
<<
"b"
<<
"c"
<<
YAML
::
Newline
;
out
<<
"a"
<<
"b"
<<
"c"
;
out
<<
YAML
::
Anchor
(
"a"
)
<<
YAML
::
BeginMap
;
out
<<
YAML
::
Anchor
(
"a"
)
<<
YAML
::
BeginMap
;
out
<<
"a"
<<
"b"
;
out
<<
YAML
::
Anchor
(
"d"
)
<<
"a"
<<
"b"
;
out
<<
YAML
::
EndMap
;
out
<<
YAML
::
EndMap
;
out
<<
YAML
::
EndMap
;
out
<<
YAML
::
EndMap
;
out
<<
YAML
::
LocalTag
(
"hi"
)
<<
YAML
::
BeginSeq
;
out
<<
YAML
::
LocalTag
(
"hi"
)
<<
YAML
::
BeginSeq
;
out
<<
"a"
<<
"b"
;
out
<<
"a"
<<
"b"
<<
YAML
::
Alias
(
"monkey"
)
;
out
<<
YAML
::
EndSeq
;
out
<<
YAML
::
EndSeq
;
out
<<
YAML
::
EndSeq
;
out
<<
YAML
::
EndSeq
;
...
...
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