From e08504e250b71b19be5b4add84a69bdd6d444b81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lien=20Sell=C3=A6g?= Date: Thu, 18 Apr 2019 15:26:20 +0200 Subject: [PATCH] bind cppreference --- src/documentation.cpp | 5 +++++ src/documentation.hpp | 2 ++ 2 files changed, 7 insertions(+) diff --git a/src/documentation.cpp b/src/documentation.cpp index 808e3f2..27fea53 100644 --- a/src/documentation.cpp +++ b/src/documentation.cpp @@ -12711,3 +12711,8 @@ std::experimental::filesystem::status_known cpp/experimental/fs/status_known return std::string(); return "http://en.cppreference.com/w/" + it->second; } + +void Documentation::CppReference::init_module(py::module &api) { + py::class_(api, "CppReference") + .def("get_url", &CppReference::get_url); +} diff --git a/src/documentation.hpp b/src/documentation.hpp index ceec3a2..078aa3f 100644 --- a/src/documentation.hpp +++ b/src/documentation.hpp @@ -1,4 +1,5 @@ #pragma once +#include "python_bind.h" #include #include @@ -7,5 +8,6 @@ namespace Documentation { public: static std::vector get_headers(const std::string &symbol) noexcept; static std::string get_url(const std::string &symbol) noexcept; + static void init_module(py::module &api); }; } // namespace Documentation