/tags/rel-1-3-25/SWIG/Examples/test-suite/namespace_extend.i

# · Swig · 34 lines · 28 code · 6 blank · 0 comment · 0 complexity · 25ee9edde1db2302ffa5f1291d18b23c MD5 · raw file

  1. %module namespace_extend
  2. %warnfilter(801) bar; /* Ruby, wrong class name */
  3. %{
  4. namespace foo {
  5. class bar {
  6. public:
  7. };
  8. }
  9. foo::bar *new_foo_bar() {
  10. return new foo::bar;
  11. }
  12. void delete_foo_bar(foo::bar *self) {
  13. delete self;
  14. }
  15. int foo_bar_blah(foo::bar *self, int x) {
  16. return x;
  17. }
  18. %}
  19. namespace foo {
  20. class bar {
  21. public:
  22. %extend {
  23. bar();
  24. ~bar();
  25. int blah(int x);
  26. };
  27. };
  28. }