diff options
author | Mike Buland <eichlan@xagasoft.com> | 2009-02-27 15:21:33 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2009-02-27 15:21:33 +0000 |
commit | 7433ec9074051ea5d9f91458e2e91e29ec8020f2 (patch) | |
tree | 1e2d95a54c03c9c2129be8ec20acaf9ee7e45db0 /src/list.h | |
parent | e198e10ffd710e9681635593dff65bf4abd45bda (diff) | |
download | libbu++-7433ec9074051ea5d9f91458e2e91e29ec8020f2.tar.gz libbu++-7433ec9074051ea5d9f91458e2e91e29ec8020f2.tar.bz2 libbu++-7433ec9074051ea5d9f91458e2e91e29ec8020f2.tar.xz libbu++-7433ec9074051ea5d9f91458e2e91e29ec8020f2.zip |
Fixed a bug in Bu::FString, it wouldn't concatinate properly when using the +
operator and the left-hand-side FString was const. Also, added a formatter <<
operator for Bu::List. The other containers should get their own formatter <<
operators soon too.
Diffstat (limited to '')
-rw-r--r-- | src/list.h | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -669,6 +669,24 @@ namespace Bu | |||
669 | long nSize; | 669 | long nSize; |
670 | cmpfunc cmp; | 670 | cmpfunc cmp; |
671 | }; | 671 | }; |
672 | |||
673 | class Formatter; | ||
674 | Formatter &operator<<( Formatter &rOut, char *sStr ); | ||
675 | Formatter &operator<<( Formatter &rOut, signed char c ); | ||
676 | template<typename value> | ||
677 | Formatter &operator<<( Formatter &f, const Bu::List<value> &l ) | ||
678 | { | ||
679 | f << '['; | ||
680 | for( typename Bu::List<value>::const_iterator i = l.begin(); i; i++ ) | ||
681 | { | ||
682 | if( i != l.begin() ) | ||
683 | f << ", "; | ||
684 | f << *i; | ||
685 | } | ||
686 | f << ']'; | ||
687 | |||
688 | return f; | ||
689 | } | ||
672 | } | 690 | } |
673 | 691 | ||
674 | #endif | 692 | #endif |