View previous topic :: View next topic |
Author |
Message |
keinfarbton
Joined: 03 Dec 2005 Posts: 224 Location: Stuttgart - Germany
|
Posted: Sat Apr 28, 2007 7:52 pm Post subject: News: Helper methods for Strings and arrays |
|
|
To make life easier, the generated sources now contain helper methods, that do call convertions function.
Every public method, which has a string or array argument or return type, will produce such a helper method. The helper methods name starts with "dh_". This should be the abreviation for "D Helper".
Some use of this is made in the wizard example. |
|
Back to top |
|
|
bobef
Joined: 05 Jun 2005 Posts: 269
|
Posted: Fri May 04, 2007 2:50 am Post subject: |
|
|
Is it possible to make the original method called jh_ like "Java helper" and our (D users) one to be called with it's normal name.
Like:
setText(char[])
jh_setText(String)
I guess then all other generated code will have to call the jh_ version, so I don't know if it is an easy task, but I have to ask |
|
Back to top |
|
|
keinfarbton
Joined: 03 Dec 2005 Posts: 224 Location: Stuttgart - Germany
|
Posted: Fri May 04, 2007 3:13 am Post subject: |
|
|
I will give it a try. |
|
Back to top |
|
|
keinfarbton
Joined: 03 Dec 2005 Posts: 224 Location: Stuttgart - Germany
|
Posted: Sat May 05, 2007 1:57 pm Post subject: |
|
|
Hm, i don't like to change the original methods. The reason is, because D arrays are not the same as the Java variants are. I want them to be explicit named, showing that they are only wrappers around the original.
in D
Code: | setText( "" );
setText( null ); |
are equal. In Java they aren't. |
|
Back to top |
|
|
bobef
Joined: 05 Jun 2005 Posts: 269
|
Posted: Sat May 05, 2007 3:27 pm Post subject: |
|
|
Blah. I wish we had a nice overloadable global cast operator like in C++.
Something like:
Code: | String opCast(char[] a)
{return String.fromChar(a);} |
Then (almost) none of that would be necessary.... |
|
Back to top |
|
|
|