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
77296927
Commit
77296927
authored
May 25, 2012
by
Jesse Beder
Browse files
Refactored stream overloads
parent
2ffdc5b4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
21 deletions
+14
-21
include/yaml-cpp/ostream_wrapper.h
include/yaml-cpp/ostream_wrapper.h
+14
-3
src/ostream_wrapper.cpp
src/ostream_wrapper.cpp
+0
-18
No files found.
include/yaml-cpp/ostream_wrapper.h
View file @
77296927
...
...
@@ -49,9 +49,20 @@ namespace YAML
bool
m_comment
;
};
ostream_wrapper
&
operator
<<
(
ostream_wrapper
&
out
,
const
char
*
str
);
ostream_wrapper
&
operator
<<
(
ostream_wrapper
&
out
,
const
std
::
string
&
str
);
ostream_wrapper
&
operator
<<
(
ostream_wrapper
&
out
,
char
ch
);
inline
ostream_wrapper
&
operator
<<
(
ostream_wrapper
&
stream
,
const
char
*
str
)
{
stream
.
write
(
str
,
std
::
strlen
(
str
));
return
stream
;
}
inline
ostream_wrapper
&
operator
<<
(
ostream_wrapper
&
stream
,
const
std
::
string
&
str
)
{
stream
.
write
(
str
);
return
stream
;
}
inline
ostream_wrapper
&
operator
<<
(
ostream_wrapper
&
stream
,
char
ch
)
{
stream
.
write
(
&
ch
,
1
);
return
stream
;
}
}
#endif // OSTREAM_WRAPPER_H_62B23520_7C8E_11DE_8A39_0800200C9A66
src/ostream_wrapper.cpp
View file @
77296927
...
...
@@ -53,22 +53,4 @@ namespace YAML
m_comment
=
false
;
}
}
ostream_wrapper
&
operator
<<
(
ostream_wrapper
&
out
,
const
char
*
str
)
{
out
.
write
(
str
,
std
::
strlen
(
str
));
return
out
;
}
ostream_wrapper
&
operator
<<
(
ostream_wrapper
&
out
,
const
std
::
string
&
str
)
{
out
.
write
(
str
);
return
out
;
}
ostream_wrapper
&
operator
<<
(
ostream_wrapper
&
out
,
char
ch
)
{
out
.
write
(
&
ch
,
1
);
return
out
;
}
}
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