PageRenderTime 42ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 1ms

/tags/rel-1.3.35/Examples/test-suite/namespace_extend.i

#
Swig | 34 lines | 28 code | 6 blank | 0 comment | 0 complexity | 73d4c6d9384ddd4a44c14ee379074848 MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
  1. %module namespace_extend
  2. %warnfilter(SWIGWARN_RUBY_WRONG_NAME) 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. }