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
152e48f0
Commit
152e48f0
authored
Mar 02, 2011
by
jbeder
Browse files
Prettied up the bool formatting code
parent
396e3309
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
23 deletions
+19
-23
src/emitter.cpp
src/emitter.cpp
+19
-23
No files found.
src/emitter.cpp
View file @
152e48f0
...
@@ -613,36 +613,32 @@ namespace YAML
...
@@ -613,36 +613,32 @@ namespace YAML
switch
(
mainFmt
)
{
switch
(
mainFmt
)
{
case
YesNoBool
:
case
YesNoBool
:
switch
(
caseFmt
)
{
switch
(
caseFmt
)
{
case
UpperCase
:
case
UpperCase
:
return
b
?
"YES"
:
"NO"
;
return
b
?
"YES"
:
"NO"
;
case
CamelCase
:
return
b
?
"Yes"
:
"No"
;
case
CamelCase
:
case
LowerCase
:
return
b
?
"yes"
:
"no"
;
return
b
?
"Yes"
:
"No"
;
default:
break
;
case
LowerCase
:
// fall through to default
default:
return
b
?
"yes"
:
"no"
;
}
}
break
;
case
OnOffBool
:
case
OnOffBool
:
switch
(
caseFmt
)
{
switch
(
caseFmt
)
{
case
UpperCase
:
case
UpperCase
:
return
b
?
"ON"
:
"OFF"
;
return
b
?
"ON"
:
"OFF"
;
case
CamelCase
:
return
b
?
"On"
:
"Off"
;
case
CamelCase
:
case
LowerCase
:
return
b
?
"on"
:
"off"
;
return
b
?
"On"
:
"Off"
;
default:
break
;
case
LowerCase
:
// fall through to default
default:
return
b
?
"on"
:
"off"
;
}
}
case
TrueFalseBool
:
// fall through to default
break
;
default
:
case
TrueFalseBool
:
switch
(
caseFmt
)
{
switch
(
caseFmt
)
{
case
UpperCase
:
case
UpperCase
:
return
b
?
"TRUE"
:
"FALSE"
;
return
b
?
"TRUE"
:
"FALSE"
;
case
CamelCase
:
return
b
?
"True"
:
"False"
;
case
CamelCase
:
case
LowerCase
:
return
b
?
"true"
:
"false"
;
return
b
?
"True"
:
"False"
;
default:
break
;
case
LowerCase
:
// fall through to default
default:
return
b
?
"true"
:
"false"
;
}
}
break
;
default:
break
;
}
}
return
b
?
"y"
:
"n"
;
// should never get here, but it can't hurt to give these answers
}
}
Emitter
&
Emitter
::
Write
(
bool
b
)
Emitter
&
Emitter
::
Write
(
bool
b
)
...
...
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