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
pybind11
Commits
8f4eb006
Commit
8f4eb006
authored
Oct 15, 2015
by
Wenzel Jakob
Browse files
last breaking change: be consistent about the project name
parent
607654f7
Changes
23
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
18 deletions
+17
-18
include/pybind11/pytypes.h
include/pybind11/pytypes.h
+9
-9
include/pybind11/stl.h
include/pybind11/stl.h
+4
-4
include/pybind11/typeid.h
include/pybind11/typeid.h
+4
-5
No files found.
include/pybind/pytypes.h
→
include/pybind
11
/pytypes.h
View file @
8f4eb006
/*
pybind/typeid.h: Convenience wrapper classes for basic Python types
pybind
11
/typeid.h: Convenience wrapper classes for basic Python types
Copyright (c) 2015 Wenzel Jakob <wenzel@inf.ethz.ch>
...
...
@@ -9,10 +9,10 @@
#pragma once
#include
<pybind/
common.h
>
#include
"
common.h
"
#include <utility>
NAMESPACE_BEGIN
(
pybind
)
NAMESPACE_BEGIN
(
pybind
11
)
/* A few forward declarations */
class
object
;
...
...
@@ -37,7 +37,7 @@ public:
inline
detail
::
accessor
operator
[](
const
char
*
key
);
inline
detail
::
accessor
attr
(
handle
key
);
inline
detail
::
accessor
attr
(
const
char
*
key
);
inline
pybind
::
str
str
()
const
;
inline
pybind
11
::
str
str
()
const
;
template
<
typename
T
>
T
cast
();
template
<
typename
...
Args
>
object
call
(
Args
&&
...
args_
);
operator
bool
()
const
{
return
m_ptr
!=
nullptr
;
}
...
...
@@ -230,13 +230,13 @@ private:
#endif
};
inline
pybind
::
str
handle
::
str
()
const
{
inline
pybind
11
::
str
handle
::
str
()
const
{
PyObject
*
str
=
PyObject_Str
(
m_ptr
);
#if PY_MAJOR_VERSION < 3
PyObject
*
unicode
=
PyUnicode_FromEncodedObject
(
str
,
"utf-8"
,
nullptr
);
Py_XDECREF
(
str
);
str
=
unicode
;
#endif
return
pybind
::
str
(
str
,
false
);
return
pybind
11
::
str
(
str
,
false
);
}
class
bool_
:
public
object
{
...
...
@@ -370,12 +370,12 @@ inline internals &get_internals() {
if
(
internals_ptr
)
return
*
internals_ptr
;
handle
builtins
(
PyEval_GetBuiltins
());
capsule
caps
(
builtins
[
"__pybind__"
]);
capsule
caps
(
builtins
[
"__pybind
11
__"
]);
if
(
caps
.
check
())
{
internals_ptr
=
caps
;
}
else
{
internals_ptr
=
new
internals
();
builtins
[
"__pybind__"
]
=
capsule
(
internals_ptr
);
builtins
[
"__pybind
11
__"
]
=
capsule
(
internals_ptr
);
}
return
*
internals_ptr
;
}
...
...
@@ -413,4 +413,4 @@ inline handle get_type_handle(const std::type_info &tp) {
}
NAMESPACE_END
(
detail
)
NAMESPACE_END
(
pybind
)
NAMESPACE_END
(
pybind
11
)
include/pybind/stl.h
→
include/pybind
11
/stl.h
View file @
8f4eb006
/*
pybind/complex.h: Complex number support
pybind
11
/complex.h: Complex number support
Copyright (c) 2015 Wenzel Jakob <wenzel@inf.ethz.ch>
...
...
@@ -9,7 +9,7 @@
#pragma once
#include
<
pybind
/pybind
.h
>
#include
"
pybind
11
.h
"
#include <map>
#include <iostream>
...
...
@@ -19,7 +19,7 @@
#pragma warning(disable: 4127) // warning C4127: Conditional expression is constant
#endif
NAMESPACE_BEGIN
(
pybind
)
NAMESPACE_BEGIN
(
pybind
11
)
NAMESPACE_BEGIN
(
detail
)
template
<
typename
Value
>
struct
type_caster
<
std
::
vector
<
Value
>>
{
...
...
@@ -104,7 +104,7 @@ NAMESPACE_END(detail)
inline
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
const
object
&
obj
)
{
os
<<
(
const
char
*
)
obj
.
str
();
return
os
;
}
NAMESPACE_END
(
pybind
)
NAMESPACE_END
(
pybind
11
)
#if defined(_MSC_VER)
#pragma warning(pop)
...
...
include/pybind/typeid.h
→
include/pybind
11
/typeid.h
View file @
8f4eb006
/*
pybind/typeid.h: Compiler-independent access to type identifiers
pybind
11
/typeid.h: Compiler-independent access to type identifiers
Copyright (c) 2015 Wenzel Jakob <wenzel@inf.ethz.ch>
...
...
@@ -9,14 +9,13 @@
#pragma once
#include <pybind/typeid.h>
#include <cstdio>
#include <cstdlib>
#if defined(__GNUG__)
#include <cxxabi.h>
#endif
NAMESPACE_BEGIN
(
pybind
)
NAMESPACE_BEGIN
(
pybind
11
)
NAMESPACE_BEGIN
(
detail
)
/// Erase all occurrences of a substring
inline
void
erase_all
(
std
::
string
&
string
,
const
std
::
string
&
search
)
{
...
...
@@ -39,7 +38,7 @@ inline void clean_type_id(std::string &name) {
detail
::
erase_all
(
name
,
"struct "
);
detail
::
erase_all
(
name
,
"enum "
);
#endif
detail
::
erase_all
(
name
,
"pybind::"
);
detail
::
erase_all
(
name
,
"pybind
11
::"
);
}
NAMESPACE_END
(
detail
)
...
...
@@ -50,4 +49,4 @@ template <typename T> static std::string type_id() {
return
name
;
}
NAMESPACE_END
(
pybind
)
NAMESPACE_END
(
pybind
11
)
Prev
1
2
Next
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