Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Gwenaël Samain
cython
Commits
a1c310b8
Commit
a1c310b8
authored
Sep 20, 2016
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Generate dedicated conversions for extern typedef c++ strings.
parent
05cbb319
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
0 deletions
+22
-0
Cython/Compiler/PyrexTypes.py
Cython/Compiler/PyrexTypes.py
+22
-0
No files found.
Cython/Compiler/PyrexTypes.py
View file @
a1c310b8
...
...
@@ -429,6 +429,17 @@ class CTypedefType(BaseType):
elif
base_type
.
is_complex
:
pass
# XXX implement!
pass
elif
base_type
.
is_cpp_string
:
cname
=
"__pyx_convert_PyObject_string_to_py_%s"
%
type_identifier
(
self
)
context
=
{
'cname'
:
cname
,
'type'
:
self
.
typedef_cname
,
}
from
.UtilityCode
import
CythonUtilityCode
env
.
use_utility_code
(
CythonUtilityCode
.
load
(
"string.to_py"
,
"CppConvert.pyx"
,
context
=
context
))
self
.
to_py_function
=
cname
return
True
if
self
.
to_py_utility_code
:
env
.
use_utility_code
(
self
.
to_py_utility_code
)
return
True
...
...
@@ -450,6 +461,17 @@ class CTypedefType(BaseType):
pass
# XXX implement!
elif
base_type
.
is_complex
:
pass
# XXX implement!
elif
base_type
.
is_cpp_string
:
cname
=
'__pyx_convert_string_from_py_%s'
%
type_identifier
(
self
)
context
=
{
'cname'
:
cname
,
'type'
:
self
.
typedef_cname
,
}
from
.UtilityCode
import
CythonUtilityCode
env
.
use_utility_code
(
CythonUtilityCode
.
load
(
"string.from_py"
,
"CppConvert.pyx"
,
context
=
context
))
self
.
from_py_function
=
cname
return
True
if
self
.
from_py_utility_code
:
env
.
use_utility_code
(
self
.
from_py_utility_code
)
return
True
...
...
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