Commit 8f4eb006 authored by Wenzel Jakob's avatar Wenzel Jakob
Browse files

last breaking change: be consistent about the project name

parent 607654f7
/* /*
pybind/typeid.h: Convenience wrapper classes for basic Python types pybind11/typeid.h: Convenience wrapper classes for basic Python types
Copyright (c) 2015 Wenzel Jakob <wenzel@inf.ethz.ch> Copyright (c) 2015 Wenzel Jakob <wenzel@inf.ethz.ch>
...@@ -9,10 +9,10 @@ ...@@ -9,10 +9,10 @@
#pragma once #pragma once
#include <pybind/common.h> #include "common.h"
#include <utility> #include <utility>
NAMESPACE_BEGIN(pybind) NAMESPACE_BEGIN(pybind11)
/* A few forward declarations */ /* A few forward declarations */
class object; class object;
...@@ -37,7 +37,7 @@ public: ...@@ -37,7 +37,7 @@ public:
inline detail::accessor operator[](const char *key); inline detail::accessor operator[](const char *key);
inline detail::accessor attr(handle key); inline detail::accessor attr(handle key);
inline detail::accessor attr(const char *key); inline detail::accessor attr(const char *key);
inline pybind::str str() const; inline pybind11::str str() const;
template <typename T> T cast(); template <typename T> T cast();
template <typename ... Args> object call(Args&&... args_); template <typename ... Args> object call(Args&&... args_);
operator bool() const { return m_ptr != nullptr; } operator bool() const { return m_ptr != nullptr; }
...@@ -230,13 +230,13 @@ private: ...@@ -230,13 +230,13 @@ private:
#endif #endif
}; };
inline pybind::str handle::str() const { inline pybind11::str handle::str() const {
PyObject *str = PyObject_Str(m_ptr); PyObject *str = PyObject_Str(m_ptr);
#if PY_MAJOR_VERSION < 3 #if PY_MAJOR_VERSION < 3
PyObject *unicode = PyUnicode_FromEncodedObject(str, "utf-8", nullptr); PyObject *unicode = PyUnicode_FromEncodedObject(str, "utf-8", nullptr);
Py_XDECREF(str); str = unicode; Py_XDECREF(str); str = unicode;
#endif #endif
return pybind::str(str, false); return pybind11::str(str, false);
} }
class bool_ : public object { class bool_ : public object {
...@@ -370,12 +370,12 @@ inline internals &get_internals() { ...@@ -370,12 +370,12 @@ inline internals &get_internals() {
if (internals_ptr) if (internals_ptr)
return *internals_ptr; return *internals_ptr;
handle builtins(PyEval_GetBuiltins()); handle builtins(PyEval_GetBuiltins());
capsule caps(builtins["__pybind__"]); capsule caps(builtins["__pybind11__"]);
if (caps.check()) { if (caps.check()) {
internals_ptr = caps; internals_ptr = caps;
} else { } else {
internals_ptr = new internals(); internals_ptr = new internals();
builtins["__pybind__"] = capsule(internals_ptr); builtins["__pybind11__"] = capsule(internals_ptr);
} }
return *internals_ptr; return *internals_ptr;
} }
...@@ -413,4 +413,4 @@ inline handle get_type_handle(const std::type_info &tp) { ...@@ -413,4 +413,4 @@ inline handle get_type_handle(const std::type_info &tp) {
} }
NAMESPACE_END(detail) NAMESPACE_END(detail)
NAMESPACE_END(pybind) NAMESPACE_END(pybind11)
/* /*
pybind/complex.h: Complex number support pybind11/complex.h: Complex number support
Copyright (c) 2015 Wenzel Jakob <wenzel@inf.ethz.ch> Copyright (c) 2015 Wenzel Jakob <wenzel@inf.ethz.ch>
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
#pragma once #pragma once
#include <pybind/pybind.h> #include "pybind11.h"
#include <map> #include <map>
#include <iostream> #include <iostream>
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
#pragma warning(disable: 4127) // warning C4127: Conditional expression is constant #pragma warning(disable: 4127) // warning C4127: Conditional expression is constant
#endif #endif
NAMESPACE_BEGIN(pybind) NAMESPACE_BEGIN(pybind11)
NAMESPACE_BEGIN(detail) NAMESPACE_BEGIN(detail)
template <typename Value> struct type_caster<std::vector<Value>> { template <typename Value> struct type_caster<std::vector<Value>> {
...@@ -104,7 +104,7 @@ NAMESPACE_END(detail) ...@@ -104,7 +104,7 @@ NAMESPACE_END(detail)
inline std::ostream &operator<<(std::ostream &os, const object &obj) { os << (const char *) obj.str(); return os; } inline std::ostream &operator<<(std::ostream &os, const object &obj) { os << (const char *) obj.str(); return os; }
NAMESPACE_END(pybind) NAMESPACE_END(pybind11)
#if defined(_MSC_VER) #if defined(_MSC_VER)
#pragma warning(pop) #pragma warning(pop)
......
/* /*
pybind/typeid.h: Compiler-independent access to type identifiers pybind11/typeid.h: Compiler-independent access to type identifiers
Copyright (c) 2015 Wenzel Jakob <wenzel@inf.ethz.ch> Copyright (c) 2015 Wenzel Jakob <wenzel@inf.ethz.ch>
...@@ -9,14 +9,13 @@ ...@@ -9,14 +9,13 @@
#pragma once #pragma once
#include <pybind/typeid.h>
#include <cstdio> #include <cstdio>
#include <cstdlib> #include <cstdlib>
#if defined(__GNUG__) #if defined(__GNUG__)
#include <cxxabi.h> #include <cxxabi.h>
#endif #endif
NAMESPACE_BEGIN(pybind) NAMESPACE_BEGIN(pybind11)
NAMESPACE_BEGIN(detail) NAMESPACE_BEGIN(detail)
/// Erase all occurrences of a substring /// Erase all occurrences of a substring
inline void erase_all(std::string &string, const std::string &search) { inline void erase_all(std::string &string, const std::string &search) {
...@@ -39,7 +38,7 @@ inline void clean_type_id(std::string &name) { ...@@ -39,7 +38,7 @@ inline void clean_type_id(std::string &name) {
detail::erase_all(name, "struct "); detail::erase_all(name, "struct ");
detail::erase_all(name, "enum "); detail::erase_all(name, "enum ");
#endif #endif
detail::erase_all(name, "pybind::"); detail::erase_all(name, "pybind11::");
} }
NAMESPACE_END(detail) NAMESPACE_END(detail)
...@@ -50,4 +49,4 @@ template <typename T> static std::string type_id() { ...@@ -50,4 +49,4 @@ template <typename T> static std::string type_id() {
return name; return name;
} }
NAMESPACE_END(pybind) NAMESPACE_END(pybind11)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment