PageRenderTime 40ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

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

#
Swig | 35 lines | 24 code | 10 blank | 1 comment | 0 complexity | 50de0e49f6d78b26e27c0c0d7edfd284 MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
  1. /* Test %apply for char */
  2. %module(directors="1") apply_signed_char
  3. %warnfilter(SWIGWARN_TYPEMAP_THREAD_UNSAFE,SWIGWARN_TYPEMAP_DIRECTOROUT_PTR) DirectorTest;
  4. %apply signed char {char, const char};
  5. %apply const signed char & {const char &};
  6. %inline %{
  7. char CharValFunction(char number) { return number; }
  8. const char CCharValFunction(const char number) { return number; }
  9. const char & CCharRefFunction(const char & number) { return number; }
  10. char globalchar = -109;
  11. const char globalconstchar = -110;
  12. %}
  13. // Director test
  14. %feature("director");
  15. %inline %{
  16. struct DirectorTest {
  17. DirectorTest() : memberchar(-111), memberconstchar(-112) {}
  18. virtual char CharValFunction(char number) { return number; }
  19. virtual const char CCharValFunction(const char number) { return number; }
  20. virtual const char & CCharRefFunction(const char & number) { return number; }
  21. char memberchar;
  22. const char memberconstchar;
  23. virtual ~DirectorTest() {}
  24. };
  25. %}