aboutsummaryrefslogtreecommitdiff
path: root/src/myriad.cpp
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2010-11-10 21:18:58 +0000
committerMike Buland <eichlan@xagasoft.com>2010-11-10 21:18:58 +0000
commitaefab051dd21df0123ffa45a5a28d594bfecf82d (patch)
tree790ed55144c6114cb59f7d7280a79e020a14d031 /src/myriad.cpp
parent31b0ab27116519ecc441c96166ac36dcd637f68d (diff)
downloadlibbu++-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 '')
-rw-r--r--src/myriad.cpp30
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
513int 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
523int 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
533int 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
513Bu::Myriad::Stream *Bu::Myriad::findStream( int iId ) 543Bu::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++ )