PageRenderTime 50ms CodeModel.GetById 14ms RepoModel.GetById 1ms app.codeStats 0ms

/trunk/Examples/test-suite/li_std_stream.i

#
Swig | 65 lines | 48 code | 17 blank | 0 comment | 0 complexity | 168cb9061ae53c5bb0ac0a4eac10cd0c MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
  1. %module li_std_stream
  2. %{
  3. #if defined(__SUNPRO_CC)
  4. #pragma error_messages (off, badargtype2w) /* Formal argument ... is being passed extern "C" ... */
  5. #endif
  6. %}
  7. %inline %{
  8. struct A;
  9. %}
  10. %include <std_iostream.i>
  11. %include <std_sstream.i>
  12. %callback(1) A::bar;
  13. %inline %{
  14. struct B {
  15. virtual ~B()
  16. {
  17. }
  18. };
  19. struct A : B
  20. {
  21. void __add__(int a)
  22. {
  23. }
  24. void __add__(double a)
  25. {
  26. }
  27. static int bar(int a){
  28. return a;
  29. }
  30. static int foo(int a, int (*pf)(int a))
  31. {
  32. return pf(a);
  33. }
  34. std::ostream& __rlshift__(std::ostream& out)
  35. {
  36. out << "A class";
  37. return out;
  38. }
  39. };
  40. %}
  41. %extend std::basic_ostream<char>{
  42. std::basic_ostream<char>&
  43. operator<<(const A& a)
  44. {
  45. *self << "A class";
  46. return *self;
  47. }
  48. }