diff options
| author | Mike Buland <eichlan@xagasoft.com> | 2007-06-28 21:58:47 +0000 |
|---|---|---|
| committer | Mike Buland <eichlan@xagasoft.com> | 2007-06-28 21:58:47 +0000 |
| commit | afb50f535dd60b485a38f1f1f692b3303e28fecc (patch) | |
| tree | a961ea827ff8577dc237c4740525737e932869c8 | |
| parent | 66d1eb52b7f3023cfee5c10792a55b6af08eebe4 (diff) | |
| download | libbu++-afb50f535dd60b485a38f1f1f692b3303e28fecc.tar.gz libbu++-afb50f535dd60b485a38f1f1f692b3303e28fecc.tar.bz2 libbu++-afb50f535dd60b485a38f1f1f692b3303e28fecc.tar.xz libbu++-afb50f535dd60b485a38f1f1f692b3303e28fecc.zip | |
The FString has more things that it can do...now.
Diffstat (limited to '')
| -rw-r--r-- | src/client.h | 1 | ||||
| -rw-r--r-- | src/fstring.cpp | 6 | ||||
| -rw-r--r-- | src/fstring.h | 17 |
3 files changed, 24 insertions, 0 deletions
diff --git a/src/client.h b/src/client.h index cee558d..f228e96 100644 --- a/src/client.h +++ b/src/client.h | |||
| @@ -25,6 +25,7 @@ namespace Bu | |||
| 25 | Bu::FString &getInput(); | 25 | Bu::FString &getInput(); |
| 26 | Bu::FString &getOutput(); | 26 | Bu::FString &getOutput(); |
| 27 | void write( const char *pData, int nBytes ); | 27 | void write( const char *pData, int nBytes ); |
| 28 | void read( const char *pData, int nBytes ); | ||
| 28 | 29 | ||
| 29 | void setProtocol( Protocol *pProto ); | 30 | void setProtocol( Protocol *pProto ); |
| 30 | Bu::Protocol *getProtocol(); | 31 | Bu::Protocol *getProtocol(); |
diff --git a/src/fstring.cpp b/src/fstring.cpp index 56d2173..0b5a970 100644 --- a/src/fstring.cpp +++ b/src/fstring.cpp | |||
| @@ -12,3 +12,9 @@ template<> bool Bu::__cmpHashKeys<Bu::FString>( | |||
| 12 | return a == b; | 12 | return a == b; |
| 13 | } | 13 | } |
| 14 | 14 | ||
| 15 | std::ostream& operator<< (std::ostream &os, Bu::FString &val ) | ||
| 16 | { | ||
| 17 | os.write( val.getStr(), val.getSize() ); | ||
| 18 | return os; | ||
| 19 | } | ||
| 20 | |||
diff --git a/src/fstring.h b/src/fstring.h index bf6518b..1f21b5f 100644 --- a/src/fstring.h +++ b/src/fstring.h | |||
| @@ -587,6 +587,20 @@ namespace Bu | |||
| 587 | } | 587 | } |
| 588 | 588 | ||
| 589 | /** | 589 | /** |
| 590 | * Remove nAmnt bytes from the front of the string. This function | ||
| 591 | * operates in O(n) time and should be used sparingly. | ||
| 592 | */ | ||
| 593 | void trimFront( long nAmnt ) | ||
| 594 | { | ||
| 595 | long nNewLen = nLength - nAmnt; | ||
| 596 | flatten(); | ||
| 597 | Chunk *pNew = newChunk( nNewLen ); | ||
| 598 | cpy( pNew->pData, pFirst->pData, nNewLen ); | ||
| 599 | clear(); | ||
| 600 | appendChunk( pNew ); | ||
| 601 | } | ||
| 602 | |||
| 603 | /** | ||
| 590 | * Function the archiver calls to archive your FString. | 604 | * Function the archiver calls to archive your FString. |
| 591 | *@param ar (Archive) The archive which is archiving your FString. | 605 | *@param ar (Archive) The archive which is archiving your FString. |
| 592 | */ | 606 | */ |
| @@ -882,4 +896,7 @@ namespace Bu | |||
| 882 | template<> bool __cmpHashKeys<FString>( const FString &a, const FString &b ); | 896 | template<> bool __cmpHashKeys<FString>( const FString &a, const FString &b ); |
| 883 | } | 897 | } |
| 884 | 898 | ||
| 899 | #include <ostream> | ||
| 900 | std::ostream& operator<< (std::ostream &os, Bu::FString &val ); | ||
| 901 | |||
| 885 | #endif | 902 | #endif |
