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

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

#
Swig | 107 lines | 65 code | 30 blank | 12 comment | 0 complexity | 8c7fce58e2b51304bf878ce89210bc21 MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
  1. %module ruby_naming
  2. %predicate predicateMethod();
  3. %bang bangMethod();
  4. /* This gets mapped to a constant */
  5. %constant int constant1 = 1;
  6. /* This gets mapped to a constant */
  7. #define constant2 2
  8. %immutable TestConstants::constant8;
  9. %inline %{
  10. /* ============ Test Constants Names ============== */
  11. /* This gets mapped to a constant */
  12. #define constant3 3
  13. /* These are all singleton methods */
  14. const int constant4[2] = {10, 20};
  15. const int constant5 = 5;
  16. static const int constant6 = 6;
  17. class TestConstants {
  18. public:
  19. TestConstants() : constant7(7) {}
  20. /* This gets mapped to a method */
  21. const int constant7;
  22. /* This gets mapped to a singleton method, but this is not legal C++ */
  23. static const int constant8;
  24. /* This gets mapped to a method, but this it not legal C++ */
  25. /*const int constant9 = 9;*/
  26. /* This gets mapped to a constant */
  27. static const int constant10 = 10;
  28. };
  29. const int TestConstants::constant8 = 8;
  30. const TestConstants * constant11[5];
  31. /* ============ Test Enum ============== */
  32. typedef enum {Red, Green, Blue} Colors;
  33. /* ============ Test Method Names ============== */
  34. class my_class {
  35. public:
  36. int methodOne()
  37. {
  38. return 1;
  39. }
  40. int MethodTwo()
  41. {
  42. return 2;
  43. }
  44. int Method_THREE()
  45. {
  46. return 3;
  47. }
  48. int Method44_4()
  49. {
  50. return 4;
  51. }
  52. bool predicateMethod()
  53. {
  54. return true;
  55. }
  56. bool bangMethod()
  57. {
  58. return true;
  59. }
  60. int begin()
  61. {
  62. return 1;
  63. }
  64. int end()
  65. {
  66. return 1;
  67. }
  68. };
  69. %}
  70. %inline
  71. {
  72. template <class _Type>
  73. struct A
  74. {
  75. };
  76. }
  77. %template(A_i) A<int>;