| 2 | #include <string> |
| 3 | |
| 4 | class Example { |
| 5 | public: |
| 6 | Example() |
| 7 | {} |
| 8 | |
| 9 | void doit() { mS = "void"; } |
| 10 | std::string doit(unsigned int i) |
| 11 | { |
| 12 | std::stringstream s; |
| 13 | s << i; |
| 14 | mS = s.str(); |
| 15 | return mS; |
| 16 | } |
| 17 | void doit(std::string s) { mS = s; } |
| 18 | |
| 19 | int makeIt(std::string s, int n=1, std::string t="") |
| 20 | { |
| 21 | std::stringstream u; |
| 22 | for (unsigned int i=0; i<n; ++i) |
| 23 | u << s; |
| 24 | mS = u.str() + t; |
| 25 | return n + ( t.size() > 0 ? 1 : 0 ); |
| 26 | } |
| 27 | |
| 28 | std::string print() const { return mS; } |
| 29 | private: |
| 30 | std::string mS; |
| 31 | }; |
| 32 | |
| 33 | #include <boost/python.hpp> |
| 34 | using namespace boost::python; |