aboutsummaryrefslogtreecommitdiff
path: root/Examples/test-suite/rename_camel.i
blob: 466f179f7f691ef2edbee38161175ad3be35f116 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
%module rename_camel

%rename("%(utitle)s",%$isfunction,%$ismember) ""; 
%rename("%(ctitle)s",%$isvariable,%$ismember) ""; 

%inline {
  struct GeometryFactory {
    void createPointFromInternalCoord(int) {}
    void BIG_METHOD(int) {}
  };  

  class ByteOrderValues {
    
  public:
    void readHEX() {}
    static int ENDIAN_BIG;
  };
  
  int ByteOrderValues::ENDIAN_BIG = 4321;
}

%rename(CamelCase1) camel_case_1;
%rename("%(camelcase)s") camel_case_2;
// ctitle is an alias for camelcase.
%rename("%(ctitle)s") camel_case_3;

%rename(lowerCamelCase1) Lower_camel_case_1;
%rename("%(lowercamelcase)s") Lower_camel_case_2;
// lctitle is an alias for lowercamelcase.
%rename("%(lctitle)s") Lower_camel_case_3;

%rename(under_case1) UnderCase1;
%rename("%(undercase)s") UnderCase2;
// utitle is an alias for undercase.
%rename("%(utitle)s") UnderCase3;

// This should change "import" to "Import", but "hi_there" should be handled by
// the rule below and become "HI_THERE".
%rename("%(regex:/(.*i.*)/\\u\\1/)s") "";

%rename("%(upper)s",regexmatch$parentNode$type="enum .*") "";

%inline 
{
  void CamelCase(int) {}
  void camel_case_1(int) {}
  void camel_case_2(int) {}
  void camel_case_3(int) {}

  void under_case(int) {}
  void UnderCase1(int) {}
  void UnderCase2(int) {}
  void UnderCase3(int) {}

  void lowerCamelCase(int) {}
  void Lower_camel_case_1(int) {}
  void Lower_camel_case_2(int) {}
  void Lower_camel_case_3(int) {}

  enum HelloEnum {
    hello, hi_there
  };

  enum ChaoEnum {
    bye, see_you
  };

  void import(int) {}
  void foo(int) {}
}

%rename("%(lowercase)s",sourcefmt="%(regex:/GSL_(.*)/\\1/)s",%$isfunction) "";
%inline {
  void GSL_Hello() {}
}