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
d772361f
Commit
d772361f
authored
Jan 13, 2012
by
Jesse Beder
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed hex and oct emitting (it now adds the 0x or 0 prefix)
parent
a441e1a1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
1 deletions
+14
-1
src/emitter.cpp
+3
-1
test/emittertests.cpp
+11
-0
No files found.
src/emitter.cpp
View file @
d772361f
...
...
@@ -670,9 +670,11 @@ namespace YAML
str
<<
std
::
dec
;
break
;
case
Hex
:
str
<<
"0x"
;
str
<<
std
::
hex
;
break
;
case
Oct
:
case
Oct
:
str
<<
"0"
;
str
<<
std
::
oct
;
break
;
default
:
...
...
test/emittertests.cpp
View file @
d772361f
...
...
@@ -901,6 +901,16 @@ namespace Test
desiredOutput
=
"key:
\"
-
\"
"
;
}
void
HexAndOct
(
YAML
::
Emitter
&
out
,
std
::
string
&
desiredOutput
)
{
out
<<
YAML
::
Flow
<<
YAML
::
BeginSeq
;
out
<<
31
;
out
<<
YAML
::
Hex
<<
31
;
out
<<
YAML
::
Oct
<<
31
;
out
<<
YAML
::
EndSeq
;
desiredOutput
=
"[31, 0x1f, 037]"
;
}
////////////////////////////////////////////////////////////////////////////////////////////////////////
// incorrect emitting
...
...
@@ -1123,6 +1133,7 @@ namespace Test
RunEmitterTest
(
&
Emitter
::
DefaultPrecision
,
"default precision"
,
passed
,
total
);
RunEmitterTest
(
&
Emitter
::
SetPrecision
,
"set precision"
,
passed
,
total
);
RunEmitterTest
(
&
Emitter
::
DashInBlockContext
,
"dash in block context"
,
passed
,
total
);
RunEmitterTest
(
&
Emitter
::
HexAndOct
,
"hex and oct"
,
passed
,
total
);
RunEmitterErrorTest
(
&
Emitter
::
ExtraEndSeq
,
"extra EndSeq"
,
passed
,
total
);
RunEmitterErrorTest
(
&
Emitter
::
ExtraEndMap
,
"extra EndMap"
,
passed
,
total
);
...
...
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