diff options
author | Mike Buland <eichlan@xagasoft.com> | 2010-11-10 21:18:58 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2010-11-10 21:18:58 +0000 |
commit | aefab051dd21df0123ffa45a5a28d594bfecf82d (patch) | |
tree | 790ed55144c6114cb59f7d7280a79e020a14d031 /src/myriad.cpp | |
parent | 31b0ab27116519ecc441c96166ac36dcd637f68d (diff) | |
download | libbu++-aefab051dd21df0123ffa45a5a28d594bfecf82d.tar.gz libbu++-aefab051dd21df0123ffa45a5a28d594bfecf82d.tar.bz2 libbu++-aefab051dd21df0123ffa45a5a28d594bfecf82d.tar.xz libbu++-aefab051dd21df0123ffa45a5a28d594bfecf82d.zip |
Added a couple more debugging functions to Bu::Myriad, and exposed them in the
cli tool.
Diffstat (limited to 'src/myriad.cpp')
-rw-r--r-- | src/myriad.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/myriad.cpp b/src/myriad.cpp index c3eb97e..b656b52 100644 --- a/src/myriad.cpp +++ b/src/myriad.cpp | |||
@@ -510,6 +510,36 @@ int Bu::Myriad::getNumUsedBlocks() | |||
510 | return iUsed; | 510 | return iUsed; |
511 | } | 511 | } |
512 | 512 | ||
513 | int Bu::Myriad::getTotalUsedBytes() | ||
514 | { | ||
515 | int iTotalSize = 0; | ||
516 | for( StreamArray::iterator i = aStreams.begin(); i; i++ ) | ||
517 | { | ||
518 | iTotalSize += (*i)->iSize; | ||
519 | } | ||
520 | return iTotalSize; | ||
521 | } | ||
522 | |||
523 | int Bu::Myriad::getTotalUnusedBytes() | ||
524 | { | ||
525 | int iTotalSize = (iBlocks-iUsed)*iBlockSize; | ||
526 | for( StreamArray::iterator i = aStreams.begin(); i; i++ ) | ||
527 | { | ||
528 | iTotalSize += iBlockSize - ((*i)->iSize%iBlockSize); | ||
529 | } | ||
530 | return iTotalSize; | ||
531 | } | ||
532 | |||
533 | int Bu::Myriad::getTotalUnusedBytes( int iFakeBlockSize ) | ||
534 | { | ||
535 | int iTotalSize = (iBlocks-iUsed)*iFakeBlockSize; | ||
536 | for( StreamArray::iterator i = aStreams.begin(); i; i++ ) | ||
537 | { | ||
538 | iTotalSize += iFakeBlockSize - ((*i)->iSize%iFakeBlockSize); | ||
539 | } | ||
540 | return iTotalSize; | ||
541 | } | ||
542 | |||
513 | Bu::Myriad::Stream *Bu::Myriad::findStream( int iId ) | 543 | Bu::Myriad::Stream *Bu::Myriad::findStream( int iId ) |
514 | { | 544 | { |
515 | for( StreamArray::iterator i = aStreams.begin(); i; i++ ) | 545 | for( StreamArray::iterator i = aStreams.begin(); i; i++ ) |