From d473e27a38126a58b9a793e6cc62768cd02c0c46 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Mon, 26 Jul 2010 23:37:42 +0000 Subject: Minor helper functions added. --- src/array.h | 19 +++++++++++++++++++ src/sha1.h | 1 + 2 files changed, 20 insertions(+) (limited to 'src') diff --git a/src/array.h b/src/array.h index 6571c8a..eeee677 100644 --- a/src/array.h +++ b/src/array.h @@ -205,6 +205,25 @@ namespace Bu return core->pData[iIndex]; } + value &get( long iIndex ) + { + _hardCopy(); + if( iIndex < 0 || iIndex >= core->iSize ) + throw ArrayException( + "Index %d out of range 0:%d", iIndex, core->iSize ); + + return core->pData[iIndex]; + } + + const value &get( long iIndex ) const + { + if( iIndex < 0 || iIndex >= core->iSize ) + throw ArrayException( + "Index %d out of range 0:%d", iIndex, core->iSize ); + + return core->pData[iIndex]; + } + value &first() { _hardCopy(); diff --git a/src/sha1.h b/src/sha1.h index 6c6ee37..ea8c256 100644 --- a/src/sha1.h +++ b/src/sha1.h @@ -28,6 +28,7 @@ namespace Bu virtual void reset(); virtual void setSalt( const Bu::FString &sSalt ); virtual void addData( const void *sData, int iSize ); + using CryptoHash::addData; virtual FString getResult(); virtual void writeResult( Stream &sOut ); -- cgit v1.2.3