PageRenderTime 36ms CodeModel.GetById 31ms app.highlight 1ms RepoModel.GetById 2ms app.codeStats 0ms

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

#
Swig | 21 lines | 16 code | 5 blank | 0 comment | 0 complexity | f74f3f5910b155506bb32edf9e3c5e5c MD5 | raw file
 1%module operator_pointer_ref
 2
 3%rename(AsCharStarRef) operator char*&;
 4
 5%inline %{
 6class MyClass {
 7public:
 8    MyClass (const char *s_ = "")
 9	: s(strdup(s_ ? s_ : ""))
10    { }
11
12    ~MyClass () 
13    { free(s); }
14
15    operator char*&()
16    { return s; }
17
18private:
19    char *s;
20};
21%}