Mercurial > hg > vampy
comparison PyTypeConversions.cpp @ 73:76355b91cd92 vampyhost
Add vector<string> -> Python converter
author | Chris Cannam |
---|---|
date | Mon, 24 Nov 2014 11:02:20 +0000 |
parents | 40a01bb24209 |
children | e7d03f88ef43 |
comparison
equal
deleted
inserted
replaced
72:ffaa1fb3d7de | 73:76355b91cd92 |
---|---|
739 return Output; | 739 return Output; |
740 } | 740 } |
741 } | 741 } |
742 #endif | 742 #endif |
743 | 743 |
744 PyObject * | |
745 PyTypeConversions::PyValue_From_StringVector(const std::vector<std::string> &v) const | |
746 { | |
747 PyObject *pyList = PyList_New(v.size()); | |
748 for (size_t i = 0; i < v.size(); ++i) { | |
749 PyObject *pyStr = PyString_FromString(v[i].c_str()); | |
750 PyList_SET_ITEM(pyList, i, pyStr); | |
751 } | |
752 return pyList; | |
753 } | |
744 | 754 |
745 | 755 |
746 /* Error handling */ | 756 /* Error handling */ |
747 | 757 |
748 void | 758 void |