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