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
5dbcf7ee
Commit
5dbcf7ee
authored
Apr 01, 2013
by
Jesse Beder
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix conversion for C-strings (both literals and normal C-strings) so it compiles on Visual Studio.
parent
f5418306
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
1 deletions
+22
-1
include/yaml-cpp/node/convert.h
+15
-0
include/yaml-cpp/node/detail/impl.h
+6
-1
include/yaml-cpp/node/detail/node_data.h
+1
-0
No files found.
include/yaml-cpp/node/convert.h
View file @
5dbcf7ee
...
...
@@ -47,7 +47,22 @@ namespace YAML
}
};
// C-strings can only be encoded
template
<>
struct
convert
<
const
char
*>
{
static
Node
encode
(
const
char
*&
rhs
)
{
return
Node
(
rhs
);
}
};
template
<
std
::
size_t
N
>
struct
convert
<
const
char
[
N
]
>
{
static
Node
encode
(
const
char
(
&
rhs
)[
N
])
{
return
Node
(
rhs
);
}
};
template
<>
struct
convert
<
_Null
>
{
static
Node
encode
(
const
_Null
&
/* rhs */
)
{
return
Node
();
...
...
include/yaml-cpp/node/detail/impl.h
View file @
5dbcf7ee
...
...
@@ -149,7 +149,12 @@ namespace YAML
return
false
;
}
template
<
typename
T
>
inline
bool
node_data
::
equals
(
node
&
node
,
const
char
*
rhs
,
shared_memory_holder
pMemory
)
{
return
equals
<
std
::
string
>
(
node
,
rhs
,
pMemory
);
}
template
<
typename
T
>
inline
node
&
node_data
::
convert_to_node
(
const
T
&
rhs
,
shared_memory_holder
pMemory
)
{
Node
value
=
convert
<
T
>::
encode
(
rhs
);
...
...
include/yaml-cpp/node/detail/node_data.h
View file @
5dbcf7ee
...
...
@@ -77,6 +77,7 @@ namespace YAML
template
<
typename
T
>
static
bool
equals
(
node
&
node
,
const
T
&
rhs
,
shared_memory_holder
pMemory
);
static
bool
equals
(
node
&
node
,
const
char
*
rhs
,
shared_memory_holder
pMemory
);
template
<
typename
T
>
static
node
&
convert_to_node
(
const
T
&
rhs
,
shared_memory_holder
pMemory
);
...
...
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