Changeset 120 for trunk/infrastructure/pyd/class_wrap.d
- Timestamp:
- 07/26/07 20:06:38 (1 year ago)
- Files:
-
- trunk/infrastructure/pyd/class_wrap.d (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/infrastructure/pyd/class_wrap.d
r118 r120 276 276 mixin _Def!(fn, symbolnameof!(fn), typeof(&fn), ""); 277 277 } 278 struct Def(alias fn, char[]docstring) {278 struct Def(alias fn, string docstring) { 279 279 mixin _Def!(fn, /*symbolnameof!(fn),*/ symbolnameof!(fn), typeof(&fn)/+, minArgs!(fn)+/, docstring); 280 280 } 281 struct Def(alias fn, char[] name, char[]docstring) {281 struct Def(alias fn, string name, string docstring) { 282 282 mixin _Def!(fn, /*symbolnameof!(fn),*/ name, typeof(&fn)/+, minArgs!(fn)+/, docstring); 283 283 } 284 struct Def(alias fn, char[]name, fn_t) {284 struct Def(alias fn, string name, fn_t) { 285 285 mixin _Def!(fn, /*symbolnameof!(fn),*/ name, fn_t/+, minArgs!(fn)+/, ""); 286 286 } … … 288 288 mixin _Def!(fn, /*symbolnameof!(fn),*/ symbolnameof!(fn), fn_t/+, minArgs!(fn)+/, ""); 289 289 } 290 struct Def(alias fn, fn_t, char[]docstring) {290 struct Def(alias fn, fn_t, string docstring) { 291 291 mixin _Def!(fn, /*symbolnameof!(fn),*/ symbolnameof!(fn), fn_t/+, minArgs!(fn)+/, docstring); 292 292 } 293 struct Def(alias fn, char[] name, fn_t, char[]docstring) {293 struct Def(alias fn, string name, fn_t, string docstring) { 294 294 mixin _Def!(fn, /*symbolnameof!(fn),*/ name, fn_t/+, minArgs!(fn)+/, docstring); 295 295 } 296 296 /+ 297 template Def(alias fn, char[] name, fn_t, uint MIN_ARGS=minArgs!(fn)/+, char[]docstring=""+/) {297 template Def(alias fn, string name, fn_t, uint MIN_ARGS=minArgs!(fn)/+, string docstring=""+/) { 298 298 alias Def!(fn, /*symbolnameof!(fn),*/ name, fn_t, MIN_ARGS/+, docstring+/) Def; 299 299 } 300 300 +/ 301 template _Def(alias fn, /* char[] _realname,*/ char[] name, fn_t/+, uint MIN_ARGS=minArgs!(fn)+/, char[]docstring) {301 template _Def(alias fn, /*string _realname,*/ string name, fn_t/+, uint MIN_ARGS=minArgs!(fn)+/, string docstring) { 302 302 //static const type = ParamType.Def; 303 303 alias fn func; … … 336 336 mixin _StaticDef!(fn,/+ symbolnameof!(fn),+/ symbolnameof!(fn), typeof(&fn), minArgs!(fn), ""); 337 337 } 338 struct StaticDef(alias fn, char[]docstring) {338 struct StaticDef(alias fn, string docstring) { 339 339 mixin _StaticDef!(fn,/+ symbolnameof!(fn),+/ symbolnameof!(fn), typeof(&fn), minArgs!(fn), docstring); 340 340 } 341 struct StaticDef(alias _fn, char[] name, char[]docstring) {341 struct StaticDef(alias _fn, string name, string docstring) { 342 342 mixin _StaticDef!(fn,/+ symbolnameof!(fn),+/ name, typeof(&fn), minArgs!(fn), docstring); 343 343 } 344 struct StaticDef(alias _fn, char[] name, fn_t, char[]docstring) {344 struct StaticDef(alias _fn, string name, fn_t, string docstring) { 345 345 mixin _StaticDef!(fn,/+ symbolnameof!(fn),+/ name, fn_t, minArgs!(fn), docstring); 346 346 } … … 348 348 mixin _StaticDef!(fn,/+ symbolnameof!(fn),+/ symbolnameof!(fn), fn_t, minArgs!(fn), ""); 349 349 } 350 struct StaticDef(alias _fn, fn_t, char[]docstring) {350 struct StaticDef(alias _fn, fn_t, string docstring) { 351 351 mixin _StaticDef!(fn,/+ symbolnameof!(fn),+/ symbolnameof!(fn), fn_t, minArgs!(fn), docstring); 352 352 } 353 struct StaticDef(alias _fn, char[]name, fn_t) {353 struct StaticDef(alias _fn, string name, fn_t) { 354 354 mixin _StaticDef!(fn,/+ symbolnameof!(fn),+/ name, fn_t, minArgs!(fn), ""); 355 355 } 356 struct StaticDef(alias _fn, char[]name, fn_t, uint MIN_ARGS) {356 struct StaticDef(alias _fn, string name, fn_t, uint MIN_ARGS) { 357 357 mixin _StaticDef!(fn,/+ symbolnameof!(fn),+/ name, fn_t, MIN_ARGS, ""); 358 358 } 359 struct StaticDef(alias _fn, char[] name, fn_t, uint MIN_ARGS, char[]docstring) {359 struct StaticDef(alias _fn, string name, fn_t, uint MIN_ARGS, string docstring) { 360 360 mixin _StaticDef!(fn,/+ symbolnameof!(fn),+/ name, fn_t, MIN_ARGS, docstring); 361 361 } 362 template _StaticDef(alias fn,/+ char[] _realname,+/ char[] name, fn_t, uint MIN_ARGS, char[]docstring) {362 template _StaticDef(alias fn,/+ string _realname,+/ string name, fn_t, uint MIN_ARGS, string docstring) { 363 363 //static const type = ParamType.StaticDef; 364 364 alias fn func; … … 397 397 mixin _Property!(fn, symbolnameof!(fn), symbolnameof!(fn), false, ""); 398 398 } 399 struct Property(alias fn, char[]docstring) {399 struct Property(alias fn, string docstring) { 400 400 mixin _Property!(fn, symbolnameof!(fn), symbolnameof!(fn), false, docstring); 401 401 } 402 struct Property(alias fn, char[] name, char[]docstring) {402 struct Property(alias fn, string name, string docstring) { 403 403 mixin _Property!(fn, symbolnameof!(fn), name, false, docstring); 404 404 } 405 struct Property(alias fn, char[]name, bool RO) {405 struct Property(alias fn, string name, bool RO) { 406 406 mixin _Property!(fn, symbolnameof!(fn), name, RO, ""); 407 407 } 408 struct Property(alias fn, char[] name, bool RO, char[]docstring) {408 struct Property(alias fn, string name, bool RO, string docstring) { 409 409 mixin _Property!(fn, symbolnameof!(fn), name, RO, docstring); 410 410 } … … 412 412 mixin _Property!(fn, symbolnameof!(fn), symbolnameof!(fn), RO, ""); 413 413 } 414 struct Property(alias fn, bool RO, char[]docstring) {414 struct Property(alias fn, bool RO, string docstring) { 415 415 mixin _Property!(fn, symbolnameof!(fn), symbolnameof!(fn), RO, docstring); 416 416 } 417 template _Property(alias fn, char[] _realname, char[] name, bool RO, char[]docstring) {417 template _Property(alias fn, string _realname, string name, bool RO, string docstring) { 418 418 alias property_parts!(fn).getter_type get_t; 419 419 alias property_parts!(fn).setter_type set_t; … … 545 545 iterator. 546 546 */ 547 struct AltIter(alias fn, char[]name = symbolnameof!(fn), iter_t = ParameterTypeTuple!(fn)[0]) {547 struct AltIter(alias fn, string name = symbolnameof!(fn), iter_t = ParameterTypeTuple!(fn)[0]) { 548 548 static const bool needs_shim = false; 549 549 static void call(T) () { … … 564 564 } /*Pyd_with_StackThreads*/ 565 565 566 void wrap_class(T, Params...) ( char[] docstring="", char[]modulename="") {566 void wrap_class(T, Params...) (string docstring="", string modulename="") { 567 567 _wrap_class!(T, symbolnameof!(T), Params).wrap_class(docstring, modulename); 568 568 } … … 572 572 } 573 573 +/ 574 template _wrap_class(_T, char[]name, Params...) {574 template _wrap_class(_T, string name, Params...) { 575 575 static if (is(_T == class)) { 576 576 pragma(msg, "wrap_class: " ~ name); … … 587 587 alias _T* T; 588 588 } 589 void wrap_class( char[] docstring="", char[]modulename="") {589 void wrap_class(string docstring="", string modulename="") { 590 590 pragma(msg, "shim.mangleof: " ~ shim_class.mangleof); 591 591 alias wrapped_class_type!(T) type; … … 603 603 604 604 assert(Pyd_Module_p(modulename) !is null, "Must initialize module before wrapping classes."); 605 char[]module_name = toString(python.PyModule_GetName(Pyd_Module_p(modulename)));605 string module_name = toString(python.PyModule_GetName(Pyd_Module_p(modulename))); 606 606 607 607 //////////////////
