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
77296927
Commit
77296927
authored
May 25, 2012
by
Jesse Beder
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactored stream overloads
parent
2ffdc5b4
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
+14
-3
src/ostream_wrapper.cpp
+0
-18
No files found.
include/yaml-cpp/ostream_wrapper.h
View file @
77296927
...
@@ -49,9 +49,20 @@ namespace YAML
...
@@ -49,9 +49,20 @@ namespace YAML
bool
m_comment
;
bool
m_comment
;
};
};
ostream_wrapper
&
operator
<<
(
ostream_wrapper
&
out
,
const
char
*
str
);
inline
ostream_wrapper
&
operator
<<
(
ostream_wrapper
&
stream
,
const
char
*
str
)
{
ostream_wrapper
&
operator
<<
(
ostream_wrapper
&
out
,
const
std
::
string
&
str
);
stream
.
write
(
str
,
std
::
strlen
(
str
));
ostream_wrapper
&
operator
<<
(
ostream_wrapper
&
out
,
char
ch
);
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
#endif // OSTREAM_WRAPPER_H_62B23520_7C8E_11DE_8A39_0800200C9A66
src/ostream_wrapper.cpp
View file @
77296927
...
@@ -53,22 +53,4 @@ namespace YAML
...
@@ -53,22 +53,4 @@ namespace YAML
m_comment
=
false
;
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