PageRenderTime 36ms CodeModel.GetById 11ms RepoModel.GetById 1ms app.codeStats 0ms

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

#
Swig | 31 lines | 21 code | 10 blank | 0 comment | 0 complexity | ad631f953d0196108e49f5dd0a449204 MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
  1. %module rename_pcre_encoder
  2. // strip the wx prefix from all identifiers except those starting with wxEVT
  3. %rename("%(regex:/wx(?!EVT)(.*)/\\1/)s") "";
  4. // Replace "Set" and "Get" prefixes with "put" and "get" respectively.
  5. %rename("%(regex:/^Set(.*)/put\\1/)s", %$isfunction) "";
  6. %rename("%(regex:/^Get(.*)/get\\1/)s", %$isfunction) "";
  7. %inline %{
  8. struct wxSomeWidget {
  9. void SetBorderWidth(int width) { m_width = width; }
  10. int GetBorderWidth() const { return m_width; }
  11. void SetSize(int, int) {}
  12. int m_width;
  13. };
  14. struct wxAnotherWidget {
  15. void DoSomething() {}
  16. };
  17. class wxEVTSomeEvent {
  18. };
  19. class xUnchangedName {
  20. };
  21. %}