3737#include < boost/python/copy_const_reference.hpp>
3838
3939#include < string>
40+ #include < sstream>
4041#include < map>
4142
4243#include < ObjCryst/RefinableObj/RefinableObj.h>
@@ -404,6 +405,15 @@ void _XMLInput(
404405 in.sync ();
405406}
406407
408+ void _XMLInputString (RefinableObj& r, const string& s)
409+ {
410+ stringstream ss (s);
411+ ss.imbue (std::locale::classic ());
412+ XMLCrystTag tag;
413+ ss>>tag;
414+ r.XMLInput (ss, tag);
415+ }
416+
407417} // anonymous namespace
408418
409419
@@ -555,6 +565,7 @@ void wrap_refinableobj()
555565 .def (" XMLInput" , &_XMLInput, (bp::arg (" file" ), bp::arg (" tag" )))
556566 .def (" XMLInput" , &RefinableObj::XMLInput,
557567 &RefinableObjWrap::default_XMLInput)
568+ .def (" XMLInput" , &_XMLInputString, (bp::arg (" xml" )))
558569 .def (" GetGeneGroup" , &RefinableObj::GetGeneGroup,
559570 &RefinableObjWrap::default_GetGeneGroup)
560571 .def (" UpdateDisplay" , &RefinableObj::UpdateDisplay,
@@ -563,6 +574,7 @@ void wrap_refinableobj()
563574 &RefinableObjWrap::default_GetRestraintCost)
564575 .def (" TagNewBestConfig" , &RefinableObj::TagNewBestConfig,
565576 &RefinableObjWrap::default_TagNewBestConfig)
577+ .def (" int_ptr" , &RefinableObj::int_ptr)
566578 // Additional methods for python only
567579 .def (" __str__" , &__str__<RefinableObj>)
568580 ;
0 commit comments