author | llornkcor <llornkcor> | 2003-07-10 02:40:10 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2003-07-10 02:40:10 (UTC) |
commit | 155d68c1e7d7dc0fed2534ac43d6d77ce2781f55 (patch) (unidiff) | |
tree | e6edaa5a7040fe6c224c3943d1094dcf02e4f74c /qmake/tools/qucom.cpp | |
parent | 86703e8a5527ef114facd02c005b6b3a7e62e263 (diff) | |
download | opie-155d68c1e7d7dc0fed2534ac43d6d77ce2781f55.zip opie-155d68c1e7d7dc0fed2534ac43d6d77ce2781f55.tar.gz opie-155d68c1e7d7dc0fed2534ac43d6d77ce2781f55.tar.bz2 |
update qmake to 1.05a
-rw-r--r-- | qmake/tools/qucom.cpp | 136 |
1 files changed, 6 insertions, 130 deletions
diff --git a/qmake/tools/qucom.cpp b/qmake/tools/qucom.cpp index 6086a79..658da97 100644 --- a/qmake/tools/qucom.cpp +++ b/qmake/tools/qucom.cpp | |||
@@ -267,282 +267,165 @@ bool QUType_bool::convertFrom( QUObject *o, QUType *t ) | |||
267 | return t->convertTo( o, this ); | 267 | return t->convertTo( o, this ); |
268 | } | 268 | } |
269 | 269 | ||
270 | bool QUType_bool::convertTo( QUObject *, QUType * ) | 270 | bool QUType_bool::convertTo( QUObject *, QUType * ) |
271 | { | 271 | { |
272 | return FALSE; | 272 | return FALSE; |
273 | } | 273 | } |
274 | 274 | ||
275 | int QUType_bool::serializeTo( QUObject *, QUBuffer * ) | 275 | int QUType_bool::serializeTo( QUObject *, QUBuffer * ) |
276 | { | 276 | { |
277 | return 0; | 277 | return 0; |
278 | } | 278 | } |
279 | 279 | ||
280 | int QUType_bool::serializeFrom( QUObject *, QUBuffer * ) | 280 | int QUType_bool::serializeFrom( QUObject *, QUBuffer * ) |
281 | { | 281 | { |
282 | return 0; | 282 | return 0; |
283 | } | 283 | } |
284 | 284 | ||
285 | // {53C1F3BE-73C3-4c7d-9E05-CCF09EB676B5} | 285 | // {53C1F3BE-73C3-4c7d-9E05-CCF09EB676B5} |
286 | const QUuid TID_QUType_int( 0x53c1f3be, 0x73c3, 0x4c7d, 0x9e, 0x5, 0xcc, 0xf0, 0x9e, 0xb6, 0x76, 0xb5 ); | 286 | const QUuid TID_QUType_int( 0x53c1f3be, 0x73c3, 0x4c7d, 0x9e, 0x5, 0xcc, 0xf0, 0x9e, 0xb6, 0x76, 0xb5 ); |
287 | QUType_int static_QUType_int; | 287 | QUType_int static_QUType_int; |
288 | const QUuid *QUType_int::uuid() const { return &TID_QUType_int; } | 288 | const QUuid *QUType_int::uuid() const { return &TID_QUType_int; } |
289 | const char *QUType_int::desc() const { return "int"; } | 289 | const char *QUType_int::desc() const { return "int"; } |
290 | 290 | ||
291 | void QUType_int::set( QUObject *o, int v ) | 291 | void QUType_int::set( QUObject *o, int v ) |
292 | { | 292 | { |
293 | o->payload.i = v; | 293 | o->payload.i = v; |
294 | o->type = this; | 294 | o->type = this; |
295 | } | 295 | } |
296 | 296 | ||
297 | bool QUType_int::canConvertFrom( QUObject *o, QUType *t ) | 297 | bool QUType_int::canConvertFrom( QUObject *o, QUType *t ) |
298 | { | 298 | { |
299 | if ( isEqual( t, &static_QUType_double ) || | 299 | if ( isEqual( t, &static_QUType_double ) ) |
300 | isEqual( t, &static_QUType_float ) ) | ||
301 | return TRUE; | 300 | return TRUE; |
302 | 301 | ||
303 | return t->canConvertTo( o, this ); | 302 | return t->canConvertTo( o, this ); |
304 | } | 303 | } |
305 | 304 | ||
306 | bool QUType_int::canConvertTo( QUObject * /*o*/, QUType *t ) | 305 | bool QUType_int::canConvertTo( QUObject * /*o*/, QUType *t ) |
307 | { | 306 | { |
308 | return isEqual( t, &static_QUType_double ) || | 307 | return isEqual( t, &static_QUType_double ); |
309 | isEqual( t, &static_QUType_float ); | ||
310 | } | 308 | } |
311 | 309 | ||
312 | bool QUType_int::convertFrom( QUObject *o, QUType *t ) | 310 | bool QUType_int::convertFrom( QUObject *o, QUType *t ) |
313 | { | 311 | { |
314 | if ( isEqual( t, &static_QUType_double ) ) | 312 | if ( isEqual( t, &static_QUType_double ) ) |
315 | o->payload.i = (long)o->payload.d; | 313 | o->payload.i = (long)o->payload.d; |
316 | else if ( isEqual( t, &static_QUType_float ) ) | ||
317 | o->payload.i = (long)o->payload.f; | ||
318 | else | 314 | else |
319 | return t->convertTo( o, this ); | 315 | return t->convertTo( o, this ); |
320 | 316 | ||
321 | o->type = this; | 317 | o->type = this; |
322 | return TRUE; | 318 | return TRUE; |
323 | } | 319 | } |
324 | 320 | ||
325 | bool QUType_int::convertTo( QUObject *o, QUType *t ) | 321 | bool QUType_int::convertTo( QUObject *o, QUType *t ) |
326 | { | 322 | { |
327 | if ( isEqual( t, &static_QUType_double ) ) { | 323 | if ( isEqual( t, &static_QUType_double ) ) { |
328 | o->payload.d = (double)o->payload.i; | 324 | o->payload.d = (double)o->payload.i; |
329 | o->type = &static_QUType_double; | 325 | o->type = &static_QUType_double; |
330 | } else if ( isEqual( t, &static_QUType_float ) ) { | ||
331 | o->payload.f = (float)o->payload.i; | ||
332 | o->type = &static_QUType_float; | ||
333 | } else | 326 | } else |
334 | return FALSE; | 327 | return FALSE; |
335 | return TRUE; | 328 | return TRUE; |
336 | } | 329 | } |
337 | 330 | ||
338 | int QUType_int::serializeTo( QUObject *, QUBuffer * ) | 331 | int QUType_int::serializeTo( QUObject *, QUBuffer * ) |
339 | { | 332 | { |
340 | return 0; | 333 | return 0; |
341 | } | 334 | } |
342 | 335 | ||
343 | int QUType_int::serializeFrom( QUObject *, QUBuffer * ) | 336 | int QUType_int::serializeFrom( QUObject *, QUBuffer * ) |
344 | { | 337 | { |
345 | return 0; | 338 | return 0; |
346 | } | 339 | } |
347 | 340 | ||
348 | // {5938712A-C496-11D5-8CB2-00C0F03BC0F3} | ||
349 | const QUuid TID_QUType_uint( 0x5938712a, 0xc496, 0x11d5, 0x8c, 0xb2, 0x00, 0xc0, 0xf0, 0x3b, 0xc0, 0xf3); | ||
350 | QUType_uint static_QUType_uint; | ||
351 | const QUuid *QUType_uint::uuid() const { return &TID_QUType_uint; } | ||
352 | const char *QUType_uint::desc() const { return "uint"; } | ||
353 | |||
354 | void QUType_uint::set( QUObject *o, uint v ) | ||
355 | { | ||
356 | o->payload.ui = v; | ||
357 | o->type = this; | ||
358 | } | ||
359 | |||
360 | bool QUType_uint::canConvertFrom( QUObject *o, QUType *t ) | ||
361 | { | ||
362 | return t->canConvertTo( o, this ); | ||
363 | } | ||
364 | |||
365 | bool QUType_uint::canConvertTo( QUObject * /*o*/, QUType * /*t*/ ) | ||
366 | { | ||
367 | return FALSE; | ||
368 | } | ||
369 | |||
370 | bool QUType_uint::convertFrom( QUObject *o, QUType *t ) | ||
371 | { | ||
372 | return t->convertTo( o, this ); | ||
373 | } | ||
374 | |||
375 | bool QUType_uint::convertTo( QUObject * /*o*/, QUType * /*t*/ ) | ||
376 | { | ||
377 | return FALSE; | ||
378 | } | ||
379 | |||
380 | int QUType_uint::serializeTo( QUObject *, QUBuffer * ) | ||
381 | { | ||
382 | return 0; | ||
383 | } | ||
384 | |||
385 | int QUType_uint::serializeFrom( QUObject *, QUBuffer * ) | ||
386 | { | ||
387 | return 0; | ||
388 | } | ||
389 | |||
390 | // {2D0974E5-0BA6-4ec2-8837-C198972CB48C} | 341 | // {2D0974E5-0BA6-4ec2-8837-C198972CB48C} |
391 | const QUuid TID_QUType_double( 0x2d0974e5, 0xba6, 0x4ec2, 0x88, 0x37, 0xc1, 0x98, 0x97, 0x2c, 0xb4, 0x8c ); | 342 | const QUuid TID_QUType_double( 0x2d0974e5, 0xba6, 0x4ec2, 0x88, 0x37, 0xc1, 0x98, 0x97, 0x2c, 0xb4, 0x8c ); |
392 | QUType_double static_QUType_double; | 343 | QUType_double static_QUType_double; |
393 | const QUuid *QUType_double::uuid() const { return &TID_QUType_double; } | 344 | const QUuid *QUType_double::uuid() const { return &TID_QUType_double; } |
394 | const char *QUType_double::desc() const {return "double"; } | 345 | const char *QUType_double::desc() const {return "double"; } |
395 | 346 | ||
396 | void QUType_double::set( QUObject *o, double v ) | 347 | void QUType_double::set( QUObject *o, double v ) |
397 | { | 348 | { |
398 | o->payload.d = v; | 349 | o->payload.d = v; |
399 | o->type = this; | 350 | o->type = this; |
400 | } | 351 | } |
401 | 352 | ||
402 | bool QUType_double::canConvertFrom( QUObject *o, QUType *t ) | 353 | bool QUType_double::canConvertFrom( QUObject *o, QUType *t ) |
403 | { | 354 | { |
404 | if ( isEqual( t, &static_QUType_int ) || | 355 | if ( isEqual( t, &static_QUType_int ) ) |
405 | isEqual( t, &static_QUType_float) ) | ||
406 | return TRUE; | 356 | return TRUE; |
407 | 357 | ||
408 | return t->canConvertTo( o, this ); | 358 | return t->canConvertTo( o, this ); |
409 | } | 359 | } |
410 | 360 | ||
411 | bool QUType_double::canConvertTo( QUObject * /*o*/, QUType *t ) | 361 | bool QUType_double::canConvertTo( QUObject * /*o*/, QUType *t ) |
412 | { | 362 | { |
413 | return isEqual( t, &static_QUType_int ) || | 363 | return isEqual( t, &static_QUType_int ); |
414 | isEqual( t, &static_QUType_float ); | ||
415 | } | 364 | } |
416 | 365 | ||
417 | bool QUType_double::convertFrom( QUObject *o, QUType *t ) | 366 | bool QUType_double::convertFrom( QUObject *o, QUType *t ) |
418 | { | 367 | { |
419 | if ( isEqual( t, &static_QUType_int ) ) | 368 | if ( isEqual( t, &static_QUType_int ) ) |
420 | o->payload.d = (double)o->payload.i; | 369 | o->payload.d = (double)o->payload.i; |
421 | else if ( isEqual( t, &static_QUType_float ) ) | 370 | else |
422 | o->payload.d = (double)o->payload.f; | ||
423 | else | ||
424 | return t->convertTo( o, this ); | 371 | return t->convertTo( o, this ); |
425 | 372 | ||
426 | o->type = this; | 373 | o->type = this; |
427 | return TRUE; | 374 | return TRUE; |
428 | } | 375 | } |
429 | 376 | ||
430 | bool QUType_double::convertTo( QUObject *o, QUType *t ) | 377 | bool QUType_double::convertTo( QUObject *o, QUType *t ) |
431 | { | 378 | { |
432 | if ( isEqual( t, &static_QUType_int ) ) { | 379 | if ( isEqual( t, &static_QUType_int ) ) { |
433 | o->payload.i = (int) o->payload.d; | 380 | o->payload.i = (int) o->payload.d; |
434 | o->type = &static_QUType_int; | 381 | o->type = &static_QUType_int; |
435 | } else if ( isEqual( t, &static_QUType_double ) ) { | 382 | } else if ( isEqual( t, &static_QUType_double ) ) { |
436 | o->payload.d = (double) o->payload.f; | 383 | o->payload.d = (double) o->payload.f; |
437 | o->type = &static_QUType_double; | 384 | o->type = &static_QUType_double; |
438 | } else | 385 | } else |
439 | return FALSE; | 386 | return FALSE; |
440 | return TRUE; | 387 | return TRUE; |
441 | } | 388 | } |
442 | 389 | ||
443 | int QUType_double::serializeTo( QUObject *, QUBuffer * ) | 390 | int QUType_double::serializeTo( QUObject *, QUBuffer * ) |
444 | { | 391 | { |
445 | return 0; | 392 | return 0; |
446 | } | 393 | } |
447 | 394 | ||
448 | int QUType_double::serializeFrom( QUObject *, QUBuffer * ) | 395 | int QUType_double::serializeFrom( QUObject *, QUBuffer * ) |
449 | { | 396 | { |
450 | return 0; | 397 | return 0; |
451 | } | 398 | } |
452 | 399 | ||
453 | |||
454 | // {544C5175-6993-4486-B04D-CEC4D21BF4B9 } | ||
455 | const QUuid TID_QUType_float( 0x544c5175, 0x6993, 0x4486, 0xb0, 0x4d, 0xce, 0xc4, 0xd2, 0x1b, 0xf4, 0xb9 ); | ||
456 | QUType_float static_QUType_float; | ||
457 | const QUuid *QUType_float::uuid() const { return &TID_QUType_float; } | ||
458 | const char *QUType_float::desc() const {return "float"; } | ||
459 | |||
460 | void QUType_float::set( QUObject *o, float v ) | ||
461 | { | ||
462 | o->payload.f = v; | ||
463 | o->type = this; | ||
464 | } | ||
465 | |||
466 | bool QUType_float::canConvertFrom( QUObject *o, QUType *t ) | ||
467 | { | ||
468 | if ( isEqual( t, &static_QUType_int ) || | ||
469 | isEqual( t, &static_QUType_double ) ) | ||
470 | return TRUE; | ||
471 | |||
472 | return t->canConvertTo( o, this ); | ||
473 | } | ||
474 | |||
475 | bool QUType_float::canConvertTo( QUObject * /*o*/, QUType *t ) | ||
476 | { | ||
477 | return isEqual( t, &static_QUType_int ) || | ||
478 | isEqual( t, &static_QUType_double ); | ||
479 | } | ||
480 | |||
481 | bool QUType_float::convertFrom( QUObject *o, QUType *t ) | ||
482 | { | ||
483 | if ( isEqual( t, &static_QUType_int ) ) | ||
484 | o->payload.f = (float)o->payload.i; | ||
485 | else if ( isEqual( t, &static_QUType_double ) ) | ||
486 | o->payload.f = (float)o->payload.d; | ||
487 | else | ||
488 | return t->convertTo( o, this ); | ||
489 | |||
490 | o->type = this; | ||
491 | return TRUE; | ||
492 | } | ||
493 | |||
494 | bool QUType_float::convertTo( QUObject *o, QUType *t ) | ||
495 | { | ||
496 | if ( isEqual( t, &static_QUType_int ) ) { | ||
497 | o->payload.i = (int) o->payload.f; | ||
498 | o->type = &static_QUType_int; | ||
499 | } else if ( isEqual( t, &static_QUType_double ) ) { | ||
500 | o->payload.d = (double) o->payload.f; | ||
501 | o->type = &static_QUType_double; | ||
502 | } else | ||
503 | return FALSE; | ||
504 | return TRUE; | ||
505 | } | ||
506 | |||
507 | int QUType_float::serializeTo( QUObject *, QUBuffer * ) | ||
508 | { | ||
509 | return 0; | ||
510 | } | ||
511 | |||
512 | int QUType_float::serializeFrom( QUObject *, QUBuffer * ) | ||
513 | { | ||
514 | return 0; | ||
515 | } | ||
516 | |||
517 | // {EFCDD1D4-77A3-4b8e-8D46-DC14B8D393E9} | 400 | // {EFCDD1D4-77A3-4b8e-8D46-DC14B8D393E9} |
518 | const QUuid TID_QUType_charstar( 0xefcdd1d4, 0x77a3, 0x4b8e, 0x8d, 0x46, 0xdc, 0x14, 0xb8, 0xd3, 0x93, 0xe9 ); | 401 | const QUuid TID_QUType_charstar( 0xefcdd1d4, 0x77a3, 0x4b8e, 0x8d, 0x46, 0xdc, 0x14, 0xb8, 0xd3, 0x93, 0xe9 ); |
519 | QUType_charstar static_QUType_charstar; | 402 | QUType_charstar static_QUType_charstar; |
520 | const QUuid *QUType_charstar::uuid() const { return &TID_QUType_charstar; } | 403 | const QUuid *QUType_charstar::uuid() const { return &TID_QUType_charstar; } |
521 | const char *QUType_charstar::desc() const { return "char*"; } | 404 | const char *QUType_charstar::desc() const { return "char*"; } |
522 | 405 | ||
523 | void QUType_charstar::set( QUObject *o, const char* v, bool take ) | 406 | void QUType_charstar::set( QUObject *o, const char* v, bool take ) |
524 | { | 407 | { |
525 | if ( take ) { | 408 | if ( take ) { |
526 | if ( v ) { | 409 | if ( v ) { |
527 | o->payload.charstar.ptr = new char[ strlen(v) + 1 ]; | 410 | o->payload.charstar.ptr = new char[ strlen(v) + 1 ]; |
528 | strcpy( o->payload.charstar.ptr, v ); | 411 | strcpy( o->payload.charstar.ptr, v ); |
529 | } else { | 412 | } else { |
530 | o->payload.charstar.ptr = 0; | 413 | o->payload.charstar.ptr = 0; |
531 | } | 414 | } |
532 | o->payload.charstar.owner = TRUE; | 415 | o->payload.charstar.owner = TRUE; |
533 | } else { | 416 | } else { |
534 | o->payload.charstar.ptr = (char*) v; | 417 | o->payload.charstar.ptr = (char*) v; |
535 | o->payload.charstar.owner = FALSE; | 418 | o->payload.charstar.owner = FALSE; |
536 | } | 419 | } |
537 | o->type = this; | 420 | o->type = this; |
538 | } | 421 | } |
539 | 422 | ||
540 | bool QUType_charstar::canConvertFrom( QUObject *o, QUType *t ) | 423 | bool QUType_charstar::canConvertFrom( QUObject *o, QUType *t ) |
541 | { | 424 | { |
542 | return t->canConvertTo( o, this ); | 425 | return t->canConvertTo( o, this ); |
543 | } | 426 | } |
544 | 427 | ||
545 | bool QUType_charstar::canConvertTo( QUObject *, QUType * ) | 428 | bool QUType_charstar::canConvertTo( QUObject *, QUType * ) |
546 | { | 429 | { |
547 | return FALSE; | 430 | return FALSE; |
548 | } | 431 | } |
@@ -564,105 +447,98 @@ void QUType_charstar::clear( QUObject *o ) | |||
564 | o->payload.charstar.ptr = 0; | 447 | o->payload.charstar.ptr = 0; |
565 | } | 448 | } |
566 | 449 | ||
567 | int QUType_charstar::serializeTo( QUObject *, QUBuffer * ) | 450 | int QUType_charstar::serializeTo( QUObject *, QUBuffer * ) |
568 | { | 451 | { |
569 | return 0; | 452 | return 0; |
570 | } | 453 | } |
571 | 454 | ||
572 | int QUType_charstar::serializeFrom( QUObject *, QUBuffer * ) | 455 | int QUType_charstar::serializeFrom( QUObject *, QUBuffer * ) |
573 | { | 456 | { |
574 | return 0; | 457 | return 0; |
575 | } | 458 | } |
576 | 459 | ||
577 | 460 | ||
578 | // Qt specific types | 461 | // Qt specific types |
579 | 462 | ||
580 | // {44C2A547-01E7-4e56-8559-35AF9D2F42B7} | 463 | // {44C2A547-01E7-4e56-8559-35AF9D2F42B7} |
581 | const QUuid TID_QUType_QString( 0x44c2a547, 0x1e7, 0x4e56, 0x85, 0x59, 0x35, 0xaf, 0x9d, 0x2f, 0x42, 0xb7 ); | 464 | const QUuid TID_QUType_QString( 0x44c2a547, 0x1e7, 0x4e56, 0x85, 0x59, 0x35, 0xaf, 0x9d, 0x2f, 0x42, 0xb7 ); |
582 | QUType_QString static_QUType_QString; | 465 | QUType_QString static_QUType_QString; |
583 | const QUuid *QUType_QString::uuid() const { return &TID_QUType_QString; } | 466 | const QUuid *QUType_QString::uuid() const { return &TID_QUType_QString; } |
584 | const char *QUType_QString::desc() const { return "QString"; } | 467 | const char *QUType_QString::desc() const { return "QString"; } |
585 | 468 | ||
586 | void QUType_QString::set( QUObject *o, const QString& v ) | 469 | void QUType_QString::set( QUObject *o, const QString& v ) |
587 | { | 470 | { |
588 | o->payload.ptr = new QString( v ); | 471 | o->payload.ptr = new QString( v ); |
589 | o->type = this; | 472 | o->type = this; |
590 | } | 473 | } |
591 | 474 | ||
592 | bool QUType_QString::canConvertFrom( QUObject *o, QUType *t ) | 475 | bool QUType_QString::canConvertFrom( QUObject *o, QUType *t ) |
593 | { | 476 | { |
594 | if ( isEqual( t, &static_QUType_charstar ) || | 477 | if ( isEqual( t, &static_QUType_charstar ) || |
595 | isEqual( t, &static_QUType_double ) || | 478 | isEqual( t, &static_QUType_double ) || |
596 | isEqual( t, &static_QUType_float ) || | ||
597 | isEqual( t, &static_QUType_int ) ) | 479 | isEqual( t, &static_QUType_int ) ) |
598 | return TRUE; | 480 | return TRUE; |
599 | 481 | ||
600 | return t->canConvertTo( o, this ); | 482 | return t->canConvertTo( o, this ); |
601 | } | 483 | } |
602 | 484 | ||
603 | bool QUType_QString::canConvertTo( QUObject * /*o*/, QUType *t ) | 485 | bool QUType_QString::canConvertTo( QUObject * /*o*/, QUType *t ) |
604 | { | 486 | { |
605 | return isEqual( t, &static_QUType_charstar ) || | 487 | return isEqual( t, &static_QUType_charstar ) || |
606 | isEqual( t, &static_QUType_int ) || | 488 | isEqual( t, &static_QUType_int ) || |
607 | isEqual( t, &static_QUType_double ) || | 489 | isEqual( t, &static_QUType_double ); |
608 | isEqual( t, &static_QUType_float ); | ||
609 | } | 490 | } |
610 | 491 | ||
611 | bool QUType_QString::convertFrom( QUObject *o, QUType *t ) | 492 | bool QUType_QString::convertFrom( QUObject *o, QUType *t ) |
612 | { | 493 | { |
613 | QString *str = 0; | 494 | QString *str = 0; |
614 | if ( isEqual( t, &static_QUType_charstar ) ) | 495 | if ( isEqual( t, &static_QUType_charstar ) ) |
615 | str = new QString( o->payload.charstar.ptr ); | 496 | str = new QString( o->payload.charstar.ptr ); |
616 | else if ( isEqual( t, &static_QUType_double ) ) | 497 | else if ( isEqual( t, &static_QUType_double ) ) |
617 | str = new QString( QString::number( o->payload.d ) ); | 498 | str = new QString( QString::number( o->payload.d ) ); |
618 | else if ( isEqual( t, &static_QUType_float ) ) | ||
619 | str = new QString( QString::number( o->payload.f ) ); | ||
620 | else if ( isEqual( t, &static_QUType_int ) ) | 499 | else if ( isEqual( t, &static_QUType_int ) ) |
621 | str = new QString( QString::number( o->payload.i ) ); | 500 | str = new QString( QString::number( o->payload.i ) ); |
622 | else | 501 | else |
623 | return t->convertTo( o, this ); | 502 | return t->convertTo( o, this ); |
624 | 503 | ||
625 | o->type->clear( o ); | 504 | o->type->clear( o ); |
626 | o->payload.ptr = str; | 505 | o->payload.ptr = str; |
627 | o->type = this; | 506 | o->type = this; |
628 | return TRUE; | 507 | return TRUE; |
629 | } | 508 | } |
630 | 509 | ||
631 | bool QUType_QString::convertTo( QUObject *o, QUType *t ) | 510 | bool QUType_QString::convertTo( QUObject *o, QUType *t ) |
632 | { | 511 | { |
633 | QString *str = (QString *)o->payload.ptr; | 512 | QString *str = (QString *)o->payload.ptr; |
634 | if ( isEqual( t, &static_QUType_charstar ) ) { | 513 | if ( isEqual( t, &static_QUType_charstar ) ) { |
635 | o->payload.charstar.ptr = qstrdup( str->local8Bit().data() ); | 514 | o->payload.charstar.ptr = qstrdup( str->local8Bit().data() ); |
636 | o->payload.charstar.owner = TRUE; | 515 | o->payload.charstar.owner = TRUE; |
637 | o->type = &static_QUType_charstar; | 516 | o->type = &static_QUType_charstar; |
638 | } else if ( isEqual( t, &static_QUType_int ) ) { | 517 | } else if ( isEqual( t, &static_QUType_int ) ) { |
639 | o->payload.l = str->toLong(); | 518 | o->payload.l = str->toLong(); |
640 | o->type = &static_QUType_int; | 519 | o->type = &static_QUType_int; |
641 | } else if ( isEqual( t, &static_QUType_double ) ) { | 520 | } else if ( isEqual( t, &static_QUType_double ) ) { |
642 | o->payload.d = str->toDouble(); | 521 | o->payload.d = str->toDouble(); |
643 | o->type = &static_QUType_double; | 522 | o->type = &static_QUType_double; |
644 | } else if ( isEqual( t, &static_QUType_float ) ) { | ||
645 | o->payload.d = str->toFloat(); | ||
646 | o->type = &static_QUType_float; | ||
647 | } else { | 523 | } else { |
648 | return FALSE; | 524 | return FALSE; |
649 | } | 525 | } |
650 | delete str; | 526 | delete str; |
651 | return TRUE; | 527 | return TRUE; |
652 | } | 528 | } |
653 | 529 | ||
654 | int QUType_QString::serializeTo( QUObject *, QUBuffer * ) | 530 | int QUType_QString::serializeTo( QUObject *, QUBuffer * ) |
655 | { | 531 | { |
656 | return 0; | 532 | return 0; |
657 | } | 533 | } |
658 | 534 | ||
659 | int QUType_QString::serializeFrom( QUObject *, QUBuffer * ) | 535 | int QUType_QString::serializeFrom( QUObject *, QUBuffer * ) |
660 | { | 536 | { |
661 | return 0; | 537 | return 0; |
662 | } | 538 | } |
663 | 539 | ||
664 | void QUType_QString::clear( QUObject *o ) | 540 | void QUType_QString::clear( QUObject *o ) |
665 | { | 541 | { |
666 | delete (QString*)o->payload.ptr; | 542 | delete (QString*)o->payload.ptr; |
667 | o->payload.ptr = 0; | 543 | o->payload.ptr = 0; |
668 | } | 544 | } |