From afb50f535dd60b485a38f1f1f692b3303e28fecc Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Thu, 28 Jun 2007 21:58:47 +0000 Subject: The FString has more things that it can do...now. --- src/fstring.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/fstring.h') diff --git a/src/fstring.h b/src/fstring.h index bf6518b..1f21b5f 100644 --- a/src/fstring.h +++ b/src/fstring.h @@ -586,6 +586,20 @@ namespace Bu return -1; } + /** + * Remove nAmnt bytes from the front of the string. This function + * operates in O(n) time and should be used sparingly. + */ + void trimFront( long nAmnt ) + { + long nNewLen = nLength - nAmnt; + flatten(); + Chunk *pNew = newChunk( nNewLen ); + cpy( pNew->pData, pFirst->pData, nNewLen ); + clear(); + appendChunk( pNew ); + } + /** * Function the archiver calls to archive your FString. *@param ar (Archive) The archive which is archiving your FString. @@ -882,4 +896,7 @@ namespace Bu template<> bool __cmpHashKeys( const FString &a, const FString &b ); } +#include +std::ostream& operator<< (std::ostream &os, Bu::FString &val ); + #endif -- cgit v1.2.3