From a382d906efda9b096c4e841ebcff83be85fa3e5c Mon Sep 17 00:00:00 2001 From: David Shah Date: Tue, 3 Jul 2018 10:55:32 +0200 Subject: python: Developing context wrappers for maps Signed-off-by: David Shah --- common/pybindings.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'common/pybindings.h') diff --git a/common/pybindings.h b/common/pybindings.h index 852fb21f..c4d84442 100644 --- a/common/pybindings.h +++ b/common/pybindings.h @@ -72,6 +72,13 @@ template <> struct string_converter inline std::string to_str(Context *ctx, IdString id) { return id.str(ctx); } }; +template <> struct string_converter +{ + inline IdString from_str(Context *ctx, std::string name) { return ctx->id(name); } + + inline std::string to_str(Context *ctx, IdString id) { return id.str(ctx); } +}; + } // namespace PythonConversion NEXTPNR_NAMESPACE_END -- cgit v1.2.3