~ubuntu-branches/ubuntu/edgy/swig1.3/edgy

« back to all changes in this revision

Viewing changes to Examples/test-suite/csharp_attributes.i

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad
  • Date: 2005-12-05 01:16:04 UTC
  • mfrom: (1.2.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051205011604-ygx904it6413k3go
Tags: 1.3.27-1ubuntu1
Resynchronise with Debian again, for the new subversion packages.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
%module csharp_attributes
 
2
 
 
3
// Test the inattributes and outattributes typemaps
 
4
%typemap(cstype, outattributes="[IntOut]", inattributes="[IntIn]") int "int"
 
5
%typemap(imtype, outattributes="[IntegerOut]", inattributes="[IntegerIn]") int "int"
 
6
 
 
7
%inline %{
 
8
class Stations {
 
9
public:
 
10
  Stations(int myInt) { }
 
11
  int Reading(int myInt) { return myInt; }
 
12
  static int Swindon(int myInt) { return myInt; }
 
13
};
 
14
#define TESTMACRO 10
 
15
int GlobalFunction(int myInt) { return myInt; }
 
16
%}
 
17
 
 
18
 
 
19
// Test the attributes feature
 
20
%csattributes MoreStations::MoreStations()      "[InterCity1]"
 
21
%csattributes MoreStations::Chippenham()        "[InterCity2]"
 
22
%csattributes MoreStations::Bath()              "[InterCity3]"
 
23
%csattributes Bristol                           "[InterCity4]"
 
24
%csattributes WestonSuperMare                   "[InterCity5]"
 
25
%csattributes Wales                             "[InterCity6]"
 
26
%csattributes Paddington()                      "[InterCity7]"
 
27
%csattributes DidcotParkway                     "[InterCity8]"
 
28
 
 
29
%typemap(csattributes) MoreStations "[Eurostar1]"
 
30
%typemap(csattributes) MoreStations::Wales "[Eurostar2]"
 
31
%typemap(csattributes) Cymru "[Eurostar3]"
 
32
 
 
33
%inline %{
 
34
struct MoreStations {
 
35
  MoreStations() : Bristol(0) {}
 
36
  void Chippenham() {}
 
37
  static void Bath() {}
 
38
  int Bristol;
 
39
  static double WestonSuperMare;
 
40
  enum Wales { Cardiff = 1, Swansea };
 
41
};
 
42
void Paddington() {}
 
43
float DidcotParkway;
 
44
enum Cymru { Llanelli };
 
45
 
 
46
double MoreStations::WestonSuperMare = 0.0;
 
47
%}
 
48