Mercurial > projects > ldc
comparison tango/tango/io/Buffer.d @ 138:aeddd4d533b3 trunk
[svn r142] minor fix to dynamic casts.
added a few missed files.
author | lindquist |
---|---|
date | Fri, 18 Jan 2008 20:13:19 +0100 |
parents | ce7b81fb957f |
children | 0ab29b838084 |
comparison
equal
deleted
inserted
replaced
137:ce7b81fb957f | 138:aeddd4d533b3 |
---|---|
548 a Writer. | 548 a Writer. |
549 | 549 |
550 ***********************************************************************/ | 550 ***********************************************************************/ |
551 | 551 |
552 IBuffer append (void* src, uint length) | 552 IBuffer append (void* src, uint length) |
553 { | 553 { |
554 printf("Buffer.append(%p, %u)\n", src, length); | |
554 if (length > writable) | 555 if (length > writable) |
555 // can we write externally? | 556 // can we write externally? |
556 if (sink) | 557 if (sink) |
557 { | 558 { |
558 flush (); | 559 flush (); |
568 } while (length > dimension); | 569 } while (length > dimension); |
569 } | 570 } |
570 } | 571 } |
571 else | 572 else |
572 error (overflow); | 573 error (overflow); |
573 | 574 printf(" copying\n"); |
574 copy (src, length); | 575 copy (src, length); |
576 printf("returning\n"); | |
575 return this; | 577 return this; |
576 } | 578 } |
577 | 579 |
578 /*********************************************************************** | 580 /*********************************************************************** |
579 | 581 |
1093 | 1095 |
1094 ***********************************************************************/ | 1096 ***********************************************************************/ |
1095 | 1097 |
1096 protected void copy (void *src, uint size) | 1098 protected void copy (void *src, uint size) |
1097 { | 1099 { |
1100 printf("Buffer.copy(%p, %u)\n", src, size); | |
1098 // avoid "out of bounds" test on zero size | 1101 // avoid "out of bounds" test on zero size |
1099 if (size) | 1102 if (size) |
1100 { | 1103 { |
1101 // content may overlap ... | 1104 // content may overlap ... |
1102 memcpy (&data[extent], src, size); | 1105 memcpy (&data[extent], src, size); |
1103 extent += size; | 1106 extent += size; |
1104 } | 1107 } |
1108 printf(" copy done\n"); | |
1105 } | 1109 } |
1106 | 1110 |
1107 /*********************************************************************** | 1111 /*********************************************************************** |
1108 | 1112 |
1109 Cast to a target type without invoking the wrath of the | 1113 Cast to a target type without invoking the wrath of the |