summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2009-05-21 20:36:26 +0000
committerMike Buland <eichlan@xagasoft.com>2009-05-21 20:36:26 +0000
commitd908cc68a7c3fe49814ba459f0ee33dc44decf5b (patch)
treec752aa96e1923eae07f284402812bfa8103c36b8 /src
parentf36140137654bb48faa6d13319f5e0e1f35a1770 (diff)
downloadlibbu++-d908cc68a7c3fe49814ba459f0ee33dc44decf5b.tar.gz
libbu++-d908cc68a7c3fe49814ba459f0ee33dc44decf5b.tar.bz2
libbu++-d908cc68a7c3fe49814ba459f0ee33dc44decf5b.tar.xz
libbu++-d908cc68a7c3fe49814ba459f0ee33dc44decf5b.zip
Added some more helpers to Bu::Formatter::Fmt, make it a little easier to use.
Diffstat (limited to '')
-rw-r--r--src/formatter.cpp18
-rw-r--r--src/formatter.h6
2 files changed, 23 insertions, 1 deletions
diff --git a/src/formatter.cpp b/src/formatter.cpp
index 8c06bde..dc4336b 100644
--- a/src/formatter.cpp
+++ b/src/formatter.cpp
@@ -153,6 +153,24 @@ Bu::Formatter::Fmt &Bu::Formatter::Fmt::align( Alignment eAlign )
153 return *this; 153 return *this;
154} 154}
155 155
156Bu::Formatter::Fmt &Bu::Formatter::Fmt::left()
157{
158 this->uAlign = Fmt::Left;
159 return *this;
160}
161
162Bu::Formatter::Fmt &Bu::Formatter::Fmt::center()
163{
164 this->uAlign = Fmt::Center;
165 return *this;
166}
167
168Bu::Formatter::Fmt &Bu::Formatter::Fmt::right()
169{
170 this->uAlign = Fmt::Right;
171 return *this;
172}
173
156Bu::Formatter::Fmt &Bu::Formatter::Fmt::plus( bool bPlus ) 174Bu::Formatter::Fmt &Bu::Formatter::Fmt::plus( bool bPlus )
157{ 175{
158 this->bPlus = bPlus; 176 this->bPlus = bPlus;
diff --git a/src/formatter.h b/src/formatter.h
index 81e8db5..9f931ee 100644
--- a/src/formatter.h
+++ b/src/formatter.h
@@ -40,7 +40,7 @@ namespace Bu
40 bCaps( bCaps ) 40 bCaps( bCaps )
41 { 41 {
42 } 42 }
43 Fmt( unsigned int uMinWidth, Alignment a=Right, 43 Fmt( unsigned int uMinWidth, Alignment a,
44 unsigned int uRadix=10, bool bPlus=false, bool bCaps=true, 44 unsigned int uRadix=10, bool bPlus=false, bool bCaps=true,
45 char cFill=' ') : 45 char cFill=' ') :
46 uMinWidth( uMinWidth ), 46 uMinWidth( uMinWidth ),
@@ -74,6 +74,10 @@ namespace Bu
74 Fmt &plus( bool bPlus=true ); 74 Fmt &plus( bool bPlus=true );
75 Fmt &caps( bool bCaps=true ); 75 Fmt &caps( bool bCaps=true );
76 76
77 Fmt &left();
78 Fmt &right();
79 Fmt &center();
80
77 unsigned char uMinWidth; 81 unsigned char uMinWidth;
78 char cFillChar; 82 char cFillChar;
79 unsigned short uRadix : 6; 83 unsigned short uRadix : 6;