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
4aa61944
Commit
4aa61944
authored
Sep 07, 2011
by
Jesse Beder
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implemented is()
parent
e2255092
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
2 deletions
+10
-2
include/yaml-cpp/value/detail/node.h
+2
-0
include/yaml-cpp/value/impl.h
+7
-2
include/yaml-cpp/value/value.h
+1
-0
No files found.
include/yaml-cpp/value/detail/node.h
View file @
4aa61944
...
...
@@ -21,6 +21,8 @@ namespace YAML
node
()
:
m_pRef
(
new
node_ref
)
{}
ValueType
::
value
type
()
const
{
return
m_pRef
->
type
();
}
bool
is
(
const
node
&
rhs
)
const
{
return
m_pRef
==
rhs
.
m_pRef
;
}
void
set_ref
(
const
node
&
rhs
)
{
m_pRef
=
rhs
.
m_pRef
;
}
void
set_data
(
const
node
&
rhs
)
{
m_pRef
->
set_data
(
*
rhs
.
m_pRef
);
}
...
...
include/yaml-cpp/value/impl.h
View file @
4aa61944
...
...
@@ -57,6 +57,11 @@ namespace YAML
}
// assignment
inline
bool
Value
::
is
(
const
Value
&
rhs
)
const
{
return
m_pNode
->
is
(
*
rhs
.
m_pNode
);
}
template
<
typename
T
>
inline
Value
&
Value
::
operator
=
(
const
T
&
rhs
)
{
...
...
@@ -88,7 +93,7 @@ namespace YAML
inline
Value
&
Value
::
operator
=
(
const
Value
&
rhs
)
{
if
(
is
(
*
this
,
rhs
))
if
(
is
(
rhs
))
return
*
this
;
AssignNode
(
rhs
);
return
*
this
;
...
...
@@ -213,7 +218,7 @@ namespace YAML
inline
bool
is
(
const
Value
&
lhs
,
const
Value
&
rhs
)
{
return
false
;
return
lhs
.
is
(
rhs
)
;
}
}
...
...
include/yaml-cpp/value/value.h
View file @
4aa61944
...
...
@@ -31,6 +31,7 @@ namespace YAML
template
<
typename
T
>
const
T
as
()
const
;
// assignment
bool
is
(
const
Value
&
rhs
)
const
;
template
<
typename
T
>
Value
&
operator
=
(
const
T
&
rhs
);
Value
&
operator
=
(
const
Value
&
rhs
);
...
...
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