diff options
author | David Shah <davey1576@gmail.com> | 2018-07-03 10:55:32 +0200 |
---|---|---|
committer | David Shah <davey1576@gmail.com> | 2018-07-04 14:55:24 +0200 |
commit | a382d906efda9b096c4e841ebcff83be85fa3e5c (patch) | |
tree | e84d6ef57da7e8cf5119bbb8043833574629115e /common/pybindings.h | |
parent | 45ec502dedf1503fa0117c6eef4a765e4c736315 (diff) | |
download | nextpnr-a382d906efda9b096c4e841ebcff83be85fa3e5c.tar.gz nextpnr-a382d906efda9b096c4e841ebcff83be85fa3e5c.tar.bz2 nextpnr-a382d906efda9b096c4e841ebcff83be85fa3e5c.zip |
python: Developing context wrappers for maps
Signed-off-by: David Shah <davey1576@gmail.com>
Diffstat (limited to 'common/pybindings.h')
-rw-r--r-- | common/pybindings.h | 7 |
1 files changed, 7 insertions, 0 deletions
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<IdString> inline std::string to_str(Context *ctx, IdString id) { return id.str(ctx); } }; +template <> struct string_converter<const IdString> +{ + 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 |