diff options
Diffstat (limited to '')
292 files changed, 1947 insertions, 1546 deletions
diff --git a/src/archival.cpp b/src/archival.cpp index bdd0620..687e8a3 100644 --- a/src/archival.cpp +++ b/src/archival.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/archival.h b/src/archival.h index 27e6aba..946167a 100644 --- a/src/archival.h +++ b/src/archival.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/archive.cpp b/src/archive.cpp index 7a10921..d300a87 100644 --- a/src/archive.cpp +++ b/src/archive.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/archive.h b/src/archive.h index 9d2aee2..61474a4 100644 --- a/src/archive.h +++ b/src/archive.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -111,7 +111,7 @@ namespace Bu | |||
111 | void readID( const void *ptr, uint32_t id ); | 111 | void readID( const void *ptr, uint32_t id ); |
112 | 112 | ||
113 | template<typename t> | 113 | template<typename t> |
114 | void setProp( const Bu::FString &sId, const t &val ) | 114 | void setProp( const Bu::String &sId, const t &val ) |
115 | { | 115 | { |
116 | if( !hProps.has( sId ) ) | 116 | if( !hProps.has( sId ) ) |
117 | { | 117 | { |
@@ -121,7 +121,7 @@ namespace Bu | |||
121 | } | 121 | } |
122 | 122 | ||
123 | template<typename t> | 123 | template<typename t> |
124 | t getProp( const Bu::FString &sId ) | 124 | t getProp( const Bu::String &sId ) |
125 | { | 125 | { |
126 | return hProps.get( sId ); | 126 | return hProps.get( sId ); |
127 | } | 127 | } |
@@ -131,7 +131,7 @@ namespace Bu | |||
131 | uint32_t nNextID; | 131 | uint32_t nNextID; |
132 | Hash<uint32_t,uint32_t> hPtrID; | 132 | Hash<uint32_t,uint32_t> hPtrID; |
133 | Hash<uint32_t,List<void **> > hPtrDest; | 133 | Hash<uint32_t,List<void **> > hPtrDest; |
134 | Hash<Bu::FString, Variant> hProps; | 134 | Hash<Bu::String, Variant> hProps; |
135 | }; | 135 | }; |
136 | } | 136 | } |
137 | 137 | ||
diff --git a/src/archivebase.cpp b/src/archivebase.cpp index 5ca4c23..d00b1a5 100644 --- a/src/archivebase.cpp +++ b/src/archivebase.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/archivebase.h b/src/archivebase.h index 18591f0..4745d91 100644 --- a/src/archivebase.h +++ b/src/archivebase.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/array.cpp b/src/array.cpp index 62dd132..b776fed 100644 --- a/src/array.cpp +++ b/src/array.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/array.h b/src/array.h index f225c97..f091a81 100644 --- a/src/array.h +++ b/src/array.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/atom.cpp b/src/atom.cpp index 45fdbc5..3c77b90 100644 --- a/src/atom.cpp +++ b/src/atom.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/base64.cpp b/src/base64.cpp index 73ec8f3..18a18e5 100644 --- a/src/base64.cpp +++ b/src/base64.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -64,7 +64,7 @@ void Bu::Base64::start() | |||
64 | { | 64 | { |
65 | } | 65 | } |
66 | 66 | ||
67 | size_t Bu::Base64::stop() | 67 | Bu::size Bu::Base64::stop() |
68 | { | 68 | { |
69 | // if( eMode |= Encode ) | 69 | // if( eMode |= Encode ) |
70 | { | 70 | { |
@@ -89,11 +89,11 @@ size_t Bu::Base64::stop() | |||
89 | // } | 89 | // } |
90 | } | 90 | } |
91 | 91 | ||
92 | size_t Bu::Base64::read( void *pBuf, size_t nBytes ) | 92 | Bu::size Bu::Base64::read( void *pBuf, Bu::size nBytes ) |
93 | { | 93 | { |
94 | if( bEosIn == true && iRPos == iChars ) | 94 | if( bEosIn == true && iRPos == iChars ) |
95 | return 0; | 95 | return 0; |
96 | size_t sIn = 0; | 96 | Bu::size sIn = 0; |
97 | char buf[4]; | 97 | char buf[4]; |
98 | while( sIn < nBytes ) | 98 | while( sIn < nBytes ) |
99 | { | 99 | { |
@@ -153,11 +153,11 @@ size_t Bu::Base64::read( void *pBuf, size_t nBytes ) | |||
153 | return sIn; | 153 | return sIn; |
154 | } | 154 | } |
155 | 155 | ||
156 | size_t Bu::Base64::write( const void *pBuf, size_t nBytes ) | 156 | Bu::size Bu::Base64::write( const void *pBuf, Bu::size nBytes ) |
157 | { | 157 | { |
158 | size_t sOut = 0; | 158 | Bu::size sOut = 0; |
159 | char outBuf[4]; | 159 | char outBuf[4]; |
160 | for( size_t j = 0; j < nBytes; j++ ) | 160 | for( Bu::size j = 0; j < nBytes; j++ ) |
161 | { | 161 | { |
162 | iBuf |= (((uint8_t *)pBuf)[j])<<((2-iBPos++)*8); | 162 | iBuf |= (((uint8_t *)pBuf)[j])<<((2-iBPos++)*8); |
163 | if( iBPos == 3 ) | 163 | if( iBPos == 3 ) |
diff --git a/src/base64.h b/src/base64.h index c4dfd53..53d7860 100644 --- a/src/base64.h +++ b/src/base64.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -26,9 +26,9 @@ namespace Bu | |||
26 | virtual ~Base64(); | 26 | virtual ~Base64(); |
27 | 27 | ||
28 | virtual void start(); | 28 | virtual void start(); |
29 | virtual size_t stop(); | 29 | virtual Bu::size stop(); |
30 | virtual size_t read( void *pBuf, size_t nBytes ); | 30 | virtual Bu::size read( void *pBuf, Bu::size nBytes ); |
31 | virtual size_t write( const void *pBuf, size_t nBytes ); | 31 | virtual Bu::size write( const void *pBuf, Bu::size nBytes ); |
32 | 32 | ||
33 | virtual bool isOpen(); | 33 | virtual bool isOpen(); |
34 | 34 | ||
@@ -40,8 +40,8 @@ namespace Bu | |||
40 | int iRPos; | 40 | int iRPos; |
41 | int iChars; | 41 | int iChars; |
42 | bool bEosIn; | 42 | bool bEosIn; |
43 | size_t iTotalIn; | 43 | Bu::size iTotalIn; |
44 | size_t iTotalOut; | 44 | Bu::size iTotalOut; |
45 | static const char tblEnc[65]; | 45 | static const char tblEnc[65]; |
46 | char tblDec[80]; | 46 | char tblDec[80]; |
47 | enum Mode | 47 | enum Mode |
diff --git a/src/bitstring.cpp b/src/bitstring.cpp index 207a036..bdd1bc2 100644 --- a/src/bitstring.cpp +++ b/src/bitstring.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -444,9 +444,9 @@ long Bu::BitString::getHighestOrderBitPos() | |||
444 | return -1; | 444 | return -1; |
445 | } | 445 | } |
446 | 446 | ||
447 | Bu::FString Bu::BitString::toString() | 447 | Bu::String Bu::BitString::toString() |
448 | { | 448 | { |
449 | Bu::FString sRet; | 449 | Bu::String sRet; |
450 | for( int j = iBits-1; j >= 0; j-- ) | 450 | for( int j = iBits-1; j >= 0; j-- ) |
451 | sRet.append( getBit( j )?'1':'0' ); | 451 | sRet.append( getBit( j )?'1':'0' ); |
452 | return sRet; | 452 | return sRet; |
diff --git a/src/bitstring.h b/src/bitstring.h index 4d0437a..7a8fc48 100644 --- a/src/bitstring.h +++ b/src/bitstring.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -9,7 +9,7 @@ | |||
9 | #define BU_BITSTRING_H | 9 | #define BU_BITSTRING_H |
10 | 10 | ||
11 | #include "bu/util.h" | 11 | #include "bu/util.h" |
12 | #include "bu/fstring.h" | 12 | #include "bu/string.h" |
13 | 13 | ||
14 | namespace Bu | 14 | namespace Bu |
15 | { | 15 | { |
@@ -203,7 +203,7 @@ namespace Bu | |||
203 | */ | 203 | */ |
204 | long toLong( long iStart = 0, long iSize = 32 ); | 204 | long toLong( long iStart = 0, long iSize = 32 ); |
205 | 205 | ||
206 | Bu::FString toString(); | 206 | Bu::String toString(); |
207 | 207 | ||
208 | //operators | 208 | //operators |
209 | BitString &operator=( const BitString &xSrc ); | 209 | BitString &operator=( const BitString &xSrc ); |
diff --git a/src/buffer.cpp b/src/buffer.cpp index 234dc92..b54f97e 100644 --- a/src/buffer.cpp +++ b/src/buffer.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -32,7 +32,7 @@ void Bu::Buffer::start() | |||
32 | { | 32 | { |
33 | } | 33 | } |
34 | 34 | ||
35 | size_t Bu::Buffer::stop() | 35 | Bu::size Bu::Buffer::stop() |
36 | { | 36 | { |
37 | iReadBufFill = iReadPos = iWriteBufFill = iWritePos = 0; | 37 | iReadBufFill = iReadPos = iWriteBufFill = iWritePos = 0; |
38 | return sSoFar; | 38 | return sSoFar; |
@@ -49,7 +49,7 @@ void Bu::Buffer::fillReadBuf() | |||
49 | } | 49 | } |
50 | } | 50 | } |
51 | 51 | ||
52 | size_t Bu::Buffer::read( void *pBuf, size_t nBytes ) | 52 | Bu::size Bu::Buffer::read( void *pBuf, Bu::size nBytes ) |
53 | { | 53 | { |
54 | if( nBytes <= 0 ) | 54 | if( nBytes <= 0 ) |
55 | { | 55 | { |
@@ -57,7 +57,7 @@ size_t Bu::Buffer::read( void *pBuf, size_t nBytes ) | |||
57 | return 0; | 57 | return 0; |
58 | } | 58 | } |
59 | 59 | ||
60 | size_t nTotRead = 0; | 60 | Bu::size nTotRead = 0; |
61 | // fillReadBuf(); | 61 | // fillReadBuf(); |
62 | 62 | ||
63 | do | 63 | do |
@@ -87,9 +87,9 @@ size_t Bu::Buffer::read( void *pBuf, size_t nBytes ) | |||
87 | return nTotRead; | 87 | return nTotRead; |
88 | } | 88 | } |
89 | 89 | ||
90 | size_t Bu::Buffer::write( const void *pBuf, size_t nBytes ) | 90 | Bu::size Bu::Buffer::write( const void *pBuf, Bu::size nBytes ) |
91 | { | 91 | { |
92 | size_t nTotWrote = 0; | 92 | Bu::size nTotWrote = 0; |
93 | 93 | ||
94 | do | 94 | do |
95 | { | 95 | { |
diff --git a/src/buffer.h b/src/buffer.h index 97d4127..17c6d73 100644 --- a/src/buffer.h +++ b/src/buffer.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -19,13 +19,13 @@ namespace Bu | |||
19 | virtual ~Buffer(); | 19 | virtual ~Buffer(); |
20 | 20 | ||
21 | virtual void start(); | 21 | virtual void start(); |
22 | virtual size_t stop(); | 22 | virtual Bu::size stop(); |
23 | 23 | ||
24 | virtual size_t read( void *pBuf, size_t nBytes ); | 24 | virtual Bu::size read( void *pBuf, Bu::size nBytes ); |
25 | virtual size_t write( const void *pBuf, size_t nBytes ); | 25 | virtual Bu::size write( const void *pBuf, Bu::size nBytes ); |
26 | using Stream::write; | 26 | using Stream::write; |
27 | 27 | ||
28 | size_t getReadFill() { return iReadBufFill; } | 28 | Bu::size getReadFill() { return iReadBufFill; } |
29 | bool isWritePending() { return iWriteBufFill > 0; } | 29 | bool isWritePending() { return iWriteBufFill > 0; } |
30 | 30 | ||
31 | virtual void flush(); | 31 | virtual void flush(); |
@@ -36,7 +36,7 @@ namespace Bu | |||
36 | void fillReadBuf(); | 36 | void fillReadBuf(); |
37 | 37 | ||
38 | private: | 38 | private: |
39 | size_t sSoFar; | 39 | Bu::size sSoFar; |
40 | int iBufSize; | 40 | int iBufSize; |
41 | char *sReadBuf; | 41 | char *sReadBuf; |
42 | char *sWriteBuf; | 42 | char *sWriteBuf; |
diff --git a/src/bzip2.cpp b/src/bzip2.cpp index a6fef25..5c35a26 100644 --- a/src/bzip2.cpp +++ b/src/bzip2.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -37,7 +37,7 @@ void Bu::BZip2::start() | |||
37 | pBuf = new char[nBufSize]; | 37 | pBuf = new char[nBufSize]; |
38 | } | 38 | } |
39 | 39 | ||
40 | size_t Bu::BZip2::stop() | 40 | Bu::size Bu::BZip2::stop() |
41 | { | 41 | { |
42 | TRACE(); | 42 | TRACE(); |
43 | if( bzState.state ) | 43 | if( bzState.state ) |
@@ -51,7 +51,7 @@ size_t Bu::BZip2::stop() | |||
51 | } | 51 | } |
52 | else | 52 | else |
53 | { | 53 | { |
54 | // size_t sTotal = 0; | 54 | // Bu::size sTotal = 0; |
55 | for(;;) | 55 | for(;;) |
56 | { | 56 | { |
57 | bzState.next_in = NULL; | 57 | bzState.next_in = NULL; |
@@ -119,7 +119,7 @@ void Bu::BZip2::bzError( int code ) | |||
119 | } | 119 | } |
120 | } | 120 | } |
121 | 121 | ||
122 | size_t Bu::BZip2::read( void *pData, size_t nBytes ) | 122 | Bu::size Bu::BZip2::read( void *pData, Bu::size nBytes ) |
123 | { | 123 | { |
124 | TRACE( pData, nBytes ); | 124 | TRACE( pData, nBytes ); |
125 | if( !bzState.state ) | 125 | if( !bzState.state ) |
@@ -177,7 +177,7 @@ size_t Bu::BZip2::read( void *pData, size_t nBytes ) | |||
177 | return 0; | 177 | return 0; |
178 | } | 178 | } |
179 | 179 | ||
180 | size_t Bu::BZip2::write( const void *pData, size_t nBytes ) | 180 | Bu::size Bu::BZip2::write( const void *pData, Bu::size nBytes ) |
181 | { | 181 | { |
182 | TRACE( pData, nBytes ); | 182 | TRACE( pData, nBytes ); |
183 | if( !bzState.state ) | 183 | if( !bzState.state ) |
@@ -188,7 +188,7 @@ size_t Bu::BZip2::write( const void *pData, size_t nBytes ) | |||
188 | if( bReading == true ) | 188 | if( bReading == true ) |
189 | throw ExceptionBase("This bzip2 filter is in reading mode, you can't write."); | 189 | throw ExceptionBase("This bzip2 filter is in reading mode, you can't write."); |
190 | 190 | ||
191 | // size_t sTotalOut = 0; | 191 | // Bu::size sTotalOut = 0; |
192 | bzState.next_in = (char *)pData; | 192 | bzState.next_in = (char *)pData; |
193 | bzState.avail_in = nBytes; | 193 | bzState.avail_in = nBytes; |
194 | for(;;) | 194 | for(;;) |
@@ -215,7 +215,7 @@ bool Bu::BZip2::isOpen() | |||
215 | return (bzState.state != NULL); | 215 | return (bzState.state != NULL); |
216 | } | 216 | } |
217 | 217 | ||
218 | size_t Bu::BZip2::getCompressedSize() | 218 | Bu::size Bu::BZip2::getCompressedSize() |
219 | { | 219 | { |
220 | return sTotalOut; | 220 | return sTotalOut; |
221 | } | 221 | } |
diff --git a/src/bzip2.h b/src/bzip2.h index 6494cbb..6da3dff 100644 --- a/src/bzip2.h +++ b/src/bzip2.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -26,13 +26,13 @@ namespace Bu | |||
26 | virtual ~BZip2(); | 26 | virtual ~BZip2(); |
27 | 27 | ||
28 | virtual void start(); | 28 | virtual void start(); |
29 | virtual size_t stop(); | 29 | virtual Bu::size stop(); |
30 | virtual size_t read( void *pBuf, size_t nBytes ); | 30 | virtual Bu::size read( void *pBuf, Bu::size nBytes ); |
31 | virtual size_t write( const void *pBuf, size_t nBytes ); | 31 | virtual Bu::size write( const void *pBuf, Bu::size nBytes ); |
32 | 32 | ||
33 | virtual bool isOpen(); | 33 | virtual bool isOpen(); |
34 | 34 | ||
35 | size_t getCompressedSize(); | 35 | Bu::size getCompressedSize(); |
36 | 36 | ||
37 | private: | 37 | private: |
38 | void bzError( int code ); | 38 | void bzError( int code ); |
@@ -41,7 +41,7 @@ namespace Bu | |||
41 | int nCompression; | 41 | int nCompression; |
42 | char *pBuf; | 42 | char *pBuf; |
43 | uint32_t nBufSize; | 43 | uint32_t nBufSize; |
44 | size_t sTotalOut; | 44 | Bu::size sTotalOut; |
45 | }; | 45 | }; |
46 | } | 46 | } |
47 | 47 | ||
diff --git a/src/cache.cpp b/src/cache.cpp index 928da68..52bd9fc 100644 --- a/src/cache.cpp +++ b/src/cache.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/cache.h b/src/cache.h index 7b55b80..926556d 100644 --- a/src/cache.h +++ b/src/cache.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/cachecalc.cpp b/src/cachecalc.cpp index d3ede87..7b8a10a 100644 --- a/src/cachecalc.cpp +++ b/src/cachecalc.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/cachecalc.h b/src/cachecalc.h index e23e6fd..89cfadc 100644 --- a/src/cachecalc.h +++ b/src/cachecalc.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/cachestore.cpp b/src/cachestore.cpp index 9b37e42..af49548 100644 --- a/src/cachestore.cpp +++ b/src/cachestore.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/cachestore.h b/src/cachestore.h index d35bc0a..d0d91a2 100644 --- a/src/cachestore.h +++ b/src/cachestore.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/cachestorefiles.cpp b/src/cachestorefiles.cpp index 7f9d76d..66ce672 100644 --- a/src/cachestorefiles.cpp +++ b/src/cachestorefiles.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/cachestorefiles.h b/src/cachestorefiles.h index c2cf091..426cf83 100644 --- a/src/cachestorefiles.h +++ b/src/cachestorefiles.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -8,7 +8,7 @@ | |||
8 | #ifndef BU_CACHE_STORE_FILES_H | 8 | #ifndef BU_CACHE_STORE_FILES_H |
9 | #define BU_CACHE_STORE_FILES_H | 9 | #define BU_CACHE_STORE_FILES_H |
10 | 10 | ||
11 | #include "bu/fstring.h" | 11 | #include "bu/string.h" |
12 | #include "bu/file.h" | 12 | #include "bu/file.h" |
13 | #include "bu/cachestore.h" | 13 | #include "bu/cachestore.h" |
14 | #include "bu/archive.h" | 14 | #include "bu/archive.h" |
@@ -53,7 +53,7 @@ namespace Bu | |||
53 | class CacheStoreFiles : public CacheStore<keytype, obtype> | 53 | class CacheStoreFiles : public CacheStore<keytype, obtype> |
54 | { | 54 | { |
55 | public: | 55 | public: |
56 | CacheStoreFiles( const Bu::FString &sPrefix ) : | 56 | CacheStoreFiles( const Bu::String &sPrefix ) : |
57 | sPrefix( sPrefix ) | 57 | sPrefix( sPrefix ) |
58 | { | 58 | { |
59 | if( access( sPrefix.getStr(), W_OK|R_OK|X_OK ) ) | 59 | if( access( sPrefix.getStr(), W_OK|R_OK|X_OK ) ) |
@@ -138,7 +138,7 @@ namespace Bu | |||
138 | Bu::MemBuf mb; | 138 | Bu::MemBuf mb; |
139 | Bu::Formatter f( mb ); | 139 | Bu::Formatter f( mb ); |
140 | f << sPrefix << "/"; | 140 | f << sPrefix << "/"; |
141 | Bu::FString sBase = mb.getString(); | 141 | Bu::String sBase = mb.getString(); |
142 | f << key; | 142 | f << key; |
143 | 143 | ||
144 | if( sBase == mb.getString() ) | 144 | if( sBase == mb.getString() ) |
@@ -199,7 +199,7 @@ namespace Bu | |||
199 | } | 199 | } |
200 | 200 | ||
201 | private: | 201 | private: |
202 | Bu::FString sPrefix; | 202 | Bu::String sPrefix; |
203 | }; | 203 | }; |
204 | 204 | ||
205 | }; | 205 | }; |
diff --git a/src/cachestoremyriad.cpp b/src/cachestoremyriad.cpp index b08aea1..9d00dce 100644 --- a/src/cachestoremyriad.cpp +++ b/src/cachestoremyriad.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/cachestoremyriad.h b/src/cachestoremyriad.h index 21c84e6..e632a82 100644 --- a/src/cachestoremyriad.h +++ b/src/cachestoremyriad.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -8,7 +8,7 @@ | |||
8 | #ifndef BU_CACHE_STORE_MYRIAD_H | 8 | #ifndef BU_CACHE_STORE_MYRIAD_H |
9 | #define BU_CACHE_STORE_MYRIAD_H | 9 | #define BU_CACHE_STORE_MYRIAD_H |
10 | 10 | ||
11 | #include "bu/fstring.h" | 11 | #include "bu/string.h" |
12 | #include "bu/stream.h" | 12 | #include "bu/stream.h" |
13 | #include "bu/myriad.h" | 13 | #include "bu/myriad.h" |
14 | #include "bu/cachestore.h" | 14 | #include "bu/cachestore.h" |
diff --git a/src/client.cpp b/src/client.cpp index b635c8b..02e51de 100644 --- a/src/client.cpp +++ b/src/client.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -40,7 +40,7 @@ Bu::Client::~Client() | |||
40 | void Bu::Client::processInput() | 40 | void Bu::Client::processInput() |
41 | { | 41 | { |
42 | char buf[RBS]; | 42 | char buf[RBS]; |
43 | size_t nRead, nTotal=0; | 43 | Bu::size nRead, nTotal=0; |
44 | 44 | ||
45 | for(;;) | 45 | for(;;) |
46 | { | 46 | { |
@@ -109,12 +109,12 @@ void Bu::Client::clearProtocol() | |||
109 | pProto = NULL; | 109 | pProto = NULL; |
110 | } | 110 | } |
111 | /* | 111 | /* |
112 | Bu::FString &Bu::Client::getInput() | 112 | Bu::String &Bu::Client::getInput() |
113 | { | 113 | { |
114 | return sReadBuf; | 114 | return sReadBuf; |
115 | } | 115 | } |
116 | 116 | ||
117 | Bu::FString &Bu::Client::getOutput() | 117 | Bu::String &Bu::Client::getOutput() |
118 | { | 118 | { |
119 | return sWriteBuf; | 119 | return sWriteBuf; |
120 | } | 120 | } |
@@ -126,72 +126,72 @@ bool Bu::Client::isOpen() | |||
126 | return pTopStream->isOpen(); | 126 | return pTopStream->isOpen(); |
127 | } | 127 | } |
128 | 128 | ||
129 | size_t Bu::Client::write( const Bu::FString &sData ) | 129 | Bu::size Bu::Client::write( const Bu::String &sData ) |
130 | { | 130 | { |
131 | return qbWrite.write( sData.getStr(), sData.getSize() ); | 131 | return qbWrite.write( sData.getStr(), sData.getSize() ); |
132 | } | 132 | } |
133 | 133 | ||
134 | size_t Bu::Client::write( const void *pData, size_t nBytes ) | 134 | Bu::size Bu::Client::write( const void *pData, Bu::size nBytes ) |
135 | { | 135 | { |
136 | return qbWrite.write( pData, nBytes ); | 136 | return qbWrite.write( pData, nBytes ); |
137 | } | 137 | } |
138 | 138 | ||
139 | size_t Bu::Client::write( int8_t nData ) | 139 | Bu::size Bu::Client::write( int8_t nData ) |
140 | { | 140 | { |
141 | return qbWrite.write( (const char *)&nData, sizeof(nData) ); | 141 | return qbWrite.write( (const char *)&nData, sizeof(nData) ); |
142 | } | 142 | } |
143 | 143 | ||
144 | size_t Bu::Client::write( int16_t nData ) | 144 | Bu::size Bu::Client::write( int16_t nData ) |
145 | { | 145 | { |
146 | return qbWrite.write( (const char *)&nData, sizeof(nData) ); | 146 | return qbWrite.write( (const char *)&nData, sizeof(nData) ); |
147 | } | 147 | } |
148 | 148 | ||
149 | size_t Bu::Client::write( int32_t nData ) | 149 | Bu::size Bu::Client::write( int32_t nData ) |
150 | { | 150 | { |
151 | return qbWrite.write( (const char *)&nData, sizeof(nData) ); | 151 | return qbWrite.write( (const char *)&nData, sizeof(nData) ); |
152 | } | 152 | } |
153 | 153 | ||
154 | size_t Bu::Client::write( int64_t nData ) | 154 | Bu::size Bu::Client::write( int64_t nData ) |
155 | { | 155 | { |
156 | return qbWrite.write( (const char *)&nData, sizeof(nData) ); | 156 | return qbWrite.write( (const char *)&nData, sizeof(nData) ); |
157 | } | 157 | } |
158 | 158 | ||
159 | size_t Bu::Client::write( uint8_t nData ) | 159 | Bu::size Bu::Client::write( uint8_t nData ) |
160 | { | 160 | { |
161 | return qbWrite.write( (const char *)&nData, sizeof(nData) ); | 161 | return qbWrite.write( (const char *)&nData, sizeof(nData) ); |
162 | } | 162 | } |
163 | 163 | ||
164 | size_t Bu::Client::write( uint16_t nData ) | 164 | Bu::size Bu::Client::write( uint16_t nData ) |
165 | { | 165 | { |
166 | return qbWrite.write( (const char *)&nData, sizeof(nData) ); | 166 | return qbWrite.write( (const char *)&nData, sizeof(nData) ); |
167 | } | 167 | } |
168 | 168 | ||
169 | size_t Bu::Client::write( uint32_t nData ) | 169 | Bu::size Bu::Client::write( uint32_t nData ) |
170 | { | 170 | { |
171 | return qbWrite.write( (const char *)&nData, sizeof(nData) ); | 171 | return qbWrite.write( (const char *)&nData, sizeof(nData) ); |
172 | } | 172 | } |
173 | 173 | ||
174 | size_t Bu::Client::write( uint64_t nData ) | 174 | Bu::size Bu::Client::write( uint64_t nData ) |
175 | { | 175 | { |
176 | return qbWrite.write( (const char *)&nData, sizeof(nData) ); | 176 | return qbWrite.write( (const char *)&nData, sizeof(nData) ); |
177 | } | 177 | } |
178 | 178 | ||
179 | size_t Bu::Client::read( void *pData, size_t nBytes ) | 179 | Bu::size Bu::Client::read( void *pData, Bu::size nBytes ) |
180 | { | 180 | { |
181 | return qbRead.read( pData, nBytes ); | 181 | return qbRead.read( pData, nBytes ); |
182 | } | 182 | } |
183 | 183 | ||
184 | size_t Bu::Client::peek( void *pData, int nBytes, int nOffset ) | 184 | Bu::size Bu::Client::peek( void *pData, int nBytes, int nOffset ) |
185 | { | 185 | { |
186 | return qbRead.peek( pData, nBytes, nOffset ); | 186 | return qbRead.peek( pData, nBytes, nOffset ); |
187 | } | 187 | } |
188 | 188 | ||
189 | long Bu::Client::getInputSize() | 189 | Bu::size Bu::Client::getInputSize() |
190 | { | 190 | { |
191 | return qbRead.getSize(); | 191 | return qbRead.getSize(); |
192 | } | 192 | } |
193 | 193 | ||
194 | long Bu::Client::getOutputSize() | 194 | Bu::size Bu::Client::getOutputSize() |
195 | { | 195 | { |
196 | return qbWrite.getSize(); | 196 | return qbWrite.getSize(); |
197 | } | 197 | } |
@@ -221,7 +221,7 @@ Bu::ClientLink *Bu::Client::getLink() | |||
221 | return pfLink->createLink( this ); | 221 | return pfLink->createLink( this ); |
222 | } | 222 | } |
223 | 223 | ||
224 | void Bu::Client::onMessage( const Bu::FString &sMsg ) | 224 | void Bu::Client::onMessage( const Bu::String &sMsg ) |
225 | { | 225 | { |
226 | if( pProto ) | 226 | if( pProto ) |
227 | pProto->onMessage( this, sMsg ); | 227 | pProto->onMessage( this, sMsg ); |
@@ -233,22 +233,22 @@ void Bu::Client::tick() | |||
233 | pProto->onTick( this ); | 233 | pProto->onTick( this ); |
234 | } | 234 | } |
235 | 235 | ||
236 | long Bu::Client::tell() | 236 | Bu::size Bu::Client::tell() |
237 | { | 237 | { |
238 | return 0; | 238 | return 0; |
239 | } | 239 | } |
240 | 240 | ||
241 | void Bu::Client::seek( long offset ) | 241 | void Bu::Client::seek( Bu::size offset ) |
242 | { | 242 | { |
243 | return qbRead.seek( offset ); | 243 | return qbRead.seek( offset ); |
244 | } | 244 | } |
245 | 245 | ||
246 | void Bu::Client::setPos( long ) | 246 | void Bu::Client::setPos( Bu::size ) |
247 | { | 247 | { |
248 | throw Bu::ExceptionBase(); | 248 | throw Bu::ExceptionBase(); |
249 | } | 249 | } |
250 | 250 | ||
251 | void Bu::Client::setPosEnd( long ) | 251 | void Bu::Client::setPosEnd( Bu::size ) |
252 | { | 252 | { |
253 | throw Bu::ExceptionBase(); | 253 | throw Bu::ExceptionBase(); |
254 | } | 254 | } |
@@ -298,8 +298,23 @@ void Bu::Client::setBlocking( bool ) | |||
298 | throw Bu::ExceptionBase(); | 298 | throw Bu::ExceptionBase(); |
299 | } | 299 | } |
300 | 300 | ||
301 | void Bu::Client::setSize( long ) | 301 | void Bu::Client::setSize( Bu::size ) |
302 | { | 302 | { |
303 | throw Bu::ExceptionBase(); | 303 | throw Bu::ExceptionBase(); |
304 | } | 304 | } |
305 | 305 | ||
306 | Bu::size Bu::Client::getSize() const | ||
307 | { | ||
308 | return 0; | ||
309 | } | ||
310 | |||
311 | Bu::size Bu::Client::getBlockSize() const | ||
312 | { | ||
313 | return pSocket->getBlockSize(); | ||
314 | } | ||
315 | |||
316 | Bu::String Bu::Client::getLocation() const | ||
317 | { | ||
318 | return pSocket->getLocation(); | ||
319 | } | ||
320 | |||
diff --git a/src/client.h b/src/client.h index 096df2f..119c2c1 100644 --- a/src/client.h +++ b/src/client.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -10,7 +10,8 @@ | |||
10 | 10 | ||
11 | #include <stdint.h> | 11 | #include <stdint.h> |
12 | 12 | ||
13 | #include "bu/fstring.h" | 13 | #include "bu/config.h" |
14 | #include "bu/string.h" | ||
14 | #include "bu/queuebuf.h" | 15 | #include "bu/queuebuf.h" |
15 | 16 | ||
16 | namespace Bu | 17 | namespace Bu |
@@ -32,23 +33,23 @@ namespace Bu | |||
32 | void processInput(); | 33 | void processInput(); |
33 | void processOutput(); | 34 | void processOutput(); |
34 | 35 | ||
35 | //Bu::FString &getInput(); | 36 | //Bu::String &getInput(); |
36 | //Bu::FString &getOutput(); | 37 | //Bu::String &getOutput(); |
37 | size_t write( const Bu::FString &sData ); | 38 | Bu::size write( const Bu::String &sData ); |
38 | size_t write( const void *pData, size_t nBytes ); | 39 | Bu::size write( const void *pData, Bu::size nBytes ); |
39 | size_t write( int8_t nData ); | 40 | Bu::size write( int8_t nData ); |
40 | size_t write( int16_t nData ); | 41 | Bu::size write( int16_t nData ); |
41 | size_t write( int32_t nData ); | 42 | Bu::size write( int32_t nData ); |
42 | size_t write( int64_t nData ); | 43 | Bu::size write( int64_t nData ); |
43 | size_t write( uint8_t nData ); | 44 | Bu::size write( uint8_t nData ); |
44 | size_t write( uint16_t nData ); | 45 | Bu::size write( uint16_t nData ); |
45 | size_t write( uint32_t nData ); | 46 | Bu::size write( uint32_t nData ); |
46 | size_t write( uint64_t nData ); | 47 | Bu::size write( uint64_t nData ); |
47 | size_t read( void *pData, size_t nBytes ); | 48 | Bu::size read( void *pData, Bu::size nBytes ); |
48 | size_t peek( void *pData, int nBytes, int nOffset=0 ); | 49 | Bu::size peek( void *pData, int nBytes, int nOffset=0 ); |
49 | // void seek( int nBytes ); | 50 | // void seek( int nBytes ); |
50 | long getInputSize(); | 51 | Bu::size getInputSize(); |
51 | long getOutputSize(); | 52 | Bu::size getOutputSize(); |
52 | 53 | ||
53 | void setProtocol( Protocol *pProto ); | 54 | void setProtocol( Protocol *pProto ); |
54 | Bu::Protocol *getProtocol(); | 55 | Bu::Protocol *getProtocol(); |
@@ -65,7 +66,7 @@ namespace Bu | |||
65 | 66 | ||
66 | class ClientLink *getLink(); | 67 | class ClientLink *getLink(); |
67 | 68 | ||
68 | void onMessage( const Bu::FString &sMsg ); | 69 | void onMessage( const Bu::String &sMsg ); |
69 | 70 | ||
70 | bool hasOutput() { return qbWrite.getSize() > 0; } | 71 | bool hasOutput() { return qbWrite.getSize() > 0; } |
71 | bool hasInput() { return qbRead.getSize() > 0; } | 72 | bool hasInput() { return qbRead.getSize() > 0; } |
@@ -98,10 +99,10 @@ namespace Bu | |||
98 | * These are required to qualify as a stream, I dunno how many will | 99 | * These are required to qualify as a stream, I dunno how many will |
99 | * be implemented. | 100 | * be implemented. |
100 | */ | 101 | */ |
101 | virtual long tell(); | 102 | virtual Bu::size tell(); |
102 | virtual void seek( long offset ); | 103 | virtual void seek( Bu::size offset ); |
103 | virtual void setPos( long pos ); | 104 | virtual void setPos( Bu::size pos ); |
104 | virtual void setPosEnd( long pos ); | 105 | virtual void setPosEnd( Bu::size pos ); |
105 | virtual bool isEos(); | 106 | virtual bool isEos(); |
106 | virtual void flush(); | 107 | virtual void flush(); |
107 | virtual bool canRead(); | 108 | virtual bool canRead(); |
@@ -111,7 +112,10 @@ namespace Bu | |||
111 | virtual bool isSeekable(); | 112 | virtual bool isSeekable(); |
112 | virtual bool isBlocking(); | 113 | virtual bool isBlocking(); |
113 | virtual void setBlocking( bool bBlocking=true ); | 114 | virtual void setBlocking( bool bBlocking=true ); |
114 | virtual void setSize( long iSize ); | 115 | virtual void setSize( Bu::size iSize ); |
116 | virtual size getSize() const; | ||
117 | virtual size getBlockSize() const; | ||
118 | virtual Bu::String getLocation() const; | ||
115 | 119 | ||
116 | private: | 120 | private: |
117 | typedef Bu::List<Bu::Stream *> FilterList; | 121 | typedef Bu::List<Bu::Stream *> FilterList; |
diff --git a/src/clientlink.cpp b/src/clientlink.cpp index 765e6a5..ce8b2cb 100644 --- a/src/clientlink.cpp +++ b/src/clientlink.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/clientlink.h b/src/clientlink.h index aa6d362..e4618e7 100644 --- a/src/clientlink.h +++ b/src/clientlink.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -8,7 +8,7 @@ | |||
8 | #ifndef BU_CLIENT_LINK_H | 8 | #ifndef BU_CLIENT_LINK_H |
9 | #define BU_CLIENT_LINK_H | 9 | #define BU_CLIENT_LINK_H |
10 | 10 | ||
11 | #include "bu/fstring.h" | 11 | #include "bu/string.h" |
12 | 12 | ||
13 | namespace Bu | 13 | namespace Bu |
14 | { | 14 | { |
@@ -18,7 +18,7 @@ namespace Bu | |||
18 | ClientLink(); | 18 | ClientLink(); |
19 | virtual ~ClientLink(); | 19 | virtual ~ClientLink(); |
20 | 20 | ||
21 | virtual void sendMessage( const Bu::FString &sMsg )=0; | 21 | virtual void sendMessage( const Bu::String &sMsg )=0; |
22 | }; | 22 | }; |
23 | }; | 23 | }; |
24 | 24 | ||
diff --git a/src/clientlinkfactory.cpp b/src/clientlinkfactory.cpp index 5f17b50..f48e11e 100644 --- a/src/clientlinkfactory.cpp +++ b/src/clientlinkfactory.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/clientlinkfactory.h b/src/clientlinkfactory.h index a5f033c..21d3363 100644 --- a/src/clientlinkfactory.h +++ b/src/clientlinkfactory.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/compat/linux.h b/src/compat/linux.h index ccc8536..7eaed8e 100644 --- a/src/compat/linux.h +++ b/src/compat/linux.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/compat/osx.h b/src/compat/osx.h index 7169d7e..19628a3 100644 --- a/src/compat/osx.h +++ b/src/compat/osx.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/compat/win32.cpp b/src/compat/win32.cpp index 052644a..b689322 100644 --- a/src/compat/win32.cpp +++ b/src/compat/win32.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -162,7 +162,7 @@ int Bu::Winsock2::__WSAFDIsSet( SOCKET s, fd_set *set ) { | |||
162 | return (*Bu::Winsock2::_fnptr___WSAFDIsSet)( s, set ); | 162 | return (*Bu::Winsock2::_fnptr___WSAFDIsSet)( s, set ); |
163 | } | 163 | } |
164 | 164 | ||
165 | Bu::FString Bu::getLastWinError() | 165 | Bu::String Bu::getLastWinError() |
166 | { | 166 | { |
167 | LPVOID lpMsgBuf; | 167 | LPVOID lpMsgBuf; |
168 | DWORD dw = GetLastError(); | 168 | DWORD dw = GetLastError(); |
@@ -177,7 +177,7 @@ Bu::FString Bu::getLastWinError() | |||
177 | (LPSTR) &lpMsgBuf, | 177 | (LPSTR) &lpMsgBuf, |
178 | 0, NULL ); | 178 | 0, NULL ); |
179 | 179 | ||
180 | Bu::FString sRet( (char *)lpMsgBuf ); | 180 | Bu::String sRet( (char *)lpMsgBuf ); |
181 | 181 | ||
182 | LocalFree(lpMsgBuf); | 182 | LocalFree(lpMsgBuf); |
183 | 183 | ||
diff --git a/src/compat/win32.h b/src/compat/win32.h index ea0ae53..1d82fbe 100644 --- a/src/compat/win32.h +++ b/src/compat/win32.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -18,7 +18,7 @@ extern "C" | |||
18 | } | 18 | } |
19 | #endif | 19 | #endif |
20 | 20 | ||
21 | #include "bu/fstring.h" | 21 | #include "bu/string.h" |
22 | #include "bu/singleton.h" | 22 | #include "bu/singleton.h" |
23 | 23 | ||
24 | #ifndef TEMP_FAILURE_RETRY | 24 | #ifndef TEMP_FAILURE_RETRY |
@@ -90,7 +90,7 @@ namespace Bu | |||
90 | static char *gai_strerror( int iCode ); | 90 | static char *gai_strerror( int iCode ); |
91 | }; | 91 | }; |
92 | 92 | ||
93 | Bu::FString getLastWinError(); | 93 | Bu::String getLastWinError(); |
94 | }; | 94 | }; |
95 | 95 | ||
96 | #ifdef FD_ISSET | 96 | #ifdef FD_ISSET |
diff --git a/src/conduit.cpp b/src/conduit.cpp index 36cda01..bb99526 100644 --- a/src/conduit.cpp +++ b/src/conduit.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/conduit.h b/src/conduit.h index 7125fc5..cc88667 100644 --- a/src/conduit.h +++ b/src/conduit.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -9,7 +9,7 @@ | |||
9 | #define BU_CONDUIT_H | 9 | #define BU_CONDUIT_H |
10 | 10 | ||
11 | #include "bu/stream.h" | 11 | #include "bu/stream.h" |
12 | #include "bu/fstring.h" | 12 | #include "bu/string.h" |
13 | 13 | ||
14 | namespace Bu | 14 | namespace Bu |
15 | { | 15 | { |
diff --git a/src/config.h b/src/config.h index ad4991e..3046b59 100644 --- a/src/config.h +++ b/src/config.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -15,4 +15,6 @@ | |||
15 | #include "bu/compat/osx.h" | 15 | #include "bu/compat/osx.h" |
16 | #include "bu/compat/linux.h" | 16 | #include "bu/compat/linux.h" |
17 | 17 | ||
18 | #include "bu/extratypes.h" | ||
19 | |||
18 | #endif | 20 | #endif |
diff --git a/src/crypt.cpp b/src/crypt.cpp index ae04353..eb87479 100644 --- a/src/crypt.cpp +++ b/src/crypt.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -11,14 +11,14 @@ | |||
11 | #include "bu/membuf.h" | 11 | #include "bu/membuf.h" |
12 | #include "bu/file.h" | 12 | #include "bu/file.h" |
13 | 13 | ||
14 | Bu::FString Bu::cryptPass( const Bu::FString &sPass, const Bu::FString &sSalt ) | 14 | Bu::String Bu::cryptPass( const Bu::String &sPass, const Bu::String &sSalt ) |
15 | { | 15 | { |
16 | Bu::Md5 md5; | 16 | Bu::Md5 md5; |
17 | Bu::MemBuf mbOut; | 17 | Bu::MemBuf mbOut; |
18 | Bu::Base64 b64Out( mbOut ); | 18 | Bu::Base64 b64Out( mbOut ); |
19 | 19 | ||
20 | Bu::FString::const_iterator i = sSalt.find('$'); | 20 | Bu::String::const_iterator i = sSalt.find('$'); |
21 | Bu::FString sSaltSml = sSalt.getSubStr( sSalt.begin(), i ); | 21 | Bu::String sSaltSml = sSalt.getSubStr( sSalt.begin(), i ); |
22 | 22 | ||
23 | md5.addData( sPass ); | 23 | md5.addData( sPass ); |
24 | md5.addData( sSaltSml ); | 24 | md5.addData( sSaltSml ); |
@@ -29,7 +29,7 @@ Bu::FString Bu::cryptPass( const Bu::FString &sPass, const Bu::FString &sSalt ) | |||
29 | return sSaltSml + "$" + mbOut.getString(); | 29 | return sSaltSml + "$" + mbOut.getString(); |
30 | } | 30 | } |
31 | 31 | ||
32 | Bu::FString Bu::cryptPass( const Bu::FString &sPass ) | 32 | Bu::String Bu::cryptPass( const Bu::String &sPass ) |
33 | { | 33 | { |
34 | Bu::MemBuf mbSalt; | 34 | Bu::MemBuf mbSalt; |
35 | Bu::Base64 b64Salt( mbSalt ); | 35 | Bu::Base64 b64Salt( mbSalt ); |
diff --git a/src/crypt.h b/src/crypt.h index cf7fb97..a94402a 100644 --- a/src/crypt.h +++ b/src/crypt.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -8,12 +8,12 @@ | |||
8 | #ifndef BU_CRYPT_H | 8 | #ifndef BU_CRYPT_H |
9 | #define BU_CRYPT_H | 9 | #define BU_CRYPT_H |
10 | 10 | ||
11 | #include "bu/fstring.h" | 11 | #include "bu/string.h" |
12 | 12 | ||
13 | namespace Bu | 13 | namespace Bu |
14 | { | 14 | { |
15 | FString cryptPass( const Bu::FString &sPass, const Bu::FString &sSalt ); | 15 | String cryptPass( const Bu::String &sPass, const Bu::String &sSalt ); |
16 | FString cryptPass( const Bu::FString &sPass ); | 16 | String cryptPass( const Bu::String &sPass ); |
17 | }; | 17 | }; |
18 | 18 | ||
19 | #endif | 19 | #endif |
diff --git a/src/cryptohash.cpp b/src/cryptohash.cpp index 8aee415..ddd293c 100644 --- a/src/cryptohash.cpp +++ b/src/cryptohash.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -15,15 +15,15 @@ Bu::CryptoHash::~CryptoHash() | |||
15 | { | 15 | { |
16 | } | 16 | } |
17 | 17 | ||
18 | void Bu::CryptoHash::addData( const Bu::FString &sData ) | 18 | void Bu::CryptoHash::addData( const Bu::String &sData ) |
19 | { | 19 | { |
20 | addData( sData.getStr(), sData.getSize() ); | 20 | addData( sData.getStr(), sData.getSize() ); |
21 | } | 21 | } |
22 | 22 | ||
23 | Bu::FString Bu::CryptoHash::getHexResult() | 23 | Bu::String Bu::CryptoHash::getHexResult() |
24 | { | 24 | { |
25 | Bu::FString sResult = getResult(); | 25 | Bu::String sResult = getResult(); |
26 | Bu::FString sRet( 2*sResult.getSize() ); | 26 | Bu::String sRet( 2*sResult.getSize() ); |
27 | static const char hex_tab[] = {"0123456789abcdef"}; | 27 | static const char hex_tab[] = {"0123456789abcdef"}; |
28 | 28 | ||
29 | int k = 0; | 29 | int k = 0; |
diff --git a/src/cryptohash.h b/src/cryptohash.h index 5d83895..bc5435f 100644 --- a/src/cryptohash.h +++ b/src/cryptohash.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -8,7 +8,7 @@ | |||
8 | #ifndef BU_CRYPTO_HASH_H | 8 | #ifndef BU_CRYPTO_HASH_H |
9 | #define BU_CRYPTO_HASH_H | 9 | #define BU_CRYPTO_HASH_H |
10 | 10 | ||
11 | #include "bu/fstring.h" | 11 | #include "bu/string.h" |
12 | 12 | ||
13 | namespace Bu | 13 | namespace Bu |
14 | { | 14 | { |
@@ -21,12 +21,12 @@ namespace Bu | |||
21 | virtual ~CryptoHash(); | 21 | virtual ~CryptoHash(); |
22 | 22 | ||
23 | virtual void reset() = 0; | 23 | virtual void reset() = 0; |
24 | virtual void setSalt( const Bu::FString &sSalt ) = 0; | 24 | virtual void setSalt( const Bu::String &sSalt ) = 0; |
25 | virtual void addData( const void *sData, int iSize ) = 0; | 25 | virtual void addData( const void *sData, int iSize ) = 0; |
26 | virtual void addData( const Bu::FString &sData ); | 26 | virtual void addData( const Bu::String &sData ); |
27 | virtual FString getResult() = 0; | 27 | virtual String getResult() = 0; |
28 | virtual void writeResult( Stream &sOut ) = 0; | 28 | virtual void writeResult( Stream &sOut ) = 0; |
29 | virtual Bu::FString getHexResult(); | 29 | virtual Bu::String getHexResult(); |
30 | }; | 30 | }; |
31 | }; | 31 | }; |
32 | 32 | ||
diff --git a/src/csvreader.cpp b/src/csvreader.cpp index f3133c2..4da7883 100644 --- a/src/csvreader.cpp +++ b/src/csvreader.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -41,12 +41,12 @@ Bu::StrArray Bu::CsvReader::readLine() | |||
41 | { | 41 | { |
42 | Bu::StrArray aVals; | 42 | Bu::StrArray aVals; |
43 | 43 | ||
44 | Bu::FString sLine = sIn.readLine(); | 44 | Bu::String sLine = sIn.readLine(); |
45 | 45 | ||
46 | if( !sLine.isSet() ) | 46 | if( !sLine.isSet() ) |
47 | return Bu::StrArray(); | 47 | return Bu::StrArray(); |
48 | 48 | ||
49 | Bu::FString::iterator i = sLine.begin(); | 49 | Bu::String::iterator i = sLine.begin(); |
50 | 50 | ||
51 | aVals.append( sDecode( i ) ); | 51 | aVals.append( sDecode( i ) ); |
52 | 52 | ||
@@ -73,9 +73,9 @@ Bu::StrArray Bu::CsvReader::readLine() | |||
73 | return aVals; | 73 | return aVals; |
74 | } | 74 | } |
75 | 75 | ||
76 | Bu::FString Bu::CsvReader::decodeExcel( Bu::FString::iterator &i ) | 76 | Bu::String Bu::CsvReader::decodeExcel( Bu::String::iterator &i ) |
77 | { | 77 | { |
78 | Bu::FString sRet; | 78 | Bu::String sRet; |
79 | 79 | ||
80 | for(; i && (*i == ' ' || *i == '\t'); i++ ) { } | 80 | for(; i && (*i == ' ' || *i == '\t'); i++ ) { } |
81 | 81 | ||
@@ -123,7 +123,7 @@ Bu::FString Bu::CsvReader::decodeExcel( Bu::FString::iterator &i ) | |||
123 | return sRet; | 123 | return sRet; |
124 | } | 124 | } |
125 | 125 | ||
126 | Bu::FString Bu::CsvReader::decodeC( Bu::FString::iterator & ) | 126 | Bu::String Bu::CsvReader::decodeC( Bu::String::iterator & ) |
127 | { | 127 | { |
128 | return ""; | 128 | return ""; |
129 | } | 129 | } |
diff --git a/src/csvreader.h b/src/csvreader.h index 9ad65fd..2e9e7b0 100644 --- a/src/csvreader.h +++ b/src/csvreader.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -8,19 +8,19 @@ | |||
8 | #ifndef BU_CSV_READER_H | 8 | #ifndef BU_CSV_READER_H |
9 | #define BU_CSV_READER_H | 9 | #define BU_CSV_READER_H |
10 | 10 | ||
11 | #include "bu/fstring.h" | 11 | #include "bu/string.h" |
12 | #include "bu/array.h" | 12 | #include "bu/array.h" |
13 | #include "bu/signals.h" | 13 | #include "bu/signals.h" |
14 | 14 | ||
15 | namespace Bu | 15 | namespace Bu |
16 | { | 16 | { |
17 | class Stream; | 17 | class Stream; |
18 | typedef Bu::Array<Bu::FString> StrArray; | 18 | typedef Bu::Array<Bu::String> StrArray; |
19 | 19 | ||
20 | class CsvReader | 20 | class CsvReader |
21 | { | 21 | { |
22 | public: | 22 | public: |
23 | typedef Bu::Signal1<Bu::FString, Bu::FString::iterator &> DecodeSignal; | 23 | typedef Bu::Signal1<Bu::String, Bu::String::iterator &> DecodeSignal; |
24 | enum Style | 24 | enum Style |
25 | { | 25 | { |
26 | styleExcel, ///< Excel style quotes around things that need em | 26 | styleExcel, ///< Excel style quotes around things that need em |
@@ -37,8 +37,8 @@ namespace Bu | |||
37 | Stream &sIn; | 37 | Stream &sIn; |
38 | DecodeSignal sDecode; | 38 | DecodeSignal sDecode; |
39 | 39 | ||
40 | static Bu::FString decodeExcel( Bu::FString::iterator &i ); | 40 | static Bu::String decodeExcel( Bu::String::iterator &i ); |
41 | static Bu::FString decodeC( Bu::FString::iterator &i ); | 41 | static Bu::String decodeC( Bu::String::iterator &i ); |
42 | }; | 42 | }; |
43 | }; | 43 | }; |
44 | 44 | ||
diff --git a/src/csvwriter.cpp b/src/csvwriter.cpp index 3e2816b..58437b8 100644 --- a/src/csvwriter.cpp +++ b/src/csvwriter.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -36,7 +36,7 @@ Bu::CsvWriter::~CsvWriter() | |||
36 | 36 | ||
37 | void Bu::CsvWriter::writeLine( const StrArray &aStrs ) | 37 | void Bu::CsvWriter::writeLine( const StrArray &aStrs ) |
38 | { | 38 | { |
39 | Bu::FString sBuf; | 39 | Bu::String sBuf; |
40 | for( StrArray::const_iterator i = aStrs.begin(); i; i++ ) | 40 | for( StrArray::const_iterator i = aStrs.begin(); i; i++ ) |
41 | { | 41 | { |
42 | if( i != aStrs.begin() ) | 42 | if( i != aStrs.begin() ) |
@@ -48,12 +48,12 @@ void Bu::CsvWriter::writeLine( const StrArray &aStrs ) | |||
48 | sOut.write( sBuf ); | 48 | sOut.write( sBuf ); |
49 | } | 49 | } |
50 | 50 | ||
51 | Bu::FString Bu::CsvWriter::encodeExcel( const Bu::FString &sIn ) | 51 | Bu::String Bu::CsvWriter::encodeExcel( const Bu::String &sIn ) |
52 | { | 52 | { |
53 | if( sIn.find('\"') ) | 53 | if( sIn.find('\"') ) |
54 | { | 54 | { |
55 | Bu::FString sOut = "\""; | 55 | Bu::String sOut = "\""; |
56 | for( Bu::FString::const_iterator i = sIn.begin(); i; i++ ) | 56 | for( Bu::String::const_iterator i = sIn.begin(); i; i++ ) |
57 | { | 57 | { |
58 | if( *i == '\"' ) | 58 | if( *i == '\"' ) |
59 | sOut += "\"\""; | 59 | sOut += "\"\""; |
@@ -65,10 +65,10 @@ Bu::FString Bu::CsvWriter::encodeExcel( const Bu::FString &sIn ) | |||
65 | return sIn; | 65 | return sIn; |
66 | } | 66 | } |
67 | 67 | ||
68 | Bu::FString Bu::CsvWriter::encodeC( const Bu::FString &sIn ) | 68 | Bu::String Bu::CsvWriter::encodeC( const Bu::String &sIn ) |
69 | { | 69 | { |
70 | Bu::FString sOut = ""; | 70 | Bu::String sOut = ""; |
71 | for( Bu::FString::const_iterator i = sIn.begin(); i; i++ ) | 71 | for( Bu::String::const_iterator i = sIn.begin(); i; i++ ) |
72 | { | 72 | { |
73 | if( *i == ',' ) | 73 | if( *i == ',' ) |
74 | sOut += "\\,"; | 74 | sOut += "\\,"; |
diff --git a/src/csvwriter.h b/src/csvwriter.h index 289d25c..4291ed5 100644 --- a/src/csvwriter.h +++ b/src/csvwriter.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -8,19 +8,19 @@ | |||
8 | #ifndef BU_CSV_WRITER_H | 8 | #ifndef BU_CSV_WRITER_H |
9 | #define BU_CSV_WRITER_H | 9 | #define BU_CSV_WRITER_H |
10 | 10 | ||
11 | #include "bu/fstring.h" | 11 | #include "bu/string.h" |
12 | #include "bu/array.h" | 12 | #include "bu/array.h" |
13 | #include "bu/signals.h" | 13 | #include "bu/signals.h" |
14 | 14 | ||
15 | namespace Bu | 15 | namespace Bu |
16 | { | 16 | { |
17 | class Stream; | 17 | class Stream; |
18 | typedef Bu::Array<Bu::FString> StrArray; | 18 | typedef Bu::Array<Bu::String> StrArray; |
19 | 19 | ||
20 | class CsvWriter | 20 | class CsvWriter |
21 | { | 21 | { |
22 | public: | 22 | public: |
23 | typedef Bu::Signal1<Bu::FString, const Bu::FString &> EncodeSignal; | 23 | typedef Bu::Signal1<Bu::String, const Bu::String &> EncodeSignal; |
24 | enum Style | 24 | enum Style |
25 | { | 25 | { |
26 | styleExcel, ///< Excel style quotes around things that need em | 26 | styleExcel, ///< Excel style quotes around things that need em |
@@ -37,8 +37,8 @@ namespace Bu | |||
37 | Stream &sOut; | 37 | Stream &sOut; |
38 | EncodeSignal sEncode; | 38 | EncodeSignal sEncode; |
39 | 39 | ||
40 | static Bu::FString encodeExcel( const Bu::FString &sIn ); | 40 | static Bu::String encodeExcel( const Bu::String &sIn ); |
41 | static Bu::FString encodeC( const Bu::FString &sIn ); | 41 | static Bu::String encodeC( const Bu::String &sIn ); |
42 | }; | 42 | }; |
43 | }; | 43 | }; |
44 | 44 | ||
diff --git a/src/doxy/archives.dox b/src/doxy/archives.dox index 1eaa1e5..7155227 100644 --- a/src/doxy/archives.dox +++ b/src/doxy/archives.dox | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/doxy/formatting.dox b/src/doxy/formatting.dox index 6787461..7acb9de 100644 --- a/src/doxy/formatting.dox +++ b/src/doxy/formatting.dox | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/doxy/groups.dox b/src/doxy/groups.dox index 58d5d05..479186a 100644 --- a/src/doxy/groups.dox +++ b/src/doxy/groups.dox | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/doxy/main.dox b/src/doxy/main.dox index c4c3ada..2964ee5 100644 --- a/src/doxy/main.dox +++ b/src/doxy/main.dox | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/doxy/params.dox b/src/doxy/params.dox index 74e7ddc..78c3e63 100644 --- a/src/doxy/params.dox +++ b/src/doxy/params.dox | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/doxy/plugins.dox b/src/doxy/plugins.dox index b29e6a4..d913430 100644 --- a/src/doxy/plugins.dox +++ b/src/doxy/plugins.dox | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/doxy/servers.dox b/src/doxy/servers.dox index 7bda7c1..c344b8a 100644 --- a/src/doxy/servers.dox +++ b/src/doxy/servers.dox | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/doxy/streams.dox b/src/doxy/streams.dox index 0be3736..c039804 100644 --- a/src/doxy/streams.dox +++ b/src/doxy/streams.dox | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/doxy/taf.dox b/src/doxy/taf.dox index d8a5410..15692f4 100644 --- a/src/doxy/taf.dox +++ b/src/doxy/taf.dox | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/doxy/threading.dox b/src/doxy/threading.dox index 0ecf1f4..9a04ecb 100644 --- a/src/doxy/threading.dox +++ b/src/doxy/threading.dox | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/doxy/unittest.dox b/src/doxy/unittest.dox index 24e1de4..5304551 100644 --- a/src/doxy/unittest.dox +++ b/src/doxy/unittest.dox | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/exceptionbase.cpp b/src/exceptionbase.cpp index 3b4f87a..13a98db 100644 --- a/src/exceptionbase.cpp +++ b/src/exceptionbase.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/exceptionbase.h b/src/exceptionbase.h index c92962f..b6ad9ca 100644 --- a/src/exceptionbase.h +++ b/src/exceptionbase.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/extratypes.h b/src/extratypes.h new file mode 100644 index 0000000..0dd92db --- /dev/null +++ b/src/extratypes.h | |||
@@ -0,0 +1,26 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. | ||
3 | * | ||
4 | * This file is part of the libbu++ library and is released under the | ||
5 | * terms of the license contained in the file LICENSE. | ||
6 | */ | ||
7 | |||
8 | #ifndef EXTRA_TYPES_H | ||
9 | #define EXTRA_TYPES_H | ||
10 | |||
11 | #include "bu/config.h" | ||
12 | |||
13 | #include <stdint.h> | ||
14 | |||
15 | namespace Bu | ||
16 | { | ||
17 | #ifdef USE_64BIT_IO | ||
18 | typedef int64_t size; | ||
19 | typedef uint64_t usize; | ||
20 | #else | ||
21 | typedef int32_t size; | ||
22 | typedef uint32_t usize; | ||
23 | #endif | ||
24 | }; | ||
25 | |||
26 | #endif | ||
diff --git a/src/fastcgi.cpp b/src/fastcgi.cpp index ca3010e..2f9161e 100644 --- a/src/fastcgi.cpp +++ b/src/fastcgi.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -114,14 +114,14 @@ void Bu::FastCgi::readPair( Bu::TcpSocket &s, StrHash &hParams, uint16_t &uRead | |||
114 | uRead += uName + uValue; | 114 | uRead += uName + uValue; |
115 | unsigned char *sName = new unsigned char[uName]; | 115 | unsigned char *sName = new unsigned char[uName]; |
116 | s.read( sName, uName ); | 116 | s.read( sName, uName ); |
117 | Bu::FString fsName( (char *)sName, uName ); | 117 | Bu::String fsName( (char *)sName, uName ); |
118 | delete[] sName; | 118 | delete[] sName; |
119 | 119 | ||
120 | if( uValue > 0 ) | 120 | if( uValue > 0 ) |
121 | { | 121 | { |
122 | unsigned char *sValue = new unsigned char[uValue]; | 122 | unsigned char *sValue = new unsigned char[uValue]; |
123 | s.read( sValue, uValue ); | 123 | s.read( sValue, uValue ); |
124 | Bu::FString fsValue( (char *)sValue, uValue ); | 124 | Bu::String fsValue( (char *)sValue, uValue ); |
125 | hParams.insert( fsName, fsValue ); | 125 | hParams.insert( fsName, fsValue ); |
126 | delete[] sValue; | 126 | delete[] sValue; |
127 | } | 127 | } |
@@ -305,8 +305,8 @@ void Bu::FastCgi::run() | |||
305 | mStdOut, mStdErr | 305 | mStdOut, mStdErr |
306 | ); | 306 | ); |
307 | 307 | ||
308 | Bu::FString &sStdOut = mStdOut.getString(); | 308 | Bu::String &sStdOut = mStdOut.getString(); |
309 | Bu::FString &sStdErr = mStdErr.getString(); | 309 | Bu::String &sStdErr = mStdErr.getString(); |
310 | 310 | ||
311 | Record rOut; | 311 | Record rOut; |
312 | memset( &rOut, 0, sizeof(rOut) ); | 312 | memset( &rOut, 0, sizeof(rOut) ); |
diff --git a/src/fastcgi.h b/src/fastcgi.h index 7c1c04c..1a3d02e 100644 --- a/src/fastcgi.h +++ b/src/fastcgi.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -8,7 +8,7 @@ | |||
8 | #ifndef BU_FAST_CGI_H | 8 | #ifndef BU_FAST_CGI_H |
9 | #define BU_FAST_CGI_H | 9 | #define BU_FAST_CGI_H |
10 | 10 | ||
11 | #include "bu/fstring.h" | 11 | #include "bu/string.h" |
12 | #include "bu/hash.h" | 12 | #include "bu/hash.h" |
13 | #include "bu/array.h" | 13 | #include "bu/array.h" |
14 | #include "bu/tcpsocket.h" | 14 | #include "bu/tcpsocket.h" |
@@ -27,7 +27,7 @@ namespace Bu | |||
27 | 27 | ||
28 | static bool isEmbedded(); | 28 | static bool isEmbedded(); |
29 | 29 | ||
30 | typedef Bu::Hash<Bu::FString, Bu::FString> StrHash; | 30 | typedef Bu::Hash<Bu::String, Bu::String> StrHash; |
31 | enum RequestType | 31 | enum RequestType |
32 | { | 32 | { |
33 | typeBeginRequest = 1, | 33 | typeBeginRequest = 1, |
@@ -86,8 +86,8 @@ namespace Bu | |||
86 | typedef struct Channel { | 86 | typedef struct Channel { |
87 | Channel() : uFlags( 0 ) { } | 87 | Channel() : uFlags( 0 ) { } |
88 | StrHash hParams; | 88 | StrHash hParams; |
89 | Bu::FString sStdIn; | 89 | Bu::String sStdIn; |
90 | Bu::FString sData; | 90 | Bu::String sData; |
91 | uint8_t uFlags; | 91 | uint8_t uFlags; |
92 | } Channel; | 92 | } Channel; |
93 | 93 | ||
@@ -104,7 +104,7 @@ namespace Bu | |||
104 | 104 | ||
105 | virtual void onInit() { }; | 105 | virtual void onInit() { }; |
106 | virtual int onRequest( const StrHash &hParams, | 106 | virtual int onRequest( const StrHash &hParams, |
107 | const Bu::FString &sStdIn, Bu::Stream &sStdOut, | 107 | const Bu::String &sStdIn, Bu::Stream &sStdOut, |
108 | Bu::Stream &sStdErr )=0; | 108 | Bu::Stream &sStdErr )=0; |
109 | virtual void onUninit() { }; | 109 | virtual void onUninit() { }; |
110 | 110 | ||
diff --git a/src/fbasicstring.cpp b/src/fbasicstring.cpp deleted file mode 100644 index 4834301..0000000 --- a/src/fbasicstring.cpp +++ /dev/null | |||
@@ -1,9 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | ||
3 | * | ||
4 | * This file is part of the libbu++ library and is released under the | ||
5 | * terms of the license contained in the file LICENSE. | ||
6 | */ | ||
7 | |||
8 | #include "bu/fbasicstring.h" | ||
9 | |||
diff --git a/src/fifo.cpp b/src/fifo.cpp index d1fa960..b0cf1c7 100644 --- a/src/fifo.cpp +++ b/src/fifo.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -16,7 +16,7 @@ | |||
16 | 16 | ||
17 | namespace Bu { subExceptionDef( FifoException ) } | 17 | namespace Bu { subExceptionDef( FifoException ) } |
18 | 18 | ||
19 | Bu::Fifo::Fifo( const Bu::FString &sName, int iFlags, mode_t mAcc ) : | 19 | Bu::Fifo::Fifo( const Bu::String &sName, int iFlags, mode_t mAcc ) : |
20 | iFlags( iFlags ), | 20 | iFlags( iFlags ), |
21 | iIn( -1 ), | 21 | iIn( -1 ), |
22 | iOut( -1 ) | 22 | iOut( -1 ) |
@@ -67,7 +67,7 @@ void Bu::Fifo::close() | |||
67 | } | 67 | } |
68 | } | 68 | } |
69 | 69 | ||
70 | size_t Bu::Fifo::read( void *pBuf, size_t nBytes ) | 70 | Bu::size Bu::Fifo::read( void *pBuf, Bu::size nBytes ) |
71 | { | 71 | { |
72 | if( iIn < 0 ) | 72 | if( iIn < 0 ) |
73 | throw FifoException("Fifo not open for reading."); | 73 | throw FifoException("Fifo not open for reading."); |
@@ -75,7 +75,7 @@ size_t Bu::Fifo::read( void *pBuf, size_t nBytes ) | |||
75 | return TEMP_FAILURE_RETRY( ::read( iIn, pBuf, nBytes ) ); | 75 | return TEMP_FAILURE_RETRY( ::read( iIn, pBuf, nBytes ) ); |
76 | } | 76 | } |
77 | 77 | ||
78 | size_t Bu::Fifo::write( const void *pBuf, size_t nBytes ) | 78 | Bu::size Bu::Fifo::write( const void *pBuf, Bu::size nBytes ) |
79 | { | 79 | { |
80 | if( iOut < 0 ) | 80 | if( iOut < 0 ) |
81 | throw FifoException("Fifo not open for writing."); | 81 | throw FifoException("Fifo not open for writing."); |
@@ -83,20 +83,20 @@ size_t Bu::Fifo::write( const void *pBuf, size_t nBytes ) | |||
83 | return TEMP_FAILURE_RETRY( ::write( iOut, pBuf, nBytes ) ); | 83 | return TEMP_FAILURE_RETRY( ::write( iOut, pBuf, nBytes ) ); |
84 | } | 84 | } |
85 | 85 | ||
86 | long Bu::Fifo::tell() | 86 | Bu::size Bu::Fifo::tell() |
87 | { | 87 | { |
88 | return -1; | 88 | return -1; |
89 | } | 89 | } |
90 | 90 | ||
91 | void Bu::Fifo::seek( long ) | 91 | void Bu::Fifo::seek( Bu::size ) |
92 | { | 92 | { |
93 | } | 93 | } |
94 | 94 | ||
95 | void Bu::Fifo::setPos( long ) | 95 | void Bu::Fifo::setPos( Bu::size ) |
96 | { | 96 | { |
97 | } | 97 | } |
98 | 98 | ||
99 | void Bu::Fifo::setPosEnd( long ) | 99 | void Bu::Fifo::setPosEnd( Bu::size ) |
100 | { | 100 | { |
101 | } | 101 | } |
102 | 102 | ||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -13,7 +13,7 @@ | |||
13 | #include <stdlib.h> | 13 | #include <stdlib.h> |
14 | 14 | ||
15 | #include "bu/stream.h" | 15 | #include "bu/stream.h" |
16 | #include "bu/fstring.h" | 16 | #include "bu/string.h" |
17 | #include "bu/exceptionbase.h" | 17 | #include "bu/exceptionbase.h" |
18 | 18 | ||
19 | namespace Bu | 19 | namespace Bu |
@@ -27,18 +27,18 @@ namespace Bu | |||
27 | class Fifo : public Bu::Stream | 27 | class Fifo : public Bu::Stream |
28 | { | 28 | { |
29 | public: | 29 | public: |
30 | Fifo( const Bu::FString &sName, int iFlags, mode_t mAcc=-1 ); | 30 | Fifo( const Bu::String &sName, int iFlags, mode_t mAcc=-1 ); |
31 | virtual ~Fifo(); | 31 | virtual ~Fifo(); |
32 | 32 | ||
33 | virtual void close(); | 33 | virtual void close(); |
34 | virtual size_t read( void *pBuf, size_t nBytes ); | 34 | virtual Bu::size read( void *pBuf, Bu::size nBytes ); |
35 | virtual size_t write( const void *pBuf, size_t nBytes ); | 35 | virtual Bu::size write( const void *pBuf, Bu::size nBytes ); |
36 | using Stream::write; | 36 | using Stream::write; |
37 | 37 | ||
38 | virtual long tell(); | 38 | virtual Bu::size tell(); |
39 | virtual void seek( long offset ); | 39 | virtual void seek( Bu::size offset ); |
40 | virtual void setPos( long pos ); | 40 | virtual void setPos( Bu::size pos ); |
41 | virtual void setPosEnd( long pos ); | 41 | virtual void setPosEnd( Bu::size pos ); |
42 | virtual bool isEos(); | 42 | virtual bool isEos(); |
43 | virtual bool isOpen(); | 43 | virtual bool isOpen(); |
44 | 44 | ||
diff --git a/src/file.cpp b/src/file.cpp index 008b88e..09d53de 100644 --- a/src/file.cpp +++ b/src/file.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -17,7 +17,7 @@ | |||
17 | 17 | ||
18 | namespace Bu { subExceptionDef( FileException ) } | 18 | namespace Bu { subExceptionDef( FileException ) } |
19 | 19 | ||
20 | Bu::File::File( const Bu::FString &sName, int iFlags ) : | 20 | Bu::File::File( const Bu::String &sName, int iFlags ) : |
21 | fd( -1 ), | 21 | fd( -1 ), |
22 | bEos( true ) | 22 | bEos( true ) |
23 | { | 23 | { |
@@ -59,12 +59,12 @@ void Bu::File::close() | |||
59 | } | 59 | } |
60 | } | 60 | } |
61 | 61 | ||
62 | size_t Bu::File::read( void *pBuf, size_t nBytes ) | 62 | Bu::size Bu::File::read( void *pBuf, Bu::size nBytes ) |
63 | { | 63 | { |
64 | if( fd < 0 ) | 64 | if( fd < 0 ) |
65 | throw FileException("File not open."); | 65 | throw FileException("File not open."); |
66 | 66 | ||
67 | ssize_t iRead = ::read( fd, pBuf, nBytes ); | 67 | Bu::size iRead = ::read( fd, pBuf, nBytes ); |
68 | if( iRead == 0 ) | 68 | if( iRead == 0 ) |
69 | bEos = true; | 69 | bEos = true; |
70 | else if( iRead == -1 && errno == EAGAIN ) | 70 | else if( iRead == -1 && errno == EAGAIN ) |
@@ -74,18 +74,18 @@ size_t Bu::File::read( void *pBuf, size_t nBytes ) | |||
74 | return iRead; | 74 | return iRead; |
75 | } | 75 | } |
76 | 76 | ||
77 | size_t Bu::File::write( const void *pBuf, size_t nBytes ) | 77 | Bu::size Bu::File::write( const void *pBuf, Bu::size nBytes ) |
78 | { | 78 | { |
79 | if( fd < 0 ) | 79 | if( fd < 0 ) |
80 | throw FileException("File not open."); | 80 | throw FileException("File not open."); |
81 | 81 | ||
82 | ssize_t iWrote = ::write( fd, pBuf, nBytes ); | 82 | Bu::size iWrote = ::write( fd, pBuf, nBytes ); |
83 | if( iWrote < 0 ) | 83 | if( iWrote < 0 ) |
84 | throw FileException( errno, "%s", strerror( errno ) ); | 84 | throw FileException( errno, "%s", strerror( errno ) ); |
85 | return iWrote; | 85 | return iWrote; |
86 | } | 86 | } |
87 | 87 | ||
88 | long Bu::File::tell() | 88 | Bu::size Bu::File::tell() |
89 | { | 89 | { |
90 | if( fd < 0 ) | 90 | if( fd < 0 ) |
91 | throw FileException("File not open."); | 91 | throw FileException("File not open."); |
@@ -93,7 +93,7 @@ long Bu::File::tell() | |||
93 | return lseek( fd, 0, SEEK_CUR ); | 93 | return lseek( fd, 0, SEEK_CUR ); |
94 | } | 94 | } |
95 | 95 | ||
96 | void Bu::File::seek( long offset ) | 96 | void Bu::File::seek( Bu::size offset ) |
97 | { | 97 | { |
98 | if( fd < 0 ) | 98 | if( fd < 0 ) |
99 | throw FileException("File not open."); | 99 | throw FileException("File not open."); |
@@ -102,7 +102,7 @@ void Bu::File::seek( long offset ) | |||
102 | bEos = false; | 102 | bEos = false; |
103 | } | 103 | } |
104 | 104 | ||
105 | void Bu::File::setPos( long pos ) | 105 | void Bu::File::setPos( Bu::size pos ) |
106 | { | 106 | { |
107 | if( fd < 0 ) | 107 | if( fd < 0 ) |
108 | throw FileException("File not open."); | 108 | throw FileException("File not open."); |
@@ -111,7 +111,7 @@ void Bu::File::setPos( long pos ) | |||
111 | bEos = false; | 111 | bEos = false; |
112 | } | 112 | } |
113 | 113 | ||
114 | void Bu::File::setPosEnd( long pos ) | 114 | void Bu::File::setPosEnd( Bu::size pos ) |
115 | { | 115 | { |
116 | if( fd < 0 ) | 116 | if( fd < 0 ) |
117 | throw FileException("File not open."); | 117 | throw FileException("File not open."); |
@@ -187,7 +187,7 @@ void Bu::File::setBlocking( bool bBlocking ) | |||
187 | #endif | 187 | #endif |
188 | } | 188 | } |
189 | 189 | ||
190 | Bu::File Bu::File::tempFile( Bu::FString &sName ) | 190 | Bu::File Bu::File::tempFile( Bu::String &sName ) |
191 | { | 191 | { |
192 | uint32_t iX; | 192 | uint32_t iX; |
193 | iX = time( NULL ) + getpid(); | 193 | iX = time( NULL ) + getpid(); |
@@ -218,7 +218,7 @@ Bu::File Bu::File::tempFile( Bu::FString &sName ) | |||
218 | " iterations."); | 218 | " iterations."); |
219 | } | 219 | } |
220 | 220 | ||
221 | void Bu::File::setSize( long iSize ) | 221 | void Bu::File::setSize( Bu::size iSize ) |
222 | { | 222 | { |
223 | #ifdef WIN32 | 223 | #ifdef WIN32 |
224 | chsize( fd, iSize ); | 224 | chsize( fd, iSize ); |
@@ -227,6 +227,25 @@ void Bu::File::setSize( long iSize ) | |||
227 | #endif | 227 | #endif |
228 | } | 228 | } |
229 | 229 | ||
230 | Bu::size Bu::File::getSize() const | ||
231 | { | ||
232 | struct stat st; | ||
233 | fstat( fd, &st ); | ||
234 | return st.st_size; | ||
235 | } | ||
236 | |||
237 | Bu::size Bu::File::getBlockSize() const | ||
238 | { | ||
239 | struct stat st; | ||
240 | fstat( fd, &st ); | ||
241 | return st.st_blksize; | ||
242 | } | ||
243 | |||
244 | Bu::String Bu::File::getLocation() const | ||
245 | { | ||
246 | return "to be implemented"; | ||
247 | } | ||
248 | |||
230 | #ifndef WIN32 | 249 | #ifndef WIN32 |
231 | void Bu::File::chmod( mode_t t ) | 250 | void Bu::File::chmod( mode_t t ) |
232 | { | 251 | { |
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -12,7 +12,7 @@ | |||
12 | #include <sys/types.h> | 12 | #include <sys/types.h> |
13 | 13 | ||
14 | #include "bu/stream.h" | 14 | #include "bu/stream.h" |
15 | #include "bu/fstring.h" | 15 | #include "bu/string.h" |
16 | #include "bu/exceptionbase.h" | 16 | #include "bu/exceptionbase.h" |
17 | 17 | ||
18 | namespace Bu | 18 | namespace Bu |
@@ -26,19 +26,19 @@ namespace Bu | |||
26 | class File : public Bu::Stream | 26 | class File : public Bu::Stream |
27 | { | 27 | { |
28 | public: | 28 | public: |
29 | File( const Bu::FString &sName, int iFlags ); | 29 | File( const Bu::String &sName, int iFlags ); |
30 | File( int fd ); | 30 | File( int fd ); |
31 | virtual ~File(); | 31 | virtual ~File(); |
32 | 32 | ||
33 | virtual void close(); | 33 | virtual void close(); |
34 | virtual size_t read( void *pBuf, size_t nBytes ); | 34 | virtual Bu::size read( void *pBuf, Bu::size nBytes ); |
35 | virtual size_t write( const void *pBuf, size_t nBytes ); | 35 | virtual Bu::size write( const void *pBuf, Bu::size nBytes ); |
36 | using Stream::write; | 36 | using Stream::write; |
37 | 37 | ||
38 | virtual long tell(); | 38 | virtual Bu::size tell(); |
39 | virtual void seek( long offset ); | 39 | virtual void seek( Bu::size offset ); |
40 | virtual void setPos( long pos ); | 40 | virtual void setPos( Bu::size pos ); |
41 | virtual void setPosEnd( long pos ); | 41 | virtual void setPosEnd( Bu::size pos ); |
42 | virtual bool isEos(); | 42 | virtual bool isEos(); |
43 | virtual bool isOpen(); | 43 | virtual bool isOpen(); |
44 | 44 | ||
@@ -70,17 +70,21 @@ namespace Bu | |||
70 | /// Same as Write|Create|Truncate | 70 | /// Same as Write|Create|Truncate |
71 | }; | 71 | }; |
72 | 72 | ||
73 | virtual void setSize( long iSize ); | 73 | virtual void setSize( Bu::size iSize ); |
74 | |||
75 | virtual size getSize() const; | ||
76 | virtual size getBlockSize() const; | ||
77 | virtual Bu::String getLocation() const; | ||
74 | 78 | ||
75 | /** | 79 | /** |
76 | * Create a temp file and return its handle. The file is opened | 80 | * Create a temp file and return its handle. The file is opened |
77 | * Read/Write. | 81 | * Read/Write. |
78 | *@param sName (Bu::FString) Give in the form: "/tmp/tmpfileXXXXXXXX" | 82 | *@param sName (Bu::String) Give in the form: "/tmp/tmpfileXXXXXXXX" |
79 | * It will alter your (sName) setting the 'X's to random | 83 | * It will alter your (sName) setting the 'X's to random |
80 | * characters. | 84 | * characters. |
81 | *@returns (Bu::File) A file object representing your temp file. | 85 | *@returns (Bu::File) A file object representing your temp file. |
82 | */ | 86 | */ |
83 | static Bu::File tempFile( Bu::FString &sName ); | 87 | static Bu::File tempFile( Bu::String &sName ); |
84 | 88 | ||
85 | #ifndef WIN32 | 89 | #ifndef WIN32 |
86 | /** | 90 | /** |
diff --git a/src/filter.cpp b/src/filter.cpp index 900baaa..3fe8f0e 100644 --- a/src/filter.cpp +++ b/src/filter.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -22,22 +22,22 @@ void Bu::Filter::close() | |||
22 | rNext.close(); | 22 | rNext.close(); |
23 | } | 23 | } |
24 | 24 | ||
25 | long Bu::Filter::tell() | 25 | Bu::size Bu::Filter::tell() |
26 | { | 26 | { |
27 | return rNext.tell(); | 27 | return rNext.tell(); |
28 | } | 28 | } |
29 | 29 | ||
30 | void Bu::Filter::seek( long offset ) | 30 | void Bu::Filter::seek( Bu::size offset ) |
31 | { | 31 | { |
32 | rNext.seek( offset ); | 32 | rNext.seek( offset ); |
33 | } | 33 | } |
34 | 34 | ||
35 | void Bu::Filter::setPos( long pos ) | 35 | void Bu::Filter::setPos( Bu::size pos ) |
36 | { | 36 | { |
37 | rNext.setPos( pos ); | 37 | rNext.setPos( pos ); |
38 | } | 38 | } |
39 | 39 | ||
40 | void Bu::Filter::setPosEnd( long pos ) | 40 | void Bu::Filter::setPosEnd( Bu::size pos ) |
41 | { | 41 | { |
42 | rNext.setPosEnd( pos ); | 42 | rNext.setPosEnd( pos ); |
43 | } | 43 | } |
@@ -87,7 +87,7 @@ void Bu::Filter::setBlocking( bool bBlocking ) | |||
87 | rNext.setBlocking( bBlocking ); | 87 | rNext.setBlocking( bBlocking ); |
88 | } | 88 | } |
89 | 89 | ||
90 | void Bu::Filter::setSize( long ) | 90 | void Bu::Filter::setSize( Bu::size ) |
91 | { | 91 | { |
92 | } | 92 | } |
93 | 93 | ||
@@ -96,3 +96,18 @@ void Bu::Filter::flush() | |||
96 | rNext.flush(); | 96 | rNext.flush(); |
97 | } | 97 | } |
98 | 98 | ||
99 | Bu::size Bu::Filter::getSize() const | ||
100 | { | ||
101 | return rNext.getSize(); | ||
102 | } | ||
103 | |||
104 | Bu::size Bu::Filter::getBlockSize() const | ||
105 | { | ||
106 | return rNext.getBlockSize(); | ||
107 | } | ||
108 | |||
109 | Bu::String Bu::Filter::getLocation() const | ||
110 | { | ||
111 | return rNext.getLocation(); | ||
112 | } | ||
113 | |||
diff --git a/src/filter.h b/src/filter.h index 5507daa..2c57805 100644 --- a/src/filter.h +++ b/src/filter.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -41,12 +41,12 @@ namespace Bu | |||
41 | virtual ~Filter(); | 41 | virtual ~Filter(); |
42 | 42 | ||
43 | virtual void start()=0; | 43 | virtual void start()=0; |
44 | virtual size_t stop()=0; | 44 | virtual Bu::size stop()=0; |
45 | virtual void close(); | 45 | virtual void close(); |
46 | virtual long tell(); | 46 | virtual Bu::size tell(); |
47 | virtual void seek( long offset ); | 47 | virtual void seek( Bu::size offset ); |
48 | virtual void setPos( long pos ); | 48 | virtual void setPos( Bu::size pos ); |
49 | virtual void setPosEnd( long pos ); | 49 | virtual void setPosEnd( Bu::size pos ); |
50 | virtual bool isEos(); | 50 | virtual bool isEos(); |
51 | virtual bool isOpen(); | 51 | virtual bool isOpen(); |
52 | 52 | ||
@@ -66,8 +66,12 @@ namespace Bu | |||
66 | * Most filters won't re-implement this, it doesn't make a lot of sense | 66 | * Most filters won't re-implement this, it doesn't make a lot of sense |
67 | * for filters, in general. | 67 | * for filters, in general. |
68 | */ | 68 | */ |
69 | virtual void setSize( long iSize ); | 69 | virtual void setSize( Bu::size iSize ); |
70 | 70 | ||
71 | virtual size getSize() const; | ||
72 | virtual size getBlockSize() const; | ||
73 | virtual Bu::String getLocation() const; | ||
74 | |||
71 | protected: | 75 | protected: |
72 | Bu::Stream &rNext; | 76 | Bu::Stream &rNext; |
73 | 77 | ||
diff --git a/src/formatter.cpp b/src/formatter.cpp index 7eaa1e2..f73d46e 100644 --- a/src/formatter.cpp +++ b/src/formatter.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -21,7 +21,7 @@ Bu::Formatter::~Formatter() | |||
21 | { | 21 | { |
22 | } | 22 | } |
23 | 23 | ||
24 | void Bu::Formatter::write( const Bu::FString &sStr ) | 24 | void Bu::Formatter::write( const Bu::String &sStr ) |
25 | { | 25 | { |
26 | rStream.write( sStr ); | 26 | rStream.write( sStr ); |
27 | } | 27 | } |
@@ -31,7 +31,7 @@ void Bu::Formatter::write( const void *sStr, int iLen ) | |||
31 | rStream.write( sStr, iLen ); | 31 | rStream.write( sStr, iLen ); |
32 | } | 32 | } |
33 | 33 | ||
34 | void Bu::Formatter::writeAligned( const Bu::FString &sStr ) | 34 | void Bu::Formatter::writeAligned( const Bu::String &sStr ) |
35 | { | 35 | { |
36 | int iLen = sStr.getSize(); | 36 | int iLen = sStr.getSize(); |
37 | if( iLen > fLast.uMinWidth ) | 37 | if( iLen > fLast.uMinWidth ) |
@@ -117,9 +117,9 @@ void Bu::Formatter::read( void *sStr, int iLen ) | |||
117 | rStream.read( sStr, iLen ); | 117 | rStream.read( sStr, iLen ); |
118 | } | 118 | } |
119 | 119 | ||
120 | Bu::FString Bu::Formatter::readToken() | 120 | Bu::String Bu::Formatter::readToken() |
121 | { | 121 | { |
122 | Bu::FString sRet; | 122 | Bu::String sRet; |
123 | if( fLast.bTokenize ) | 123 | if( fLast.bTokenize ) |
124 | { | 124 | { |
125 | for(;;) | 125 | for(;;) |
@@ -292,7 +292,7 @@ Bu::Formatter &Bu::operator<<( Bu::Formatter &f, char *sStr ) | |||
292 | return f; | 292 | return f; |
293 | } | 293 | } |
294 | 294 | ||
295 | Bu::Formatter &Bu::operator<<( Bu::Formatter &f, const Bu::FString &sStr ) | 295 | Bu::Formatter &Bu::operator<<( Bu::Formatter &f, const Bu::String &sStr ) |
296 | { | 296 | { |
297 | f.writeAligned( sStr ); | 297 | f.writeAligned( sStr ); |
298 | return f; | 298 | return f; |
@@ -388,7 +388,7 @@ Bu::Formatter &Bu::operator<<( Bu::Formatter &f, bool b ) | |||
388 | return f; | 388 | return f; |
389 | } | 389 | } |
390 | 390 | ||
391 | Bu::Formatter &Bu::operator>>( Bu::Formatter &f, Bu::FString &sStr ) | 391 | Bu::Formatter &Bu::operator>>( Bu::Formatter &f, Bu::String &sStr ) |
392 | { | 392 | { |
393 | sStr = f.readToken(); | 393 | sStr = f.readToken(); |
394 | return f; | 394 | return f; |
@@ -480,7 +480,7 @@ Bu::Formatter &Bu::operator>>( Bu::Formatter &f, long double &flt ) | |||
480 | 480 | ||
481 | Bu::Formatter &Bu::operator>>( Bu::Formatter &f, bool &b ) | 481 | Bu::Formatter &Bu::operator>>( Bu::Formatter &f, bool &b ) |
482 | { | 482 | { |
483 | Bu::FString sStr = f.readToken(); | 483 | Bu::String sStr = f.readToken(); |
484 | if( !sStr.isSet() ) | 484 | if( !sStr.isSet() ) |
485 | return f; | 485 | return f; |
486 | char c = *sStr.begin(); | 486 | char c = *sStr.begin(); |
diff --git a/src/formatter.h b/src/formatter.h index 7e0c54b..49507de 100644 --- a/src/formatter.h +++ b/src/formatter.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -103,13 +103,13 @@ namespace Bu | |||
103 | unsigned short bTokenize : 1; | 103 | unsigned short bTokenize : 1; |
104 | } Fmt; | 104 | } Fmt; |
105 | 105 | ||
106 | void write( const Bu::FString &sStr ); | 106 | void write( const Bu::String &sStr ); |
107 | void write( const void *sStr, int iLen ); | 107 | void write( const void *sStr, int iLen ); |
108 | void writeAligned( const Bu::FString &sStr ); | 108 | void writeAligned( const Bu::String &sStr ); |
109 | void writeAligned( const char *sStr, int iLen ); | 109 | void writeAligned( const char *sStr, int iLen ); |
110 | 110 | ||
111 | void read( void *sStr, int iLen ); | 111 | void read( void *sStr, int iLen ); |
112 | Bu::FString readToken(); | 112 | Bu::String readToken(); |
113 | 113 | ||
114 | void incIndent(); | 114 | void incIndent(); |
115 | void decIndent(); | 115 | void decIndent(); |
@@ -199,7 +199,7 @@ namespace Bu | |||
199 | template<typename type> | 199 | template<typename type> |
200 | void ffmt( type f ) | 200 | void ffmt( type f ) |
201 | { | 201 | { |
202 | Bu::FString fTmp; | 202 | Bu::String fTmp; |
203 | fTmp.format("%f", f ); | 203 | fTmp.format("%f", f ); |
204 | // writeAligned("**make floats work**"); | 204 | // writeAligned("**make floats work**"); |
205 | writeAligned( fTmp ); | 205 | writeAligned( fTmp ); |
@@ -207,7 +207,7 @@ namespace Bu | |||
207 | } | 207 | } |
208 | 208 | ||
209 | template<typename type> | 209 | template<typename type> |
210 | void iparse( type &i, const Bu::FString &sBuf ) | 210 | void iparse( type &i, const Bu::String &sBuf ) |
211 | { | 211 | { |
212 | if( !sBuf.isSet() ) | 212 | if( !sBuf.isSet() ) |
213 | return; | 213 | return; |
@@ -233,7 +233,7 @@ namespace Bu | |||
233 | } | 233 | } |
234 | 234 | ||
235 | template<typename type> | 235 | template<typename type> |
236 | void uparse( type &i, const Bu::FString &sBuf ) | 236 | void uparse( type &i, const Bu::String &sBuf ) |
237 | { | 237 | { |
238 | if( !sBuf.isSet() ) | 238 | if( !sBuf.isSet() ) |
239 | return; | 239 | return; |
@@ -257,7 +257,7 @@ namespace Bu | |||
257 | } | 257 | } |
258 | 258 | ||
259 | template<typename type> | 259 | template<typename type> |
260 | void fparse( type &f, const Bu::FString &sBuf ) | 260 | void fparse( type &f, const Bu::String &sBuf ) |
261 | { | 261 | { |
262 | sscanf( sBuf.getStr(), "%f", &f ); | 262 | sscanf( sBuf.getStr(), "%f", &f ); |
263 | usedFormat(); | 263 | usedFormat(); |
@@ -288,7 +288,7 @@ namespace Bu | |||
288 | Formatter &operator<<( Formatter &f, Formatter::Special s ); | 288 | Formatter &operator<<( Formatter &f, Formatter::Special s ); |
289 | Formatter &operator<<( Formatter &f, const char *sStr ); | 289 | Formatter &operator<<( Formatter &f, const char *sStr ); |
290 | Formatter &operator<<( Formatter &f, char *sStr ); | 290 | Formatter &operator<<( Formatter &f, char *sStr ); |
291 | Formatter &operator<<( Formatter &f, const Bu::FString &sStr ); | 291 | Formatter &operator<<( Formatter &f, const Bu::String &sStr ); |
292 | Formatter &operator<<( Formatter &f, signed char c ); | 292 | Formatter &operator<<( Formatter &f, signed char c ); |
293 | Formatter &operator<<( Formatter &f, char c ); | 293 | Formatter &operator<<( Formatter &f, char c ); |
294 | Formatter &operator<<( Formatter &f, unsigned char c ); | 294 | Formatter &operator<<( Formatter &f, unsigned char c ); |
@@ -305,7 +305,7 @@ namespace Bu | |||
305 | Formatter &operator<<( Formatter &f, long double flt ); | 305 | Formatter &operator<<( Formatter &f, long double flt ); |
306 | Formatter &operator<<( Formatter &f, bool b ); | 306 | Formatter &operator<<( Formatter &f, bool b ); |
307 | 307 | ||
308 | Formatter &operator>>( Formatter &f, Bu::FString &sStr ); | 308 | Formatter &operator>>( Formatter &f, Bu::String &sStr ); |
309 | Formatter &operator>>( Formatter &f, signed char &c ); | 309 | Formatter &operator>>( Formatter &f, signed char &c ); |
310 | Formatter &operator>>( Formatter &f, char &c ); | 310 | Formatter &operator>>( Formatter &f, char &c ); |
311 | Formatter &operator>>( Formatter &f, unsigned char &c ); | 311 | Formatter &operator>>( Formatter &f, unsigned char &c ); |
diff --git a/src/formula.cpp b/src/formula.cpp index d8612eb..ac435ed 100644 --- a/src/formula.cpp +++ b/src/formula.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/formula.h b/src/formula.h index d93e27b..687e6c3 100644 --- a/src/formula.h +++ b/src/formula.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -17,7 +17,7 @@ | |||
17 | #include "bu/stack.h" | 17 | #include "bu/stack.h" |
18 | #include "bu/exceptionbase.h" | 18 | #include "bu/exceptionbase.h" |
19 | #include "bu/hash.h" | 19 | #include "bu/hash.h" |
20 | #include "bu/fstring.h" | 20 | #include "bu/string.h" |
21 | 21 | ||
22 | namespace Bu | 22 | namespace Bu |
23 | { | 23 | { |
@@ -41,8 +41,8 @@ namespace Bu | |||
41 | virtual prec operator()( prec )=0; | 41 | virtual prec operator()( prec )=0; |
42 | }; | 42 | }; |
43 | 43 | ||
44 | typedef Hash<Bu::FString, prec> varHash; | 44 | typedef Hash<Bu::String, prec> varHash; |
45 | typedef Hash<Bu::FString, Func *> funcHash; | 45 | typedef Hash<Bu::String, Func *> funcHash; |
46 | 46 | ||
47 | Formula() | 47 | Formula() |
48 | { | 48 | { |
@@ -57,7 +57,7 @@ namespace Bu | |||
57 | } | 57 | } |
58 | } | 58 | } |
59 | 59 | ||
60 | prec run( const Bu::FString &sFormulaSrc ) | 60 | prec run( const Bu::String &sFormulaSrc ) |
61 | { | 61 | { |
62 | if( sFormulaSrc.isEmpty() ) | 62 | if( sFormulaSrc.isEmpty() ) |
63 | throw FormulaException("Empty formula, nothing to do."); | 63 | throw FormulaException("Empty formula, nothing to do."); |
@@ -158,7 +158,7 @@ namespace Bu | |||
158 | 158 | ||
159 | Bu::Stack<symType> sOper; | 159 | Bu::Stack<symType> sOper; |
160 | Bu::Stack<prec> sValue; | 160 | Bu::Stack<prec> sValue; |
161 | Bu::Stack<Bu::FString> sFunc; | 161 | Bu::Stack<Bu::String> sFunc; |
162 | 162 | ||
163 | private: | 163 | private: |
164 | symType getPrec( symType nOper ) | 164 | symType getPrec( symType nOper ) |
diff --git a/src/fstring.h b/src/fstring.h deleted file mode 100644 index 0f9d81a..0000000 --- a/src/fstring.h +++ /dev/null | |||
@@ -1,53 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | ||
3 | * | ||
4 | * This file is part of the libbu++ library and is released under the | ||
5 | * terms of the license contained in the file LICENSE. | ||
6 | */ | ||
7 | |||
8 | #ifndef BU_F_STRING_H | ||
9 | #define BU_F_STRING_H | ||
10 | |||
11 | #include "bu/fbasicstring.h" | ||
12 | |||
13 | namespace Bu | ||
14 | { | ||
15 | typedef FBasicString<char> FString; | ||
16 | |||
17 | template<typename T> | ||
18 | uint32_t __calcHashCode( const T &k ); | ||
19 | |||
20 | template<typename T> | ||
21 | bool __cmpHashKeys( const T &a, const T &b ); | ||
22 | |||
23 | template<> uint32_t __calcHashCode<FString>( const FString &k ); | ||
24 | template<> bool __cmpHashKeys<FString>( | ||
25 | const FString &a, const FString &b ); | ||
26 | |||
27 | template<typename t> void __tracer_format( const t &v ); | ||
28 | template<> void __tracer_format<FString>( const FString &v ); | ||
29 | |||
30 | bool &operator<<( bool &dst, const FString &sIn ); | ||
31 | uint8_t &operator<<( uint8_t &dst, const FString &sIn ); | ||
32 | int8_t &operator<<( int8_t &dst, const FString &sIn ); | ||
33 | char &operator<<( char &dst, const FString &sIn ); | ||
34 | uint16_t &operator<<( uint16_t &dst, const FString &sIn ); | ||
35 | int16_t &operator<<( int16_t &dst, const FString &sIn ); | ||
36 | uint32_t &operator<<( uint32_t &dst, const FString &sIn ); | ||
37 | int32_t &operator<<( int32_t &dst, const FString &sIn ); | ||
38 | uint64_t &operator<<( uint64_t &dst, const FString &sIn ); | ||
39 | int64_t &operator<<( int64_t &dst, const FString &sIn ); | ||
40 | float &operator<<( float &dst, const FString &sIn ); | ||
41 | double &operator<<( double &dst, const FString &sIn ); | ||
42 | long double &operator<<( long double &dst, const FString &sIn ); | ||
43 | Bu::FString &operator<<( Bu::FString &dst, const FString &sIn ); | ||
44 | |||
45 | } | ||
46 | |||
47 | /***** I dunno about this block, I don't really want to have it... ***** | ||
48 | #include <ostream> | ||
49 | std::basic_ostream<char>& operator<< (std::basic_ostream<char> &os, | ||
50 | const Bu::FString &val ); | ||
51 | */ | ||
52 | |||
53 | #endif | ||
diff --git a/src/hash.cpp b/src/hash.cpp index a2052b8..59572ec 100644 --- a/src/hash.cpp +++ b/src/hash.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -411,7 +411,7 @@ namespace Bu | |||
411 | * In order to use it, I recommend the following for all basic usage: | 411 | * In order to use it, I recommend the following for all basic usage: |
412 | *@code | 412 | *@code |
413 | // Define a Hash typedef with strings as keys and ints as values. | 413 | // Define a Hash typedef with strings as keys and ints as values. |
414 | typedef Bu::Hash<Bu::FString, int> StrIntHash; | 414 | typedef Bu::Hash<Bu::String, int> StrIntHash; |
415 | 415 | ||
416 | // Create one | 416 | // Create one |
417 | StrIntHash hInts; | 417 | StrIntHash hInts; |
diff --git a/src/heap.cpp b/src/heap.cpp index 0f959da..a2ffac2 100644 --- a/src/heap.cpp +++ b/src/heap.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/httpget.cpp b/src/httpget.cpp index 2347167..99492a2 100644 --- a/src/httpget.cpp +++ b/src/httpget.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -7,7 +7,7 @@ | |||
7 | 7 | ||
8 | #include "bu/httpget.h" | 8 | #include "bu/httpget.h" |
9 | 9 | ||
10 | Bu::HttpGet::HttpGet( const Bu::Url &uSrc, const Bu::FString &sMethod ) : | 10 | Bu::HttpGet::HttpGet( const Bu::Url &uSrc, const Bu::String &sMethod ) : |
11 | uSrc( uSrc ), | 11 | uSrc( uSrc ), |
12 | sMethod( sMethod ), | 12 | sMethod( sMethod ), |
13 | sSrv( uSrc.getHost(), uSrc.getPort() ) | 13 | sSrv( uSrc.getHost(), uSrc.getPort() ) |
@@ -34,30 +34,30 @@ void Bu::HttpGet::get() | |||
34 | // sSrv.read( | 34 | // sSrv.read( |
35 | } | 35 | } |
36 | 36 | ||
37 | size_t Bu::HttpGet::read( void * /*pBuf*/, size_t /*nBytes*/ ) | 37 | Bu::size Bu::HttpGet::read( void * /*pBuf*/, Bu::size /*nBytes*/ ) |
38 | { | 38 | { |
39 | return 0; | 39 | return 0; |
40 | } | 40 | } |
41 | 41 | ||
42 | size_t Bu::HttpGet::write( const void * /*pBuf*/, size_t /*nBytes*/ ) | 42 | Bu::size Bu::HttpGet::write( const void * /*pBuf*/, Bu::size /*nBytes*/ ) |
43 | { | 43 | { |
44 | return 0; | 44 | return 0; |
45 | } | 45 | } |
46 | 46 | ||
47 | long Bu::HttpGet::tell() | 47 | Bu::size Bu::HttpGet::tell() |
48 | { | 48 | { |
49 | return 0; | 49 | return 0; |
50 | } | 50 | } |
51 | 51 | ||
52 | void Bu::HttpGet::seek( long ) | 52 | void Bu::HttpGet::seek( Bu::size ) |
53 | { | 53 | { |
54 | } | 54 | } |
55 | 55 | ||
56 | void Bu::HttpGet::setPos( long ) | 56 | void Bu::HttpGet::setPos( Bu::size ) |
57 | { | 57 | { |
58 | } | 58 | } |
59 | 59 | ||
60 | void Bu::HttpGet::setPosEnd( long ) | 60 | void Bu::HttpGet::setPosEnd( Bu::size ) |
61 | { | 61 | { |
62 | } | 62 | } |
63 | 63 | ||
@@ -109,3 +109,18 @@ void Bu::HttpGet::setBlocking( bool /*bBlocking*/ ) | |||
109 | { | 109 | { |
110 | } | 110 | } |
111 | 111 | ||
112 | Bu::size Bu::HttpGet::getSize() const | ||
113 | { | ||
114 | return 0; | ||
115 | } | ||
116 | |||
117 | Bu::size Bu::HttpGet::getBlockSize() const | ||
118 | { | ||
119 | return 0; | ||
120 | } | ||
121 | |||
122 | Bu::String Bu::HttpGet::getLocation() const | ||
123 | { | ||
124 | return uSrc.getUrl(); | ||
125 | } | ||
126 | |||
diff --git a/src/httpget.h b/src/httpget.h index 783f880..a58e8ac 100644 --- a/src/httpget.h +++ b/src/httpget.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -9,7 +9,7 @@ | |||
9 | #define BU_HTTP_GET_H | 9 | #define BU_HTTP_GET_H |
10 | 10 | ||
11 | #include "bu/stream.h" | 11 | #include "bu/stream.h" |
12 | #include "bu/fstring.h" | 12 | #include "bu/string.h" |
13 | #include "bu/url.h" | 13 | #include "bu/url.h" |
14 | #include "bu/tcpsocket.h" | 14 | #include "bu/tcpsocket.h" |
15 | #include "bu/hash.h" | 15 | #include "bu/hash.h" |
@@ -19,21 +19,21 @@ namespace Bu | |||
19 | class HttpGet : public Bu::Stream | 19 | class HttpGet : public Bu::Stream |
20 | { | 20 | { |
21 | public: | 21 | public: |
22 | HttpGet( const Bu::Url &uSrc, const Bu::FString &sMethod="GET" ); | 22 | HttpGet( const Bu::Url &uSrc, const Bu::String &sMethod="GET" ); |
23 | virtual ~HttpGet(); | 23 | virtual ~HttpGet(); |
24 | 24 | ||
25 | void get(); | 25 | void get(); |
26 | 26 | ||
27 | // From Bu::Stream | 27 | // From Bu::Stream |
28 | virtual void close(); | 28 | virtual void close(); |
29 | virtual size_t read( void *pBuf, size_t nBytes ); | 29 | virtual Bu::size read( void *pBuf, Bu::size nBytes ); |
30 | virtual size_t write( const void *pBuf, size_t nBytes ); | 30 | virtual Bu::size write( const void *pBuf, Bu::size nBytes ); |
31 | using Stream::write; | 31 | using Stream::write; |
32 | 32 | ||
33 | virtual long tell(); | 33 | virtual Bu::size tell(); |
34 | virtual void seek( long offset ); | 34 | virtual void seek( Bu::size offset ); |
35 | virtual void setPos( long pos ); | 35 | virtual void setPos( Bu::size pos ); |
36 | virtual void setPosEnd( long pos ); | 36 | virtual void setPosEnd( Bu::size pos ); |
37 | virtual bool isEos(); | 37 | virtual bool isEos(); |
38 | virtual bool isOpen(); | 38 | virtual bool isOpen(); |
39 | 39 | ||
@@ -49,11 +49,15 @@ namespace Bu | |||
49 | virtual bool isBlocking(); | 49 | virtual bool isBlocking(); |
50 | virtual void setBlocking( bool bBlocking=true ); | 50 | virtual void setBlocking( bool bBlocking=true ); |
51 | 51 | ||
52 | virtual size getSize() const; | ||
53 | virtual size getBlockSize() const; | ||
54 | virtual Bu::String getLocation() const; | ||
55 | |||
52 | private: | 56 | private: |
53 | Bu::Url uSrc; | 57 | Bu::Url uSrc; |
54 | Bu::FString sMethod; | 58 | Bu::String sMethod; |
55 | Bu::TcpSocket sSrv; | 59 | Bu::TcpSocket sSrv; |
56 | typedef Bu::Hash<Bu::FString,Bu::FString> MimeHash; | 60 | typedef Bu::Hash<Bu::String,Bu::String> MimeHash; |
57 | MimeHash hMimeIn; | 61 | MimeHash hMimeIn; |
58 | MimeHash hMimeOut; | 62 | MimeHash hMimeOut; |
59 | }; | 63 | }; |
diff --git a/src/ito.cpp b/src/ito.cpp index 12aee6f..aa9a597 100644 --- a/src/ito.cpp +++ b/src/ito.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/itoatom.h b/src/itoatom.h index 20ef911..3659f4e 100644 --- a/src/itoatom.h +++ b/src/itoatom.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/itocondition.cpp b/src/itocondition.cpp index ddf8d0d..3d8db60 100644 --- a/src/itocondition.cpp +++ b/src/itocondition.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/itocondition.h b/src/itocondition.h index 6468728..88e8d6c 100644 --- a/src/itocondition.h +++ b/src/itocondition.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/itocounter.cpp b/src/itocounter.cpp index 9f71a77..0c6e06c 100644 --- a/src/itocounter.cpp +++ b/src/itocounter.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/itocounter.h b/src/itocounter.h index 6f52175..10df467 100644 --- a/src/itocounter.h +++ b/src/itocounter.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/itoheap.cpp b/src/itoheap.cpp index 546edea..21ccef8 100644 --- a/src/itoheap.cpp +++ b/src/itoheap.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/itoheap.h b/src/itoheap.h index 7fdbba3..a5aad05 100644 --- a/src/itoheap.h +++ b/src/itoheap.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/itomutex.cpp b/src/itomutex.cpp index 4c6ae4c..8de6336 100644 --- a/src/itomutex.cpp +++ b/src/itomutex.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/itomutex.h b/src/itomutex.h index 6cf08b4..68a0c1d 100644 --- a/src/itomutex.h +++ b/src/itomutex.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/itoqueue.h b/src/itoqueue.h index 6801c91..dc3cadb 100644 --- a/src/itoqueue.h +++ b/src/itoqueue.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/itoserver.cpp b/src/itoserver.cpp index ea737bf..9f03417 100644 --- a/src/itoserver.cpp +++ b/src/itoserver.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -47,7 +47,7 @@ void Bu::ItoServer::addPort( int nPort, int nPoolSize ) | |||
47 | hServers.insert( nSocket, s ); | 47 | hServers.insert( nSocket, s ); |
48 | } | 48 | } |
49 | 49 | ||
50 | void Bu::ItoServer::addPort( const FString &sAddr, int nPort, int nPoolSize ) | 50 | void Bu::ItoServer::addPort( const String &sAddr, int nPort, int nPoolSize ) |
51 | { | 51 | { |
52 | TcpServerSocket *s = new TcpServerSocket( sAddr, nPort, nPoolSize ); | 52 | TcpServerSocket *s = new TcpServerSocket( sAddr, nPort, nPoolSize ); |
53 | int nSocket = s->getSocket(); | 53 | int nSocket = s->getSocket(); |
@@ -163,7 +163,7 @@ void Bu::ItoServer::ItoClient::run() | |||
163 | while( !qMsg.isEmpty() ) | 163 | while( !qMsg.isEmpty() ) |
164 | { | 164 | { |
165 | imProto.lock(); | 165 | imProto.lock(); |
166 | Bu::FString *pMsg = qMsg.dequeue(); | 166 | Bu::String *pMsg = qMsg.dequeue(); |
167 | pClient->onMessage( *pMsg ); | 167 | pClient->onMessage( *pMsg ); |
168 | delete pMsg; | 168 | delete pMsg; |
169 | pClient->processOutput(); | 169 | pClient->processOutput(); |
@@ -205,7 +205,7 @@ Bu::ItoServer::SrvClientLink::~SrvClientLink() | |||
205 | { | 205 | { |
206 | } | 206 | } |
207 | 207 | ||
208 | void Bu::ItoServer::SrvClientLink::sendMessage( const Bu::FString &sMsg ) | 208 | void Bu::ItoServer::SrvClientLink::sendMessage( const Bu::String &sMsg ) |
209 | { | 209 | { |
210 | if( !pClient->imProto.trylock() ) | 210 | if( !pClient->imProto.trylock() ) |
211 | { | 211 | { |
@@ -215,7 +215,7 @@ void Bu::ItoServer::SrvClientLink::sendMessage( const Bu::FString &sMsg ) | |||
215 | } | 215 | } |
216 | else | 216 | else |
217 | { | 217 | { |
218 | Bu::FString *pMsg = new Bu::FString( sMsg ); | 218 | Bu::String *pMsg = new Bu::String( sMsg ); |
219 | pClient->qMsg.enqueue( pMsg ); | 219 | pClient->qMsg.enqueue( pMsg ); |
220 | } | 220 | } |
221 | } | 221 | } |
diff --git a/src/itoserver.h b/src/itoserver.h index 81e42cc..902c684 100644 --- a/src/itoserver.h +++ b/src/itoserver.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -14,7 +14,7 @@ | |||
14 | #include <sys/select.h> | 14 | #include <sys/select.h> |
15 | #endif | 15 | #endif |
16 | 16 | ||
17 | #include "bu/fstring.h" | 17 | #include "bu/string.h" |
18 | #include "bu/list.h" | 18 | #include "bu/list.h" |
19 | #include "bu/ito.h" | 19 | #include "bu/ito.h" |
20 | #include "bu/itomutex.h" | 20 | #include "bu/itomutex.h" |
@@ -59,7 +59,7 @@ namespace Bu | |||
59 | virtual ~ItoServer(); | 59 | virtual ~ItoServer(); |
60 | 60 | ||
61 | void addPort( int nPort, int nPoolSize=40 ); | 61 | void addPort( int nPort, int nPoolSize=40 ); |
62 | void addPort( const FString &sAddr, int nPort, int nPoolSize=40 ); | 62 | void addPort( const String &sAddr, int nPort, int nPoolSize=40 ); |
63 | 63 | ||
64 | //void scan(); | 64 | //void scan(); |
65 | void setTimeout( int nTimeoutSec, int nTimeoutUSec=0 ); | 65 | void setTimeout( int nTimeoutSec, int nTimeoutUSec=0 ); |
@@ -82,7 +82,7 @@ namespace Bu | |||
82 | int nTimeoutSec, int nTimeoutUSec ); | 82 | int nTimeoutSec, int nTimeoutUSec ); |
83 | virtual ~ItoClient(); | 83 | virtual ~ItoClient(); |
84 | 84 | ||
85 | typedef ItoQueue<Bu::FString *> StringQueue; | 85 | typedef ItoQueue<Bu::String *> StringQueue; |
86 | StringQueue qMsg; | 86 | StringQueue qMsg; |
87 | 87 | ||
88 | protected: | 88 | protected: |
@@ -105,7 +105,7 @@ namespace Bu | |||
105 | SrvClientLink( ItoClient *pClient ); | 105 | SrvClientLink( ItoClient *pClient ); |
106 | virtual ~SrvClientLink(); | 106 | virtual ~SrvClientLink(); |
107 | 107 | ||
108 | virtual void sendMessage( const Bu::FString &sMsg ); | 108 | virtual void sendMessage( const Bu::String &sMsg ); |
109 | 109 | ||
110 | private: | 110 | private: |
111 | ItoClient *pClient; | 111 | ItoClient *pClient; |
diff --git a/src/lexer.cpp b/src/lexer.cpp index af9a23f..7dc2b23 100644 --- a/src/lexer.cpp +++ b/src/lexer.cpp | |||
@@ -1,3 +1,10 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. | ||
3 | * | ||
4 | * This file is part of the libbu++ library and is released under the | ||
5 | * terms of the license contained in the file LICENSE. | ||
6 | */ | ||
7 | |||
1 | #include "bu/lexer.h" | 8 | #include "bu/lexer.h" |
2 | 9 | ||
3 | Bu::Lexer::Lexer() | 10 | Bu::Lexer::Lexer() |
@@ -18,7 +25,7 @@ Bu::Lexer::Token::Token( Bu::Lexer::TokenType iToken ) : | |||
18 | { | 25 | { |
19 | } | 26 | } |
20 | 27 | ||
21 | Bu::FString Bu::Lexer::tokenToString( const Bu::Lexer::Token &t ) | 28 | Bu::String Bu::Lexer::tokenToString( const Bu::Lexer::Token &t ) |
22 | { | 29 | { |
23 | Bu::MemBuf mb; | 30 | Bu::MemBuf mb; |
24 | Bu::Formatter f( mb ); | 31 | Bu::Formatter f( mb ); |
diff --git a/src/lexer.h b/src/lexer.h index 9840afe..b057692 100644 --- a/src/lexer.h +++ b/src/lexer.h | |||
@@ -1,3 +1,10 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. | ||
3 | * | ||
4 | * This file is part of the libbu++ library and is released under the | ||
5 | * terms of the license contained in the file LICENSE. | ||
6 | */ | ||
7 | |||
1 | #ifndef BU_LEXER_H | 8 | #ifndef BU_LEXER_H |
2 | #define BU_LEXER_H | 9 | #define BU_LEXER_H |
3 | 10 | ||
@@ -44,7 +51,7 @@ namespace Bu | |||
44 | 51 | ||
45 | virtual Token *nextToken()=0; | 52 | virtual Token *nextToken()=0; |
46 | 53 | ||
47 | virtual Bu::FString tokenToString( const Token &t ); | 54 | virtual Bu::String tokenToString( const Token &t ); |
48 | }; | 55 | }; |
49 | }; | 56 | }; |
50 | 57 | ||
diff --git a/src/linkmessage.cpp b/src/linkmessage.cpp index 55e5026..cd024c0 100644 --- a/src/linkmessage.cpp +++ b/src/linkmessage.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/linkmessage.h b/src/linkmessage.h index 3c966df..69423b3 100644 --- a/src/linkmessage.h +++ b/src/linkmessage.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/list.cpp b/src/list.cpp index cbd6929..e05765e 100644 --- a/src/list.cpp +++ b/src/list.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/logger.cpp b/src/logger.cpp index 9f734a9..8e46390 100644 --- a/src/logger.cpp +++ b/src/logger.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -69,7 +69,7 @@ void Bu::Logger::log( uint32_t nLevel, const char *sFile, const char *sFunction, | |||
69 | #endif | 69 | #endif |
70 | } | 70 | } |
71 | 71 | ||
72 | void Bu::Logger::setFormat( const Bu::FString &str ) | 72 | void Bu::Logger::setFormat( const Bu::String &str ) |
73 | { | 73 | { |
74 | sLogFormat = ""; | 74 | sLogFormat = ""; |
75 | 75 | ||
@@ -93,7 +93,7 @@ void Bu::Logger::setFormat( const Bu::FString &str ) | |||
93 | if( *s == '%' ) | 93 | if( *s == '%' ) |
94 | { | 94 | { |
95 | sLogFormat += '%'; | 95 | sLogFormat += '%'; |
96 | Bu::FString sBuf; | 96 | Bu::String sBuf; |
97 | for(;;) | 97 | for(;;) |
98 | { | 98 | { |
99 | s++; | 99 | s++; |
@@ -166,10 +166,10 @@ void Bu::Logger::hexDump( uint32_t nLevel, const char *sFile, | |||
166 | log( nLevel, sFile, sFunction, nLine, "Displaying %ld bytes of %s.", nDataLen, lpName ); | 166 | log( nLevel, sFile, sFunction, nLine, "Displaying %ld bytes of %s.", nDataLen, lpName ); |
167 | const unsigned char *pData = (const unsigned char *)pDataV; | 167 | const unsigned char *pData = (const unsigned char *)pDataV; |
168 | int j = 0; | 168 | int j = 0; |
169 | Bu::FString sBorder; | 169 | Bu::String sBorder; |
170 | for( int l = 0; l < 8*3+2*8+2+5; l++ ) sBorder += ((l!=11&&l!=37)?("-"):("+")); | 170 | for( int l = 0; l < 8*3+2*8+2+5; l++ ) sBorder += ((l!=11&&l!=37)?("-"):("+")); |
171 | log( nLevel, sFile, sFunction, nLine, sBorder.getStr() ); | 171 | log( nLevel, sFile, sFunction, nLine, sBorder.getStr() ); |
172 | Bu::FString sLine; | 172 | Bu::String sLine; |
173 | for(;;) | 173 | for(;;) |
174 | { | 174 | { |
175 | { | 175 | { |
diff --git a/src/logger.h b/src/logger.h index 6a7a2d5..5c1352b 100644 --- a/src/logger.h +++ b/src/logger.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -9,7 +9,7 @@ | |||
9 | #define BU_LOGGER_H | 9 | #define BU_LOGGER_H |
10 | 10 | ||
11 | #include "bu/singleton.h" | 11 | #include "bu/singleton.h" |
12 | #include "bu/fstring.h" | 12 | #include "bu/string.h" |
13 | 13 | ||
14 | namespace Bu | 14 | namespace Bu |
15 | { | 15 | { |
@@ -78,7 +78,7 @@ namespace Bu | |||
78 | public: | 78 | public: |
79 | void log( uint32_t nLevel, const char *sFile, const char *sFunction, int nLine, const char *sFormat, ...); | 79 | void log( uint32_t nLevel, const char *sFile, const char *sFunction, int nLine, const char *sFormat, ...); |
80 | 80 | ||
81 | void setFormat( const Bu::FString &str ); | 81 | void setFormat( const Bu::String &str ); |
82 | void setMask( uint32_t n ); | 82 | void setMask( uint32_t n ); |
83 | void setLevel( uint32_t n ); | 83 | void setLevel( uint32_t n ); |
84 | uint32_t getMask(); | 84 | uint32_t getMask(); |
@@ -86,7 +86,7 @@ namespace Bu | |||
86 | void hexDump( uint32_t nLevel, const char *sFile, const char *sFunction, int nLine, const void *pData, long nDataLen, const char *lpName ); | 86 | void hexDump( uint32_t nLevel, const char *sFile, const char *sFunction, int nLine, const void *pData, long nDataLen, const char *lpName ); |
87 | 87 | ||
88 | private: | 88 | private: |
89 | Bu::FString sLogFormat; | 89 | Bu::String sLogFormat; |
90 | uint32_t nLevelMask; | 90 | uint32_t nLevelMask; |
91 | }; | 91 | }; |
92 | } | 92 | } |
diff --git a/src/md5.cpp b/src/md5.cpp index a1345ce..71f17a0 100644 --- a/src/md5.cpp +++ b/src/md5.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -39,7 +39,7 @@ void Bu::Md5::reset() | |||
39 | uBits[1] = 0; | 39 | uBits[1] = 0; |
40 | } | 40 | } |
41 | 41 | ||
42 | void Bu::Md5::setSalt( const Bu::FString & /*sSalt*/ ) | 42 | void Bu::Md5::setSalt( const Bu::String & /*sSalt*/ ) |
43 | { | 43 | { |
44 | } | 44 | } |
45 | 45 | ||
@@ -86,11 +86,11 @@ void Bu::Md5::addData( const void *sVData, int iSize ) | |||
86 | memcpy( inbuf, sData, iSize ); | 86 | memcpy( inbuf, sData, iSize ); |
87 | } | 87 | } |
88 | 88 | ||
89 | Bu::FString Bu::Md5::getResult() | 89 | Bu::String Bu::Md5::getResult() |
90 | { | 90 | { |
91 | uint32_t lsum[4]; | 91 | uint32_t lsum[4]; |
92 | compCap( lsum ); | 92 | compCap( lsum ); |
93 | return Bu::FString( (const char *)lsum, 4*4 ); | 93 | return Bu::String( (const char *)lsum, 4*4 ); |
94 | } | 94 | } |
95 | 95 | ||
96 | void Bu::Md5::writeResult( Bu::Stream &sOut ) | 96 | void Bu::Md5::writeResult( Bu::Stream &sOut ) |
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -28,10 +28,10 @@ namespace Bu | |||
28 | virtual ~Md5(); | 28 | virtual ~Md5(); |
29 | 29 | ||
30 | virtual void reset(); | 30 | virtual void reset(); |
31 | virtual void setSalt( const Bu::FString &sSalt ); | 31 | virtual void setSalt( const Bu::String &sSalt ); |
32 | virtual void addData( const void *sData, int iSize ); | 32 | virtual void addData( const void *sData, int iSize ); |
33 | using Bu::CryptoHash::addData; | 33 | using Bu::CryptoHash::addData; |
34 | virtual FString getResult(); | 34 | virtual String getResult(); |
35 | virtual void writeResult( Bu::Stream &sOut ); | 35 | virtual void writeResult( Bu::Stream &sOut ); |
36 | 36 | ||
37 | private: | 37 | private: |
diff --git a/src/membuf.cpp b/src/membuf.cpp index b822641..14d0d58 100644 --- a/src/membuf.cpp +++ b/src/membuf.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -14,7 +14,7 @@ Bu::MemBuf::MemBuf() : | |||
14 | { | 14 | { |
15 | } | 15 | } |
16 | 16 | ||
17 | Bu::MemBuf::MemBuf( const Bu::FString &str ) : | 17 | Bu::MemBuf::MemBuf( const Bu::String &str ) : |
18 | sBuf( str ), | 18 | sBuf( str ), |
19 | nPos( 0 ) | 19 | nPos( 0 ) |
20 | { | 20 | { |
@@ -28,9 +28,9 @@ void Bu::MemBuf::close() | |||
28 | { | 28 | { |
29 | } | 29 | } |
30 | 30 | ||
31 | size_t Bu::MemBuf::read( void *pBuf, size_t nBytes ) | 31 | size Bu::MemBuf::read( void *pBuf, size nBytes ) |
32 | { | 32 | { |
33 | if( (size_t)sBuf.getSize()-(size_t)nPos < nBytes ) | 33 | if( (size)sBuf.getSize()-(size)nPos < nBytes ) |
34 | nBytes = sBuf.getSize()-nPos; | 34 | nBytes = sBuf.getSize()-nPos; |
35 | 35 | ||
36 | memcpy( pBuf, sBuf.getStr()+nPos, nBytes ); | 36 | memcpy( pBuf, sBuf.getStr()+nPos, nBytes ); |
@@ -39,7 +39,7 @@ size_t Bu::MemBuf::read( void *pBuf, size_t nBytes ) | |||
39 | return nBytes; | 39 | return nBytes; |
40 | } | 40 | } |
41 | 41 | ||
42 | size_t Bu::MemBuf::write( const void *pBuf, size_t nBytes ) | 42 | size Bu::MemBuf::write( const void *pBuf, size nBytes ) |
43 | { | 43 | { |
44 | if( nPos == sBuf.getSize() ) | 44 | if( nPos == sBuf.getSize() ) |
45 | { | 45 | { |
@@ -52,7 +52,7 @@ size_t Bu::MemBuf::write( const void *pBuf, size_t nBytes ) | |||
52 | { | 52 | { |
53 | // Trickier, we must do this in two parts, overwrite, then append | 53 | // Trickier, we must do this in two parts, overwrite, then append |
54 | // Frist, overwrite. | 54 | // Frist, overwrite. |
55 | size_t iOver = sBuf.getSize() - nPos; | 55 | size iOver = sBuf.getSize() - nPos; |
56 | if( iOver > nBytes ) | 56 | if( iOver > nBytes ) |
57 | iOver = nBytes; | 57 | iOver = nBytes; |
58 | memcpy( sBuf.getStr()+nPos, pBuf, iOver ); | 58 | memcpy( sBuf.getStr()+nPos, pBuf, iOver ); |
@@ -66,26 +66,26 @@ size_t Bu::MemBuf::write( const void *pBuf, size_t nBytes ) | |||
66 | } | 66 | } |
67 | } | 67 | } |
68 | 68 | ||
69 | long Bu::MemBuf::tell() | 69 | size Bu::MemBuf::tell() |
70 | { | 70 | { |
71 | return nPos; | 71 | return nPos; |
72 | } | 72 | } |
73 | 73 | ||
74 | void Bu::MemBuf::seek( long offset ) | 74 | void Bu::MemBuf::seek( size offset ) |
75 | { | 75 | { |
76 | nPos += offset; | 76 | nPos += offset; |
77 | if( nPos < 0 ) nPos = 0; | 77 | if( nPos < 0 ) nPos = 0; |
78 | else if( nPos > sBuf.getSize() ) nPos = sBuf.getSize(); | 78 | else if( nPos > sBuf.getSize() ) nPos = sBuf.getSize(); |
79 | } | 79 | } |
80 | 80 | ||
81 | void Bu::MemBuf::setPos( long pos ) | 81 | void Bu::MemBuf::setPos( size pos ) |
82 | { | 82 | { |
83 | nPos = pos; | 83 | nPos = pos; |
84 | if( nPos < 0 ) nPos = 0; | 84 | if( nPos < 0 ) nPos = 0; |
85 | else if( nPos > sBuf.getSize() ) nPos = sBuf.getSize(); | 85 | else if( nPos > sBuf.getSize() ) nPos = sBuf.getSize(); |
86 | } | 86 | } |
87 | 87 | ||
88 | void Bu::MemBuf::setPosEnd( long pos ) | 88 | void Bu::MemBuf::setPosEnd( size pos ) |
89 | { | 89 | { |
90 | nPos = sBuf.getSize()-pos; | 90 | nPos = sBuf.getSize()-pos; |
91 | if( nPos < 0 ) nPos = 0; | 91 | if( nPos < 0 ) nPos = 0; |
@@ -140,7 +140,7 @@ void Bu::MemBuf::setBlocking( bool ) | |||
140 | { | 140 | { |
141 | } | 141 | } |
142 | 142 | ||
143 | void Bu::MemBuf::setSize( long iSize ) | 143 | void Bu::MemBuf::setSize( size iSize ) |
144 | { | 144 | { |
145 | if( iSize < 0 ) | 145 | if( iSize < 0 ) |
146 | iSize = 0; | 146 | iSize = 0; |
@@ -149,12 +149,27 @@ void Bu::MemBuf::setSize( long iSize ) | |||
149 | nPos = iSize; | 149 | nPos = iSize; |
150 | } | 150 | } |
151 | 151 | ||
152 | Bu::FString &Bu::MemBuf::getString() | 152 | Bu::size Bu::MemBuf::getSize() const |
153 | { | ||
154 | return sBuf.getSize(); | ||
155 | } | ||
156 | |||
157 | Bu::size Bu::MemBuf::getBlockSize() const | ||
158 | { | ||
159 | return sBuf.getSize(); | ||
160 | } | ||
161 | |||
162 | Bu::String Bu::MemBuf::getLocation() const | ||
163 | { | ||
164 | return ""; | ||
165 | } | ||
166 | |||
167 | Bu::String &Bu::MemBuf::getString() | ||
153 | { | 168 | { |
154 | return sBuf; | 169 | return sBuf; |
155 | } | 170 | } |
156 | 171 | ||
157 | void Bu::MemBuf::setString( const Bu::FString &sNewData ) | 172 | void Bu::MemBuf::setString( const Bu::String &sNewData ) |
158 | { | 173 | { |
159 | sBuf = sNewData; | 174 | sBuf = sNewData; |
160 | nPos = 0; | 175 | nPos = 0; |
diff --git a/src/membuf.h b/src/membuf.h index 9e406c1..d98a29c 100644 --- a/src/membuf.h +++ b/src/membuf.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -10,8 +10,9 @@ | |||
10 | 10 | ||
11 | #include <stdint.h> | 11 | #include <stdint.h> |
12 | 12 | ||
13 | #include "bu/config.h" | ||
13 | #include "bu/stream.h" | 14 | #include "bu/stream.h" |
14 | #include "bu/fstring.h" | 15 | #include "bu/string.h" |
15 | 16 | ||
16 | namespace Bu | 17 | namespace Bu |
17 | { | 18 | { |
@@ -23,18 +24,18 @@ namespace Bu | |||
23 | { | 24 | { |
24 | public: | 25 | public: |
25 | MemBuf(); | 26 | MemBuf(); |
26 | MemBuf( const Bu::FString &str ); | 27 | MemBuf( const Bu::String &str ); |
27 | virtual ~MemBuf(); | 28 | virtual ~MemBuf(); |
28 | 29 | ||
29 | virtual void close(); | 30 | virtual void close(); |
30 | virtual size_t read( void *pBuf, size_t nBytes ); | 31 | virtual size read( void *pBuf, size iBytes ); |
31 | 32 | ||
32 | virtual size_t write( const void *pBuf, size_t nBytes ); | 33 | virtual size write( const void *pBuf, size iBytes ); |
33 | using Stream::write; | 34 | using Stream::write; |
34 | virtual long tell(); | 35 | virtual size tell(); |
35 | virtual void seek( long offset ); | 36 | virtual void seek( size offset ); |
36 | virtual void setPos( long pos ); | 37 | virtual void setPos( size pos ); |
37 | virtual void setPosEnd( long pos ); | 38 | virtual void setPosEnd( size pos ); |
38 | virtual bool isEos(); | 39 | virtual bool isEos(); |
39 | virtual bool isOpen(); | 40 | virtual bool isOpen(); |
40 | virtual void flush(); | 41 | virtual void flush(); |
@@ -45,14 +46,17 @@ namespace Bu | |||
45 | virtual bool isSeekable(); | 46 | virtual bool isSeekable(); |
46 | virtual bool isBlocking(); | 47 | virtual bool isBlocking(); |
47 | virtual void setBlocking( bool bBlocking=true ); | 48 | virtual void setBlocking( bool bBlocking=true ); |
48 | virtual void setSize( long iSize ); | 49 | virtual void setSize( size iSize ); |
50 | virtual size getSize() const; | ||
51 | virtual size getBlockSize() const; | ||
52 | virtual Bu::String getLocation() const; | ||
49 | 53 | ||
50 | Bu::FString &getString(); | 54 | Bu::String &getString(); |
51 | void setString( const Bu::FString &sNewData ); | 55 | void setString( const Bu::String &sNewData ); |
52 | 56 | ||
53 | private: | 57 | private: |
54 | Bu::FString sBuf; | 58 | Bu::String sBuf; |
55 | long nPos; | 59 | size nPos; |
56 | }; | 60 | }; |
57 | } | 61 | } |
58 | 62 | ||
diff --git a/src/minicron.cpp b/src/minicron.cpp index 491d143..3375492 100644 --- a/src/minicron.cpp +++ b/src/minicron.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -73,7 +73,7 @@ void Bu::MiniCron::poll() | |||
73 | } | 73 | } |
74 | } | 74 | } |
75 | 75 | ||
76 | Bu::MiniCron::JobId Bu::MiniCron::addJob( const Bu::FString &sName, | 76 | Bu::MiniCron::JobId Bu::MiniCron::addJob( const Bu::String &sName, |
77 | Bu::MiniCron::CronSignal sigJob, const Bu::MiniCron::Timer &t ) | 77 | Bu::MiniCron::CronSignal sigJob, const Bu::MiniCron::Timer &t ) |
78 | { | 78 | { |
79 | JobId jid = jidNext++; | 79 | JobId jid = jidNext++; |
@@ -86,7 +86,7 @@ Bu::MiniCron::JobId Bu::MiniCron::addJob( const Bu::FString &sName, | |||
86 | return jid; | 86 | return jid; |
87 | } | 87 | } |
88 | 88 | ||
89 | Bu::MiniCron::JobId Bu::MiniCron::addJobOnce( const Bu::FString &sName, | 89 | Bu::MiniCron::JobId Bu::MiniCron::addJobOnce( const Bu::String &sName, |
90 | Bu::MiniCron::CronSignal sigJob, const Bu::MiniCron::Timer &t ) | 90 | Bu::MiniCron::CronSignal sigJob, const Bu::MiniCron::Timer &t ) |
91 | { | 91 | { |
92 | JobId jid = jidNext++; | 92 | JobId jid = jidNext++; |
@@ -132,7 +132,7 @@ Bu::MiniCron::JobInfoList Bu::MiniCron::getJobInfo() | |||
132 | return lRet; | 132 | return lRet; |
133 | } | 133 | } |
134 | 134 | ||
135 | Bu::MiniCron::Job::Job( const Bu::FString &sName, JobId jid, bool bRepeat ) : | 135 | Bu::MiniCron::Job::Job( const Bu::String &sName, JobId jid, bool bRepeat ) : |
136 | sName( sName ), | 136 | sName( sName ), |
137 | pTimer( NULL ), | 137 | pTimer( NULL ), |
138 | bContinue( bRepeat ), | 138 | bContinue( bRepeat ), |
@@ -202,12 +202,12 @@ time_t Bu::MiniCron::Job::getNextRunTime() const | |||
202 | return tNextRun; | 202 | return tNextRun; |
203 | } | 203 | } |
204 | 204 | ||
205 | Bu::FString Bu::MiniCron::Job::getName() const | 205 | Bu::String Bu::MiniCron::Job::getName() const |
206 | { | 206 | { |
207 | return sName; | 207 | return sName; |
208 | } | 208 | } |
209 | 209 | ||
210 | Bu::MiniCron::JobInfo::JobInfo( const Bu::FString &sName, JobId jid, | 210 | Bu::MiniCron::JobInfo::JobInfo( const Bu::String &sName, JobId jid, |
211 | time_t tNext ) : | 211 | time_t tNext ) : |
212 | sName( sName ), | 212 | sName( sName ), |
213 | jid( jid ), | 213 | jid( jid ), |
@@ -249,7 +249,7 @@ time_t Bu::MiniCron::TimerInterval::nextTime() | |||
249 | return tRet; | 249 | return tRet; |
250 | } | 250 | } |
251 | 251 | ||
252 | Bu::MiniCron::TimerBasic::TimerBasic( const Bu::FString &s ) : | 252 | Bu::MiniCron::TimerBasic::TimerBasic( const Bu::String &s ) : |
253 | tLast( -1 ), | 253 | tLast( -1 ), |
254 | sSpec( s ) | 254 | sSpec( s ) |
255 | { | 255 | { |
@@ -264,7 +264,7 @@ time_t Bu::MiniCron::TimerBasic::nextTime() | |||
264 | if( tLast == -1 ) | 264 | if( tLast == -1 ) |
265 | tLast = time( NULL ); | 265 | tLast = time( NULL ); |
266 | 266 | ||
267 | Bu::FString::const_iterator i = sSpec.begin(); | 267 | Bu::String::const_iterator i = sSpec.begin(); |
268 | switch( lex( i ) ) | 268 | switch( lex( i ) ) |
269 | { | 269 | { |
270 | case tokDaily: | 270 | case tokDaily: |
@@ -343,19 +343,19 @@ time_t Bu::MiniCron::TimerBasic::nextTime() | |||
343 | } | 343 | } |
344 | 344 | ||
345 | Bu::MiniCron::TimerBasic::Token Bu::MiniCron::TimerBasic::lex( | 345 | Bu::MiniCron::TimerBasic::Token Bu::MiniCron::TimerBasic::lex( |
346 | Bu::FString::const_iterator &i ) | 346 | Bu::String::const_iterator &i ) |
347 | { | 347 | { |
348 | if( !i ) | 348 | if( !i ) |
349 | { | 349 | { |
350 | return tokEos; | 350 | return tokEos; |
351 | } | 351 | } |
352 | 352 | ||
353 | Bu::FString::const_iterator b = i; | 353 | Bu::String::const_iterator b = i; |
354 | 354 | ||
355 | for(; b && (*b == ' ' || *b == '\t'); b++ ) { i = b+1; } | 355 | for(; b && (*b == ' ' || *b == '\t'); b++ ) { i = b+1; } |
356 | for(; b && *b != ' ' && *b != '\t'; b++ ) { } | 356 | for(; b && *b != ' ' && *b != '\t'; b++ ) { } |
357 | 357 | ||
358 | Bu::FString sTok( i, b ); | 358 | Bu::String sTok( i, b ); |
359 | i = b; | 359 | i = b; |
360 | 360 | ||
361 | if( sTok == "daily" ) | 361 | if( sTok == "daily" ) |
@@ -412,7 +412,7 @@ Bu::MiniCron::TimerBasic::Token Bu::MiniCron::TimerBasic::lex( | |||
412 | return tokErr; | 412 | return tokErr; |
413 | } | 413 | } |
414 | 414 | ||
415 | int Bu::MiniCron::TimerBasic::lexInt( Bu::FString::const_iterator &i ) | 415 | int Bu::MiniCron::TimerBasic::lexInt( Bu::String::const_iterator &i ) |
416 | { | 416 | { |
417 | Token t = lex( i ); | 417 | Token t = lex( i ); |
418 | if( t == tokEos ) | 418 | if( t == tokEos ) |
diff --git a/src/minicron.h b/src/minicron.h index b045e79..7ccf543 100644 --- a/src/minicron.h +++ b/src/minicron.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -10,7 +10,7 @@ | |||
10 | 10 | ||
11 | #include "bu/signals.h" | 11 | #include "bu/signals.h" |
12 | #include "bu/heap.h" | 12 | #include "bu/heap.h" |
13 | #include "bu/fstring.h" | 13 | #include "bu/string.h" |
14 | 14 | ||
15 | #include <time.h> | 15 | #include <time.h> |
16 | 16 | ||
@@ -89,7 +89,7 @@ namespace Bu | |||
89 | * JobId which can be used at a later time to control the execution of | 89 | * JobId which can be used at a later time to control the execution of |
90 | * the job. | 90 | * the job. |
91 | */ | 91 | */ |
92 | virtual JobId addJob( const Bu::FString &sName, CronSignal sigJob, | 92 | virtual JobId addJob( const Bu::String &sName, CronSignal sigJob, |
93 | const Timer &t ); | 93 | const Timer &t ); |
94 | 94 | ||
95 | /** | 95 | /** |
@@ -98,7 +98,7 @@ namespace Bu | |||
98 | * function returns a JobId which can be used at a later time to control | 98 | * function returns a JobId which can be used at a later time to control |
99 | * the execution of the job. | 99 | * the execution of the job. |
100 | */ | 100 | */ |
101 | virtual JobId addJobOnce( const Bu::FString &sName, CronSignal sigJob, | 101 | virtual JobId addJobOnce( const Bu::String &sName, CronSignal sigJob, |
102 | const Timer &t ); | 102 | const Timer &t ); |
103 | 103 | ||
104 | /** | 104 | /** |
@@ -113,12 +113,12 @@ namespace Bu | |||
113 | class JobInfo | 113 | class JobInfo |
114 | { | 114 | { |
115 | public: | 115 | public: |
116 | JobInfo( const Bu::FString &sName, JobId jid, time_t tNext ); | 116 | JobInfo( const Bu::String &sName, JobId jid, time_t tNext ); |
117 | virtual ~JobInfo(); | 117 | virtual ~JobInfo(); |
118 | 118 | ||
119 | bool operator<( const JobInfo &rhs ) const; | 119 | bool operator<( const JobInfo &rhs ) const; |
120 | 120 | ||
121 | Bu::FString sName; | 121 | Bu::String sName; |
122 | JobId jid; | 122 | JobId jid; |
123 | time_t tNext; | 123 | time_t tNext; |
124 | }; | 124 | }; |
@@ -189,7 +189,7 @@ namespace Bu | |||
189 | class TimerBasic : public Timer | 189 | class TimerBasic : public Timer |
190 | { | 190 | { |
191 | public: | 191 | public: |
192 | TimerBasic( const Bu::FString &s ); | 192 | TimerBasic( const Bu::String &s ); |
193 | virtual ~TimerBasic(); | 193 | virtual ~TimerBasic(); |
194 | 194 | ||
195 | virtual time_t nextTime(); | 195 | virtual time_t nextTime(); |
@@ -208,11 +208,11 @@ namespace Bu | |||
208 | tokErr, | 208 | tokErr, |
209 | tokEos | 209 | tokEos |
210 | }; | 210 | }; |
211 | Token lex( Bu::FString::const_iterator &i ); | 211 | Token lex( Bu::String::const_iterator &i ); |
212 | int lexInt( Bu::FString::const_iterator &i ); | 212 | int lexInt( Bu::String::const_iterator &i ); |
213 | int iVal; //< A temp variable for parsing. | 213 | int iVal; //< A temp variable for parsing. |
214 | time_t tLast; | 214 | time_t tLast; |
215 | Bu::FString sSpec; | 215 | Bu::String sSpec; |
216 | }; | 216 | }; |
217 | 217 | ||
218 | /** | 218 | /** |
@@ -225,7 +225,7 @@ namespace Bu | |||
225 | { | 225 | { |
226 | friend class Bu::MiniCron; | 226 | friend class Bu::MiniCron; |
227 | private: | 227 | private: |
228 | Job( const Bu::FString &sName, JobId jid, bool bRepeat=true ); | 228 | Job( const Bu::String &sName, JobId jid, bool bRepeat=true ); |
229 | virtual ~Job(); | 229 | virtual ~Job(); |
230 | 230 | ||
231 | public: | 231 | public: |
@@ -290,10 +290,10 @@ namespace Bu | |||
290 | /** | 290 | /** |
291 | * Gets the name that was set when the job was created. | 291 | * Gets the name that was set when the job was created. |
292 | */ | 292 | */ |
293 | Bu::FString getName() const; | 293 | Bu::String getName() const; |
294 | 294 | ||
295 | private: | 295 | private: |
296 | Bu::FString sName; | 296 | Bu::String sName; |
297 | CronSignal sigJob; | 297 | CronSignal sigJob; |
298 | time_t tNextRun; | 298 | time_t tNextRun; |
299 | Timer *pTimer; | 299 | Timer *pTimer; |
diff --git a/src/minimacro.cpp b/src/minimacro.cpp index df1a5c9..b6fd6a8 100644 --- a/src/minimacro.cpp +++ b/src/minimacro.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -25,10 +25,10 @@ Bu::MiniMacro::~MiniMacro() | |||
25 | { | 25 | { |
26 | } | 26 | } |
27 | 27 | ||
28 | Bu::FString Bu::MiniMacro::parse( const Bu::FString &sIn ) | 28 | Bu::String Bu::MiniMacro::parse( const Bu::String &sIn ) |
29 | { | 29 | { |
30 | bContinue = true; | 30 | bContinue = true; |
31 | Bu::FString sOut; | 31 | Bu::String sOut; |
32 | for( sCur = sIn.getStr(); *sCur && bContinue; sCur++ ) | 32 | for( sCur = sIn.getStr(); *sCur && bContinue; sCur++ ) |
33 | { | 33 | { |
34 | if( *sCur == '{' ) | 34 | if( *sCur == '{' ) |
@@ -66,16 +66,16 @@ Bu::FString Bu::MiniMacro::parse( const Bu::FString &sIn ) | |||
66 | return sOut; | 66 | return sOut; |
67 | } | 67 | } |
68 | 68 | ||
69 | Bu::FString Bu::MiniMacro::parseRepl() | 69 | Bu::String Bu::MiniMacro::parseRepl() |
70 | { | 70 | { |
71 | Bu::FString sOut; | 71 | Bu::String sOut; |
72 | bool bIsFirst = true; | 72 | bool bIsFirst = true; |
73 | for( const char *sNext = sCur;;) | 73 | for( const char *sNext = sCur;;) |
74 | { | 74 | { |
75 | for(; *sNext != ':' && *sNext != '}' && *sNext != '\0'; sNext++ ) { } | 75 | for(; *sNext != ':' && *sNext != '}' && *sNext != '\0'; sNext++ ) { } |
76 | if( *sNext == '\0' ) | 76 | if( *sNext == '\0' ) |
77 | break; | 77 | break; |
78 | Bu::FString sName( sCur, (ptrdiff_t)sNext-(ptrdiff_t)sCur ); | 78 | Bu::String sName( sCur, (ptrdiff_t)sNext-(ptrdiff_t)sCur ); |
79 | if( bIsFirst ) | 79 | if( bIsFirst ) |
80 | { | 80 | { |
81 | sOut = hVars[sName]; | 81 | sOut = hVars[sName]; |
@@ -101,21 +101,21 @@ Bu::FString Bu::MiniMacro::parseRepl() | |||
101 | return sOut; | 101 | return sOut; |
102 | } | 102 | } |
103 | 103 | ||
104 | Bu::FString Bu::MiniMacro::parseCond() | 104 | Bu::String Bu::MiniMacro::parseCond() |
105 | { | 105 | { |
106 | Bu::FString sOut; | 106 | Bu::String sOut; |
107 | //printf("%20s\n", sCur ); | 107 | //printf("%20s\n", sCur ); |
108 | return sOut; | 108 | return sOut; |
109 | } | 109 | } |
110 | 110 | ||
111 | Bu::FString Bu::MiniMacro::parseCmd() | 111 | Bu::String Bu::MiniMacro::parseCmd() |
112 | { | 112 | { |
113 | Bu::FString sOut; | 113 | Bu::String sOut; |
114 | const char *sNext = sCur; | 114 | const char *sNext = sCur; |
115 | for(; *sNext != ':' && *sNext != '}' && *sNext != '\0'; sNext++ ) { } | 115 | for(; *sNext != ':' && *sNext != '}' && *sNext != '\0'; sNext++ ) { } |
116 | if( *sNext != '\0' ) | 116 | if( *sNext != '\0' ) |
117 | { | 117 | { |
118 | Bu::FString sName( sCur, (ptrdiff_t)sNext-(ptrdiff_t)sCur ); | 118 | Bu::String sName( sCur, (ptrdiff_t)sNext-(ptrdiff_t)sCur ); |
119 | if( sName == "end" ) | 119 | if( sName == "end" ) |
120 | { | 120 | { |
121 | sCur = sNext; | 121 | sCur = sNext; |
@@ -138,20 +138,20 @@ Bu::FString Bu::MiniMacro::parseCmd() | |||
138 | return sOut; | 138 | return sOut; |
139 | } | 139 | } |
140 | 140 | ||
141 | Bu::FString Bu::MiniMacro::callFunc( | 141 | Bu::String Bu::MiniMacro::callFunc( |
142 | const Bu::FString &sIn, const Bu::FString &sFunc ) | 142 | const Bu::String &sIn, const Bu::String &sFunc ) |
143 | { | 143 | { |
144 | int i = sFunc.findIdx('('); | 144 | int i = sFunc.findIdx('('); |
145 | if( i < 0 ) | 145 | if( i < 0 ) |
146 | throw Bu::ExceptionBase("That doesn't look like a function call"); | 146 | throw Bu::ExceptionBase("That doesn't look like a function call"); |
147 | Bu::FString sName( sFunc.getStr(), i ); | 147 | Bu::String sName( sFunc.getStr(), i ); |
148 | StrList lsParams; | 148 | StrList lsParams; |
149 | for( const char *s = sFunc.getStr()+i+1; *s && *s != ')'; s++ ) | 149 | for( const char *s = sFunc.getStr()+i+1; *s && *s != ')'; s++ ) |
150 | { | 150 | { |
151 | for(; *s == ' ' || *s == '\t' || *s == '\r' || *s == '\n'; s++ ) { } | 151 | for(; *s == ' ' || *s == '\t' || *s == '\r' || *s == '\n'; s++ ) { } |
152 | const char *sNext; | 152 | const char *sNext; |
153 | for( sNext = s; *sNext && *sNext != ')' && *sNext != ','; sNext++ ) { } | 153 | for( sNext = s; *sNext && *sNext != ')' && *sNext != ','; sNext++ ) { } |
154 | Bu::FString p( s, (ptrdiff_t)sNext-(ptrdiff_t)s ); | 154 | Bu::String p( s, (ptrdiff_t)sNext-(ptrdiff_t)s ); |
155 | lsParams.append( p ); | 155 | lsParams.append( p ); |
156 | sNext++; | 156 | sNext++; |
157 | s = sNext; | 157 | s = sNext; |
@@ -160,17 +160,17 @@ Bu::FString Bu::MiniMacro::callFunc( | |||
160 | } | 160 | } |
161 | 161 | ||
162 | void Bu::MiniMacro::addVar( | 162 | void Bu::MiniMacro::addVar( |
163 | const Bu::FString &sName, const Bu::FString &sValue ) | 163 | const Bu::String &sName, const Bu::String &sValue ) |
164 | { | 164 | { |
165 | hVars.insert( sName, sValue ); | 165 | hVars.insert( sName, sValue ); |
166 | } | 166 | } |
167 | 167 | ||
168 | bool Bu::MiniMacro::hasVar( const Bu::FString &sName ) | 168 | bool Bu::MiniMacro::hasVar( const Bu::String &sName ) |
169 | { | 169 | { |
170 | return hVars.has( sName ); | 170 | return hVars.has( sName ); |
171 | } | 171 | } |
172 | 172 | ||
173 | const Bu::FString &Bu::MiniMacro::getVar( const Bu::FString &sName ) | 173 | const Bu::String &Bu::MiniMacro::getVar( const Bu::String &sName ) |
174 | { | 174 | { |
175 | return hVars.get( sName ); | 175 | return hVars.get( sName ); |
176 | } | 176 | } |
diff --git a/src/minimacro.h b/src/minimacro.h index 2a1fe23..582e1b0 100644 --- a/src/minimacro.h +++ b/src/minimacro.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -9,11 +9,11 @@ | |||
9 | #define BU_MINI_MACRO_H | 9 | #define BU_MINI_MACRO_H |
10 | 10 | ||
11 | #include "bu/hash.h" | 11 | #include "bu/hash.h" |
12 | #include "bu/fstring.h" | 12 | #include "bu/string.h" |
13 | 13 | ||
14 | namespace Bu | 14 | namespace Bu |
15 | { | 15 | { |
16 | typedef Bu::Hash<Bu::FString, Bu::FString> StrHash; | 16 | typedef Bu::Hash<Bu::String, Bu::String> StrHash; |
17 | /** | 17 | /** |
18 | * A processor for Libbu++ brand Mini Macros. These are really simple, but | 18 | * A processor for Libbu++ brand Mini Macros. These are really simple, but |
19 | * still fairly flexible. It's mainly text replacement, but with a few | 19 | * still fairly flexible. It's mainly text replacement, but with a few |
@@ -67,34 +67,34 @@ namespace Bu | |||
67 | MiniMacro( const StrHash &sVarSrc ); | 67 | MiniMacro( const StrHash &sVarSrc ); |
68 | virtual ~MiniMacro(); | 68 | virtual ~MiniMacro(); |
69 | 69 | ||
70 | Bu::FString parse( const Bu::FString &sIn ); | 70 | Bu::String parse( const Bu::String &sIn ); |
71 | void addVar( const Bu::FString &sName, const Bu::FString &sValue ); | 71 | void addVar( const Bu::String &sName, const Bu::String &sValue ); |
72 | bool hasVar( const Bu::FString &sName ); | 72 | bool hasVar( const Bu::String &sName ); |
73 | const Bu::FString &getVar( const Bu::FString &sName ); | 73 | const Bu::String &getVar( const Bu::String &sName ); |
74 | const StrHash &getVars(); | 74 | const StrHash &getVars(); |
75 | int getPosition(); | 75 | int getPosition(); |
76 | 76 | ||
77 | private: | 77 | private: |
78 | const char *sCur; | 78 | const char *sCur; |
79 | Bu::FString parseRepl(); | 79 | Bu::String parseRepl(); |
80 | Bu::FString parseCond(); | 80 | Bu::String parseCond(); |
81 | Bu::FString parseCmd(); | 81 | Bu::String parseCmd(); |
82 | Bu::FString callFunc( | 82 | Bu::String callFunc( |
83 | const Bu::FString &sIn, const Bu::FString &sFunc ); | 83 | const Bu::String &sIn, const Bu::String &sFunc ); |
84 | 84 | ||
85 | StrHash hVars; | 85 | StrHash hVars; |
86 | bool bContinue; | 86 | bool bContinue; |
87 | int iLastPos; | 87 | int iLastPos; |
88 | 88 | ||
89 | public: | 89 | public: |
90 | typedef Bu::List<Bu::FString> StrList; | 90 | typedef Bu::List<Bu::String> StrList; |
91 | class Func | 91 | class Func |
92 | { | 92 | { |
93 | public: | 93 | public: |
94 | Func(){} | 94 | Func(){} |
95 | virtual ~Func(){} | 95 | virtual ~Func(){} |
96 | virtual Bu::FString call( | 96 | virtual Bu::String call( |
97 | const Bu::FString &sIn, StrList &lsParam )=0; | 97 | const Bu::String &sIn, StrList &lsParam )=0; |
98 | }; | 98 | }; |
99 | 99 | ||
100 | class FuncToUpper : public Func | 100 | class FuncToUpper : public Func |
@@ -102,10 +102,10 @@ namespace Bu | |||
102 | public: | 102 | public: |
103 | FuncToUpper(){} | 103 | FuncToUpper(){} |
104 | virtual ~FuncToUpper(){} | 104 | virtual ~FuncToUpper(){} |
105 | virtual Bu::FString call( | 105 | virtual Bu::String call( |
106 | const Bu::FString &sIn, StrList & ) | 106 | const Bu::String &sIn, StrList & ) |
107 | { | 107 | { |
108 | Bu::FString sOut( sIn ); | 108 | Bu::String sOut( sIn ); |
109 | sOut.toUpper(); | 109 | sOut.toUpper(); |
110 | return sOut; | 110 | return sOut; |
111 | } | 111 | } |
@@ -116,17 +116,17 @@ namespace Bu | |||
116 | public: | 116 | public: |
117 | FuncToLower(){} | 117 | FuncToLower(){} |
118 | virtual ~FuncToLower(){} | 118 | virtual ~FuncToLower(){} |
119 | virtual Bu::FString call( | 119 | virtual Bu::String call( |
120 | const Bu::FString &sIn, StrList & ) | 120 | const Bu::String &sIn, StrList & ) |
121 | { | 121 | { |
122 | Bu::FString sOut( sIn ); | 122 | Bu::String sOut( sIn ); |
123 | sOut.toLower(); | 123 | sOut.toLower(); |
124 | return sOut; | 124 | return sOut; |
125 | } | 125 | } |
126 | }; | 126 | }; |
127 | 127 | ||
128 | private: | 128 | private: |
129 | typedef Bu::Hash<Bu::FString,class Func *> FuncHash; | 129 | typedef Bu::Hash<Bu::String,class Func *> FuncHash; |
130 | FuncHash hFuncs; | 130 | FuncHash hFuncs; |
131 | }; | 131 | }; |
132 | }; | 132 | }; |
diff --git a/src/multiserver.cpp b/src/multiserver.cpp index a6cee36..bd598ed 100644 --- a/src/multiserver.cpp +++ b/src/multiserver.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -26,7 +26,7 @@ void Bu::MultiServer::addProtocol( Bu::Protocol *(*proc)(), int iPort, | |||
26 | addPort( iPort, nPoolSize ); | 26 | addPort( iPort, nPoolSize ); |
27 | } | 27 | } |
28 | 28 | ||
29 | void Bu::MultiServer::addProtocol( Protocol *(*proc)(), const FString &sAddr, | 29 | void Bu::MultiServer::addProtocol( Protocol *(*proc)(), const String &sAddr, |
30 | int iPort, int nPoolSize ) | 30 | int iPort, int nPoolSize ) |
31 | { | 31 | { |
32 | hProtos[iPort] = proc; | 32 | hProtos[iPort] = proc; |
diff --git a/src/multiserver.h b/src/multiserver.h index 6b98c1d..e3b3ec3 100644 --- a/src/multiserver.h +++ b/src/multiserver.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -29,7 +29,7 @@ namespace Bu | |||
29 | virtual ~MultiServer(); | 29 | virtual ~MultiServer(); |
30 | 30 | ||
31 | void addProtocol( Protocol *(*proc)(), int iPort, int nPoolSize=40 ); | 31 | void addProtocol( Protocol *(*proc)(), int iPort, int nPoolSize=40 ); |
32 | void addProtocol( Protocol *(*proc)(), const FString &sAddr, int iPort, | 32 | void addProtocol( Protocol *(*proc)(), const String &sAddr, int iPort, |
33 | int nPoolSize=40 ); | 33 | int nPoolSize=40 ); |
34 | 34 | ||
35 | void scan() | 35 | void scan() |
diff --git a/src/myriad.cpp b/src/myriad.cpp index b656b52..0e8dc80 100644 --- a/src/myriad.cpp +++ b/src/myriad.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/myriad.h b/src/myriad.h index 582d310..86c7aa1 100644 --- a/src/myriad.h +++ b/src/myriad.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/myriadfs.cpp b/src/myriadfs.cpp index af60c08..9f68253 100644 --- a/src/myriadfs.cpp +++ b/src/myriadfs.cpp | |||
@@ -1,3 +1,10 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. | ||
3 | * | ||
4 | * This file is part of the libbu++ library and is released under the | ||
5 | * terms of the license contained in the file LICENSE. | ||
6 | */ | ||
7 | |||
1 | #include "bu/myriadfs.h" | 8 | #include "bu/myriadfs.h" |
2 | #include "bu/myriadstream.h" | 9 | #include "bu/myriadstream.h" |
3 | 10 | ||
diff --git a/src/myriadfs.h b/src/myriadfs.h index 42a3493..edbdaf5 100644 --- a/src/myriadfs.h +++ b/src/myriadfs.h | |||
@@ -1,3 +1,10 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. | ||
3 | * | ||
4 | * This file is part of the libbu++ library and is released under the | ||
5 | * terms of the license contained in the file LICENSE. | ||
6 | */ | ||
7 | |||
1 | #ifndef MYRIAD_FS_H | 8 | #ifndef MYRIAD_FS_H |
2 | #define MYRIAD_FS_H | 9 | #define MYRIAD_FS_H |
3 | 10 | ||
diff --git a/src/myriadstream.cpp b/src/myriadstream.cpp index 74dca04..a968a0c 100644 --- a/src/myriadstream.cpp +++ b/src/myriadstream.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -46,13 +46,13 @@ void Bu::MyriadStream::close() | |||
46 | { | 46 | { |
47 | } | 47 | } |
48 | 48 | ||
49 | size_t Bu::MyriadStream::read( void *pBuf, size_t nBytes ) | 49 | Bu::size Bu::MyriadStream::read( void *pBuf, Bu::size nBytes ) |
50 | { | 50 | { |
51 | #ifdef MYRIAD_STREAM_DEBUG | 51 | #ifdef MYRIAD_STREAM_DEBUG |
52 | sio << "MyriadStream: read: " << __LINE__ << ": Started, asked to read " << nBytes << "b." | 52 | sio << "MyriadStream: read: " << __LINE__ << ": Started, asked to read " << nBytes << "b." |
53 | << sio.nl; | 53 | << sio.nl; |
54 | #endif | 54 | #endif |
55 | if( nBytes > (size_t)pStream->iSize-iPos ) | 55 | if( nBytes > (Bu::size)pStream->iSize-iPos ) |
56 | nBytes = pStream->iSize-iPos; | 56 | nBytes = pStream->iSize-iPos; |
57 | if( nBytes <= 0 ) | 57 | if( nBytes <= 0 ) |
58 | return 0; | 58 | return 0; |
@@ -109,7 +109,7 @@ size_t Bu::MyriadStream::read( void *pBuf, size_t nBytes ) | |||
109 | return nBytes; | 109 | return nBytes; |
110 | } | 110 | } |
111 | 111 | ||
112 | size_t Bu::MyriadStream::write( const void *pBuf, size_t nBytes ) | 112 | Bu::size Bu::MyriadStream::write( const void *pBuf, Bu::size nBytes ) |
113 | { | 113 | { |
114 | if( nBytes <= 0 ) | 114 | if( nBytes <= 0 ) |
115 | return 0; | 115 | return 0; |
@@ -215,22 +215,22 @@ size_t Bu::MyriadStream::write( const void *pBuf, size_t nBytes ) | |||
215 | return nBytes; | 215 | return nBytes; |
216 | } | 216 | } |
217 | 217 | ||
218 | long Bu::MyriadStream::tell() | 218 | Bu::size Bu::MyriadStream::tell() |
219 | { | 219 | { |
220 | return iPos; | 220 | return iPos; |
221 | } | 221 | } |
222 | 222 | ||
223 | void Bu::MyriadStream::seek( long offset ) | 223 | void Bu::MyriadStream::seek( Bu::size offset ) |
224 | { | 224 | { |
225 | iPos += offset; | 225 | iPos += offset; |
226 | } | 226 | } |
227 | 227 | ||
228 | void Bu::MyriadStream::setPos( long pos ) | 228 | void Bu::MyriadStream::setPos( Bu::size pos ) |
229 | { | 229 | { |
230 | iPos = pos; | 230 | iPos = pos; |
231 | } | 231 | } |
232 | 232 | ||
233 | void Bu::MyriadStream::setPosEnd( long pos ) | 233 | void Bu::MyriadStream::setPosEnd( Bu::size pos ) |
234 | { | 234 | { |
235 | iPos = pStream->iSize-pos; | 235 | iPos = pStream->iSize-pos; |
236 | } | 236 | } |
@@ -283,7 +283,7 @@ void Bu::MyriadStream::setBlocking( bool /*bBlocking*/ ) | |||
283 | { | 283 | { |
284 | } | 284 | } |
285 | 285 | ||
286 | void Bu::MyriadStream::setSize( long iSize ) | 286 | void Bu::MyriadStream::setSize( Bu::size iSize ) |
287 | { | 287 | { |
288 | if( iSize < 0 ) | 288 | if( iSize < 0 ) |
289 | iSize = 0; | 289 | iSize = 0; |
@@ -292,3 +292,20 @@ void Bu::MyriadStream::setSize( long iSize ) | |||
292 | iPos = iSize; | 292 | iPos = iSize; |
293 | } | 293 | } |
294 | 294 | ||
295 | Bu::size Bu::MyriadStream::getSize() const | ||
296 | { | ||
297 | return pStream->iSize; | ||
298 | } | ||
299 | |||
300 | Bu::size Bu::MyriadStream::getBlockSize() const | ||
301 | { | ||
302 | return rMyriad.getBlockSize(); | ||
303 | } | ||
304 | |||
305 | Bu::String Bu::MyriadStream::getLocation() const | ||
306 | { | ||
307 | Bu::String s; | ||
308 | s.format("%d", pStream->iId ); | ||
309 | return s; | ||
310 | } | ||
311 | |||
diff --git a/src/myriadstream.h b/src/myriadstream.h index 1a5e552..fdad669 100644 --- a/src/myriadstream.h +++ b/src/myriadstream.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -26,13 +26,13 @@ namespace Bu | |||
26 | virtual ~MyriadStream(); | 26 | virtual ~MyriadStream(); |
27 | 27 | ||
28 | virtual void close(); | 28 | virtual void close(); |
29 | virtual size_t read( void *pBuf, size_t nBytes ); | 29 | virtual Bu::size read( void *pBuf, Bu::size nBytes ); |
30 | virtual size_t write( const void *pBuf, size_t nBytes ); | 30 | virtual Bu::size write( const void *pBuf, Bu::size nBytes ); |
31 | using Stream::write; | 31 | using Stream::write; |
32 | virtual long tell(); | 32 | virtual Bu::size tell(); |
33 | virtual void seek( long offset ); | 33 | virtual void seek( Bu::size offset ); |
34 | virtual void setPos( long pos ); | 34 | virtual void setPos( Bu::size pos ); |
35 | virtual void setPosEnd( long pos ); | 35 | virtual void setPosEnd( Bu::size pos ); |
36 | virtual bool isEos(); | 36 | virtual bool isEos(); |
37 | virtual bool isOpen(); | 37 | virtual bool isOpen(); |
38 | virtual void flush(); | 38 | virtual void flush(); |
@@ -43,7 +43,11 @@ namespace Bu | |||
43 | virtual bool isSeekable(); | 43 | virtual bool isSeekable(); |
44 | virtual bool isBlocking(); | 44 | virtual bool isBlocking(); |
45 | virtual void setBlocking( bool bBlocking=true ); | 45 | virtual void setBlocking( bool bBlocking=true ); |
46 | virtual void setSize( long iSize ); | 46 | virtual void setSize( Bu::size iSize ); |
47 | |||
48 | virtual size getSize() const; | ||
49 | virtual size getBlockSize() const; | ||
50 | virtual Bu::String getLocation() const; | ||
47 | 51 | ||
48 | private: | 52 | private: |
49 | Myriad &rMyriad; | 53 | Myriad &rMyriad; |
diff --git a/src/newline.cpp b/src/newline.cpp index 8c5d3d5..ffc9eb0 100644 --- a/src/newline.cpp +++ b/src/newline.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -21,19 +21,19 @@ void Bu::NewLine::start() | |||
21 | { | 21 | { |
22 | } | 22 | } |
23 | 23 | ||
24 | size_t Bu::NewLine::stop() | 24 | Bu::size Bu::NewLine::stop() |
25 | { | 25 | { |
26 | return 0; | 26 | return 0; |
27 | } | 27 | } |
28 | 28 | ||
29 | size_t Bu::NewLine::read( void *pBufV, size_t iAmnt ) | 29 | Bu::size Bu::NewLine::read( void *pBufV, Bu::size iAmnt ) |
30 | { | 30 | { |
31 | size_t iTotal = 0; | 31 | Bu::size iTotal = 0; |
32 | size_t iOffset = 0; | 32 | Bu::size iOffset = 0; |
33 | size_t iRead = rNext.read( pBufV, iAmnt ); | 33 | Bu::size iRead = rNext.read( pBufV, iAmnt ); |
34 | char *pBuf = (char *)pBufV; | 34 | char *pBuf = (char *)pBufV; |
35 | 35 | ||
36 | for( size_t i = 0; i < iRead; i++ ) | 36 | for( Bu::size i = 0; i < iRead; i++ ) |
37 | { | 37 | { |
38 | if( pBuf[i] == '\r' ) | 38 | if( pBuf[i] == '\r' ) |
39 | { | 39 | { |
@@ -61,7 +61,7 @@ size_t Bu::NewLine::read( void *pBufV, size_t iAmnt ) | |||
61 | return iTotal; | 61 | return iTotal; |
62 | } | 62 | } |
63 | 63 | ||
64 | size_t Bu::NewLine::write( const void *, size_t ) | 64 | Bu::size Bu::NewLine::write( const void *, Bu::size ) |
65 | { | 65 | { |
66 | return 0; | 66 | return 0; |
67 | } | 67 | } |
diff --git a/src/newline.h b/src/newline.h index 243c876..afe0a84 100644 --- a/src/newline.h +++ b/src/newline.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -27,10 +27,10 @@ namespace Bu | |||
27 | virtual ~NewLine(); | 27 | virtual ~NewLine(); |
28 | 28 | ||
29 | virtual void start(); | 29 | virtual void start(); |
30 | virtual size_t stop(); | 30 | virtual Bu::size stop(); |
31 | 31 | ||
32 | virtual size_t read( void *pBuf, size_t iAmnt ); | 32 | virtual Bu::size read( void *pBuf, Bu::size iAmnt ); |
33 | virtual size_t write( const void *pBuf, size_t iAmnt ); | 33 | virtual Bu::size write( const void *pBuf, Bu::size iAmnt ); |
34 | 34 | ||
35 | private: | 35 | private: |
36 | bool bExChar; | 36 | bool bExChar; |
diff --git a/src/nullstream.cpp b/src/nullstream.cpp index 40c636c..9552cc5 100644 --- a/src/nullstream.cpp +++ b/src/nullstream.cpp | |||
@@ -1,3 +1,10 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. | ||
3 | * | ||
4 | * This file is part of the libbu++ library and is released under the | ||
5 | * terms of the license contained in the file LICENSE. | ||
6 | */ | ||
7 | |||
1 | #include "bu/nullstream.h" | 8 | #include "bu/nullstream.h" |
2 | 9 | ||
3 | Bu::NullStream::NullStream() : | 10 | Bu::NullStream::NullStream() : |
@@ -15,39 +22,39 @@ void Bu::NullStream::close() | |||
15 | sRead = sWrote = 0; | 22 | sRead = sWrote = 0; |
16 | } | 23 | } |
17 | 24 | ||
18 | size_t Bu::NullStream::read( void *pBuf, size_t nBytes ) | 25 | Bu::size Bu::NullStream::read( void *pBuf, Bu::size nBytes ) |
19 | { | 26 | { |
20 | memset( pBuf, 0, nBytes ); | 27 | memset( pBuf, 0, nBytes ); |
21 | sRead += nBytes; | 28 | sRead += nBytes; |
22 | return nBytes; | 29 | return nBytes; |
23 | } | 30 | } |
24 | 31 | ||
25 | Bu::FString Bu::NullStream::readLine() | 32 | Bu::String Bu::NullStream::readLine() |
26 | { | 33 | { |
27 | sRead++; | 34 | sRead++; |
28 | return Bu::FString("\0", 1 ); | 35 | return Bu::String("\0", 1 ); |
29 | } | 36 | } |
30 | 37 | ||
31 | size_t Bu::NullStream::write( const void *, size_t nBytes ) | 38 | Bu::size Bu::NullStream::write( const void *, Bu::size nBytes ) |
32 | { | 39 | { |
33 | sWrote += nBytes; | 40 | sWrote += nBytes; |
34 | return nBytes; | 41 | return nBytes; |
35 | } | 42 | } |
36 | 43 | ||
37 | long Bu::NullStream::tell() | 44 | Bu::size Bu::NullStream::tell() |
38 | { | 45 | { |
39 | return sRead + sWrote; | 46 | return sRead + sWrote; |
40 | } | 47 | } |
41 | 48 | ||
42 | void Bu::NullStream::seek( long ) | 49 | void Bu::NullStream::seek( Bu::size ) |
43 | { | 50 | { |
44 | } | 51 | } |
45 | 52 | ||
46 | void Bu::NullStream::setPos( long ) | 53 | void Bu::NullStream::setPos( Bu::size ) |
47 | { | 54 | { |
48 | } | 55 | } |
49 | 56 | ||
50 | void Bu::NullStream::setPosEnd( long ) | 57 | void Bu::NullStream::setPosEnd( Bu::size ) |
51 | { | 58 | { |
52 | } | 59 | } |
53 | 60 | ||
@@ -99,7 +106,22 @@ void Bu::NullStream::setBlocking( bool ) | |||
99 | { | 106 | { |
100 | } | 107 | } |
101 | 108 | ||
102 | void Bu::NullStream::setSize( long ) | 109 | void Bu::NullStream::setSize( Bu::size ) |
110 | { | ||
111 | } | ||
112 | |||
113 | Bu::size Bu::NullStream::getSize() const | ||
114 | { | ||
115 | return 0; | ||
116 | } | ||
117 | |||
118 | Bu::size Bu::NullStream::getBlockSize() const | ||
119 | { | ||
120 | return 0; | ||
121 | } | ||
122 | |||
123 | Bu::String Bu::NullStream::getLocation() const | ||
103 | { | 124 | { |
125 | return ""; | ||
104 | } | 126 | } |
105 | 127 | ||
diff --git a/src/nullstream.h b/src/nullstream.h index 1537ffb..9b75332 100644 --- a/src/nullstream.h +++ b/src/nullstream.h | |||
@@ -1,3 +1,10 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. | ||
3 | * | ||
4 | * This file is part of the libbu++ library and is released under the | ||
5 | * terms of the license contained in the file LICENSE. | ||
6 | */ | ||
7 | |||
1 | #ifndef BU_NULL_STREAM_H | 8 | #ifndef BU_NULL_STREAM_H |
2 | #define BU_NULL_STREAM_H | 9 | #define BU_NULL_STREAM_H |
3 | 10 | ||
@@ -24,14 +31,14 @@ namespace Bu | |||
24 | virtual ~NullStream(); | 31 | virtual ~NullStream(); |
25 | 32 | ||
26 | virtual void close(); | 33 | virtual void close(); |
27 | virtual size_t read( void *pBuf, size_t nBytes ); | 34 | virtual Bu::size read( void *pBuf, Bu::size nBytes ); |
28 | virtual Bu::FString readLine(); | 35 | virtual Bu::String readLine(); |
29 | virtual size_t write( const void *pBuf, size_t nBytes ); | 36 | virtual Bu::size write( const void *pBuf, Bu::size nBytes ); |
30 | using Bu::Stream::write; | 37 | using Bu::Stream::write; |
31 | virtual long tell(); | 38 | virtual Bu::size tell(); |
32 | virtual void seek( long offset ); | 39 | virtual void seek( Bu::size offset ); |
33 | virtual void setPos( long pos ); | 40 | virtual void setPos( Bu::size pos ); |
34 | virtual void setPosEnd( long pos ); | 41 | virtual void setPosEnd( Bu::size pos ); |
35 | virtual bool isEos(); | 42 | virtual bool isEos(); |
36 | virtual bool isOpen(); | 43 | virtual bool isOpen(); |
37 | virtual void flush(); | 44 | virtual void flush(); |
@@ -42,14 +49,18 @@ namespace Bu | |||
42 | virtual bool isSeekable(); | 49 | virtual bool isSeekable(); |
43 | virtual bool isBlocking(); | 50 | virtual bool isBlocking(); |
44 | virtual void setBlocking( bool bBlocking=true ); | 51 | virtual void setBlocking( bool bBlocking=true ); |
45 | virtual void setSize( long iSize ); | 52 | virtual void setSize( Bu::size iSize ); |
53 | |||
54 | virtual size getSize() const; | ||
55 | virtual size getBlockSize() const; | ||
56 | virtual Bu::String getLocation() const; | ||
46 | 57 | ||
47 | size_t getBytesRead() { return sRead; } | 58 | Bu::size getBytesRead() { return sRead; } |
48 | size_t getByetsWritten() { return sWrote; } | 59 | Bu::size getByetsWritten() { return sWrote; } |
49 | 60 | ||
50 | private: | 61 | private: |
51 | size_t sRead; | 62 | Bu::size sRead; |
52 | size_t sWrote; | 63 | Bu::size sWrote; |
53 | }; | 64 | }; |
54 | }; | 65 | }; |
55 | 66 | ||
diff --git a/src/optparser.cpp b/src/optparser.cpp index b81691d..bab93d0 100644 --- a/src/optparser.cpp +++ b/src/optparser.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -32,9 +32,9 @@ void Bu::OptParser::parse( int argc, char **argv ) | |||
32 | for( iEPos = 2; argv[j][iEPos] != '\0' && | 32 | for( iEPos = 2; argv[j][iEPos] != '\0' && |
33 | argv[j][iEPos] != '='; iEPos++ ) { } | 33 | argv[j][iEPos] != '='; iEPos++ ) { } |
34 | 34 | ||
35 | Bu::FString sOpt; | 35 | Bu::String sOpt; |
36 | int iCount = argc-j; | 36 | int iCount = argc-j; |
37 | Bu::FString sExtraParam; | 37 | Bu::String sExtraParam; |
38 | if( argv[j][iEPos] == '=' ) | 38 | if( argv[j][iEPos] == '=' ) |
39 | { | 39 | { |
40 | sOpt.set( argv[j]+2, iEPos-2 ); | 40 | sOpt.set( argv[j]+2, iEPos-2 ); |
@@ -92,7 +92,7 @@ void Bu::OptParser::parse( int argc, char **argv ) | |||
92 | { | 92 | { |
93 | if( !hsOption.has( argv[j][iCPos] ) ) | 93 | if( !hsOption.has( argv[j][iCPos] ) ) |
94 | { | 94 | { |
95 | Bu::FString sOpt("-"); | 95 | Bu::String sOpt("-"); |
96 | sOpt += argv[j][iCPos]; | 96 | sOpt += argv[j][iCPos]; |
97 | optionError( sOpt ); | 97 | optionError( sOpt ); |
98 | } | 98 | } |
@@ -181,17 +181,17 @@ void Bu::OptParser::setOverride( char cOpt, const Bu::Variant &sOverride ) | |||
181 | hsOption.get( cOpt )->sOverride = sOverride; | 181 | hsOption.get( cOpt )->sOverride = sOverride; |
182 | } | 182 | } |
183 | 183 | ||
184 | void Bu::OptParser::setOverride( const Bu::FString &sOpt, const Bu::Variant &sOverride ) | 184 | void Bu::OptParser::setOverride( const Bu::String &sOpt, const Bu::Variant &sOverride ) |
185 | { | 185 | { |
186 | hlOption.get( sOpt )->sOverride = sOverride; | 186 | hlOption.get( sOpt )->sOverride = sOverride; |
187 | } | 187 | } |
188 | 188 | ||
189 | void Bu::OptParser::setHelpDefault( const Bu::FString &sOpt, const Bu::FString &sTxt ) | 189 | void Bu::OptParser::setHelpDefault( const Bu::String &sOpt, const Bu::String &sTxt ) |
190 | { | 190 | { |
191 | hlOption.get( sOpt )->sHelpDefault = sTxt; | 191 | hlOption.get( sOpt )->sHelpDefault = sTxt; |
192 | } | 192 | } |
193 | 193 | ||
194 | void Bu::OptParser::addHelpOption( char c, const Bu::FString &s, const Bu::FString &sHelp ) | 194 | void Bu::OptParser::addHelpOption( char c, const Bu::String &s, const Bu::String &sHelp ) |
195 | { | 195 | { |
196 | Option o; | 196 | Option o; |
197 | o.sUsed = slot( this, &OptParser::optHelp ); | 197 | o.sUsed = slot( this, &OptParser::optHelp ); |
@@ -201,7 +201,7 @@ void Bu::OptParser::addHelpOption( char c, const Bu::FString &s, const Bu::FStri | |||
201 | addOption( o ); | 201 | addOption( o ); |
202 | } | 202 | } |
203 | 203 | ||
204 | void Bu::OptParser::addHelpBanner( const Bu::FString &sText, bool bFormatted ) | 204 | void Bu::OptParser::addHelpBanner( const Bu::String &sText, bool bFormatted ) |
205 | { | 205 | { |
206 | Banner b; | 206 | Banner b; |
207 | b.sText = sText; | 207 | b.sText = sText; |
@@ -290,7 +290,7 @@ int Bu::OptParser::optHelp( StrArray /*aParams*/ ) | |||
290 | return 0; | 290 | return 0; |
291 | } | 291 | } |
292 | 292 | ||
293 | void Bu::OptParser::optionError( const Bu::FString &sOption ) | 293 | void Bu::OptParser::optionError( const Bu::String &sOption ) |
294 | { | 294 | { |
295 | sio << "Unregcognized option discovered: " << sOption << sio.nl << sio.nl; | 295 | sio << "Unregcognized option discovered: " << sOption << sio.nl << sio.nl; |
296 | exit( 1 ); | 296 | exit( 1 ); |
@@ -301,11 +301,11 @@ void Bu::OptParser::setNonOption( OptionSignal sSignal ) | |||
301 | sNonOption = sSignal; | 301 | sNonOption = sSignal; |
302 | } | 302 | } |
303 | 303 | ||
304 | Bu::FString Bu::OptParser::format( const Bu::FString &sIn, int iWidth, | 304 | Bu::String Bu::OptParser::format( const Bu::String &sIn, int iWidth, |
305 | int iIndent ) | 305 | int iIndent ) |
306 | { | 306 | { |
307 | Bu::FString sOut; | 307 | Bu::String sOut; |
308 | Bu::FString sIndent; | 308 | Bu::String sIndent; |
309 | for( int j = 0; j < iIndent; j++ ) | 309 | for( int j = 0; j < iIndent; j++ ) |
310 | sIndent.append(" ", 1); | 310 | sIndent.append(" ", 1); |
311 | bool bFirst = true; | 311 | bool bFirst = true; |
@@ -314,8 +314,8 @@ Bu::FString Bu::OptParser::format( const Bu::FString &sIn, int iWidth, | |||
314 | int iPrevLineLen; | 314 | int iPrevLineLen; |
315 | int iLineLen = 0; | 315 | int iLineLen = 0; |
316 | char c; | 316 | char c; |
317 | Bu::FString::const_iterator iLastSpace, iStart; | 317 | Bu::String::const_iterator iLastSpace, iStart; |
318 | for( Bu::FString::const_iterator i = iLastSpace = iStart = sIn.begin(); i; i++ ) | 318 | for( Bu::String::const_iterator i = iLastSpace = iStart = sIn.begin(); i; i++ ) |
319 | { | 319 | { |
320 | c = *i; | 320 | c = *i; |
321 | if( *i == ' ' ) | 321 | if( *i == ' ' ) |
@@ -346,7 +346,7 @@ Bu::FString Bu::OptParser::format( const Bu::FString &sIn, int iWidth, | |||
346 | float fFill = 0.0; | 346 | float fFill = 0.0; |
347 | int iSubSpaceCount = 0; | 347 | int iSubSpaceCount = 0; |
348 | float fAdd = ((float)iExtraSpaces/(float)iSpaceCount); | 348 | float fAdd = ((float)iExtraSpaces/(float)iSpaceCount); |
349 | for( Bu::FString::const_iterator k = iStart; k != iLastSpace; k++ ) | 349 | for( Bu::String::const_iterator k = iStart; k != iLastSpace; k++ ) |
350 | { | 350 | { |
351 | sOut += *k; | 351 | sOut += *k; |
352 | if( *k == ' ' ) | 352 | if( *k == ' ' ) |
diff --git a/src/optparser.h b/src/optparser.h index 7ec69e5..4142e22 100644 --- a/src/optparser.h +++ b/src/optparser.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -8,7 +8,7 @@ | |||
8 | #ifndef BU_OPT_PARSER_H | 8 | #ifndef BU_OPT_PARSER_H |
9 | #define BU_OPT_PARSER_H | 9 | #define BU_OPT_PARSER_H |
10 | 10 | ||
11 | #include "bu/fstring.h" | 11 | #include "bu/string.h" |
12 | #include "bu/list.h" | 12 | #include "bu/list.h" |
13 | #include "bu/hash.h" | 13 | #include "bu/hash.h" |
14 | #include "bu/signals.h" | 14 | #include "bu/signals.h" |
@@ -19,7 +19,7 @@ | |||
19 | 19 | ||
20 | namespace Bu | 20 | namespace Bu |
21 | { | 21 | { |
22 | typedef Bu::Array<Bu::FString> StrArray; | 22 | typedef Bu::Array<Bu::String> StrArray; |
23 | 23 | ||
24 | /** | 24 | /** |
25 | * POSIX/Gnu style command line parser. Handles long and short options in | 25 | * POSIX/Gnu style command line parser. Handles long and short options in |
@@ -41,7 +41,7 @@ namespace Bu | |||
41 | _ValueProxy(); | 41 | _ValueProxy(); |
42 | virtual ~_ValueProxy(); | 42 | virtual ~_ValueProxy(); |
43 | 43 | ||
44 | virtual void setValueFromStr( const Bu::FString & )=0; | 44 | virtual void setValueFromStr( const Bu::String & )=0; |
45 | virtual void setValue( const Bu::Variant &vVar )=0; | 45 | virtual void setValue( const Bu::Variant &vVar )=0; |
46 | virtual _ValueProxy *clone()=0; | 46 | virtual _ValueProxy *clone()=0; |
47 | }; | 47 | }; |
@@ -59,7 +59,7 @@ namespace Bu | |||
59 | { | 59 | { |
60 | } | 60 | } |
61 | 61 | ||
62 | virtual void setValueFromStr( const Bu::FString &sVal ) | 62 | virtual void setValueFromStr( const Bu::String &sVal ) |
63 | { | 63 | { |
64 | Bu::MemBuf mb( sVal ); | 64 | Bu::MemBuf mb( sVal ); |
65 | Bu::Formatter f( mb ); | 65 | Bu::Formatter f( mb ); |
@@ -72,9 +72,9 @@ namespace Bu | |||
72 | { | 72 | { |
73 | v = vVar.get<ptype>(); | 73 | v = vVar.get<ptype>(); |
74 | } | 74 | } |
75 | else if( vVar.getType() == typeid(Bu::FString) ) | 75 | else if( vVar.getType() == typeid(Bu::String) ) |
76 | { | 76 | { |
77 | setValueFromStr( vVar.get<Bu::FString>() ); | 77 | setValueFromStr( vVar.get<Bu::String>() ); |
78 | } | 78 | } |
79 | else | 79 | else |
80 | { | 80 | { |
@@ -101,23 +101,23 @@ namespace Bu | |||
101 | virtual ~Option(); | 101 | virtual ~Option(); |
102 | 102 | ||
103 | char cOpt; | 103 | char cOpt; |
104 | Bu::FString sOpt; | 104 | Bu::String sOpt; |
105 | Bu::FString sHelp; | 105 | Bu::String sHelp; |
106 | OptionSignal sUsed; | 106 | OptionSignal sUsed; |
107 | _ValueProxy *pProxy; | 107 | _ValueProxy *pProxy; |
108 | Bu::Variant sOverride; | 108 | Bu::Variant sOverride; |
109 | Bu::FString sHelpDefault; | 109 | Bu::String sHelpDefault; |
110 | }; | 110 | }; |
111 | 111 | ||
112 | private: | 112 | private: |
113 | typedef Bu::List<Option> OptionList; | 113 | typedef Bu::List<Option> OptionList; |
114 | typedef Bu::Hash<char, Option *> ShortOptionHash; | 114 | typedef Bu::Hash<char, Option *> ShortOptionHash; |
115 | typedef Bu::Hash<Bu::FString, Option *> LongOptionHash; | 115 | typedef Bu::Hash<Bu::String, Option *> LongOptionHash; |
116 | 116 | ||
117 | class Banner | 117 | class Banner |
118 | { | 118 | { |
119 | public: | 119 | public: |
120 | Bu::FString sText; | 120 | Bu::String sText; |
121 | bool bFormatted; | 121 | bool bFormatted; |
122 | OptionList::const_iterator iAfter; | 122 | OptionList::const_iterator iAfter; |
123 | }; | 123 | }; |
@@ -133,8 +133,8 @@ namespace Bu | |||
133 | void addOption( const Option &opt ); | 133 | void addOption( const Option &opt ); |
134 | 134 | ||
135 | template<typename vtype> | 135 | template<typename vtype> |
136 | void addOption( vtype &var, char cOpt, const Bu::FString &sOpt, | 136 | void addOption( vtype &var, char cOpt, const Bu::String &sOpt, |
137 | const Bu::FString &sHelp ) | 137 | const Bu::String &sHelp ) |
138 | { | 138 | { |
139 | Option o; | 139 | Option o; |
140 | o.cOpt = cOpt; | 140 | o.cOpt = cOpt; |
@@ -145,20 +145,20 @@ namespace Bu | |||
145 | } | 145 | } |
146 | 146 | ||
147 | template<typename vtype> | 147 | template<typename vtype> |
148 | void addOption( vtype &var, const Bu::FString &sOpt, | 148 | void addOption( vtype &var, const Bu::String &sOpt, |
149 | const Bu::FString &sHelp ) | 149 | const Bu::String &sHelp ) |
150 | { | 150 | { |
151 | addOption( var, '\0', sOpt, sHelp ); | 151 | addOption( var, '\0', sOpt, sHelp ); |
152 | } | 152 | } |
153 | 153 | ||
154 | template<typename vtype> | 154 | template<typename vtype> |
155 | void addOption( vtype &var, char cOpt, const Bu::FString &sHelp ) | 155 | void addOption( vtype &var, char cOpt, const Bu::String &sHelp ) |
156 | { | 156 | { |
157 | addOption( var, cOpt, "", sHelp ); | 157 | addOption( var, cOpt, "", sHelp ); |
158 | } | 158 | } |
159 | 159 | ||
160 | void addOption( OptionSignal sUsed, char cOpt, const Bu::FString &sOpt, | 160 | void addOption( OptionSignal sUsed, char cOpt, const Bu::String &sOpt, |
161 | const Bu::FString &sHelp ) | 161 | const Bu::String &sHelp ) |
162 | { | 162 | { |
163 | Option o; | 163 | Option o; |
164 | o.cOpt = cOpt; | 164 | o.cOpt = cOpt; |
@@ -168,27 +168,27 @@ namespace Bu | |||
168 | addOption( o ); | 168 | addOption( o ); |
169 | } | 169 | } |
170 | 170 | ||
171 | void addOption( OptionSignal sUsed, const Bu::FString &sOpt, | 171 | void addOption( OptionSignal sUsed, const Bu::String &sOpt, |
172 | const Bu::FString &sHelp ) | 172 | const Bu::String &sHelp ) |
173 | { | 173 | { |
174 | addOption( sUsed, '\0', sOpt, sHelp ); | 174 | addOption( sUsed, '\0', sOpt, sHelp ); |
175 | } | 175 | } |
176 | 176 | ||
177 | void addOption( OptionSignal sUsed, char cOpt, | 177 | void addOption( OptionSignal sUsed, char cOpt, |
178 | const Bu::FString &sHelp ) | 178 | const Bu::String &sHelp ) |
179 | { | 179 | { |
180 | addOption( sUsed, cOpt, "", sHelp ); | 180 | addOption( sUsed, cOpt, "", sHelp ); |
181 | } | 181 | } |
182 | 182 | ||
183 | void setOverride( char cOpt, const Bu::Variant &sOverride ); | 183 | void setOverride( char cOpt, const Bu::Variant &sOverride ); |
184 | void setOverride( const Bu::FString &sOpt, | 184 | void setOverride( const Bu::String &sOpt, |
185 | const Bu::Variant &sOverride ); | 185 | const Bu::Variant &sOverride ); |
186 | 186 | ||
187 | void setHelpDefault( const Bu::FString &sOpt, const Bu::FString &sTxt ); | 187 | void setHelpDefault( const Bu::String &sOpt, const Bu::String &sTxt ); |
188 | 188 | ||
189 | void addHelpOption( char c='h', const Bu::FString &s="help", | 189 | void addHelpOption( char c='h', const Bu::String &s="help", |
190 | const Bu::FString &sHelp="This help." ); | 190 | const Bu::String &sHelp="This help." ); |
191 | void addHelpBanner( const Bu::FString &sText, bool bFormatted=true ); | 191 | void addHelpBanner( const Bu::String &sText, bool bFormatted=true ); |
192 | 192 | ||
193 | int optHelp( StrArray aParams ); | 193 | int optHelp( StrArray aParams ); |
194 | 194 | ||
@@ -200,12 +200,12 @@ namespace Bu | |||
200 | * been handled by an option, and isn't an option (starts with - or --). | 200 | * been handled by an option, and isn't an option (starts with - or --). |
201 | * To change this behaviour call | 201 | * To change this behaviour call |
202 | */ | 202 | */ |
203 | virtual void optionError( const Bu::FString &sOption ); | 203 | virtual void optionError( const Bu::String &sOption ); |
204 | 204 | ||
205 | void setNonOption( OptionSignal sSignal ); | 205 | void setNonOption( OptionSignal sSignal ); |
206 | 206 | ||
207 | private: | 207 | private: |
208 | Bu::FString format( const Bu::FString &sIn, int iWidth, int iIndent ); | 208 | Bu::String format( const Bu::String &sIn, int iWidth, int iIndent ); |
209 | 209 | ||
210 | OptionList lOption; | 210 | OptionList lOption; |
211 | ShortOptionHash hsOption; | 211 | ShortOptionHash hsOption; |
diff --git a/src/parser.cpp b/src/parser.cpp index 4ad4ff9..4d9f793 100644 --- a/src/parser.cpp +++ b/src/parser.cpp | |||
@@ -1,3 +1,10 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. | ||
3 | * | ||
4 | * This file is part of the libbu++ library and is released under the | ||
5 | * terms of the license contained in the file LICENSE. | ||
6 | */ | ||
7 | |||
1 | #include "bu/parser.h" | 8 | #include "bu/parser.h" |
2 | #include "bu/lexer.h" | 9 | #include "bu/lexer.h" |
3 | 10 | ||
@@ -172,12 +179,12 @@ void Bu::Parser::setRootNonTerminal( int iRoot ) | |||
172 | iRootNonTerminal = iRoot; | 179 | iRootNonTerminal = iRoot; |
173 | } | 180 | } |
174 | 181 | ||
175 | void Bu::Parser::setRootNonTerminal( const Bu::FString &sRoot ) | 182 | void Bu::Parser::setRootNonTerminal( const Bu::String &sRoot ) |
176 | { | 183 | { |
177 | setRootNonTerminal( hNonTerminalName.get( sRoot ) ); | 184 | setRootNonTerminal( hNonTerminalName.get( sRoot ) ); |
178 | } | 185 | } |
179 | 186 | ||
180 | int Bu::Parser::addNonTerminal( const Bu::FString &sName, NonTerminal &nt ) | 187 | int Bu::Parser::addNonTerminal( const Bu::String &sName, NonTerminal &nt ) |
181 | { | 188 | { |
182 | int iId = aNonTerminal.getSize(); | 189 | int iId = aNonTerminal.getSize(); |
183 | aNonTerminal.append( nt ); | 190 | aNonTerminal.append( nt ); |
@@ -186,7 +193,7 @@ int Bu::Parser::addNonTerminal( const Bu::FString &sName, NonTerminal &nt ) | |||
186 | return iId; | 193 | return iId; |
187 | } | 194 | } |
188 | 195 | ||
189 | int Bu::Parser::addNonTerminal( const Bu::FString &sName ) | 196 | int Bu::Parser::addNonTerminal( const Bu::String &sName ) |
190 | { | 197 | { |
191 | int iId = aNonTerminal.getSize(); | 198 | int iId = aNonTerminal.getSize(); |
192 | aNonTerminal.append( NonTerminal() ); | 199 | aNonTerminal.append( NonTerminal() ); |
@@ -195,22 +202,22 @@ int Bu::Parser::addNonTerminal( const Bu::FString &sName ) | |||
195 | return iId; | 202 | return iId; |
196 | } | 203 | } |
197 | 204 | ||
198 | void Bu::Parser::setNonTerminal( const Bu::FString &sName, NonTerminal &nt ) | 205 | void Bu::Parser::setNonTerminal( const Bu::String &sName, NonTerminal &nt ) |
199 | { | 206 | { |
200 | aNonTerminal[hNonTerminalName.get(sName)] = nt; | 207 | aNonTerminal[hNonTerminalName.get(sName)] = nt; |
201 | } | 208 | } |
202 | 209 | ||
203 | int Bu::Parser::getNonTerminalId( const Bu::FString &sName ) | 210 | int Bu::Parser::getNonTerminalId( const Bu::String &sName ) |
204 | { | 211 | { |
205 | return hNonTerminalName.get( sName ); | 212 | return hNonTerminalName.get( sName ); |
206 | } | 213 | } |
207 | 214 | ||
208 | bool Bu::Parser::hasNonTerminal( const Bu::FString &sName ) | 215 | bool Bu::Parser::hasNonTerminal( const Bu::String &sName ) |
209 | { | 216 | { |
210 | return hNonTerminalName.has( sName ); | 217 | return hNonTerminalName.has( sName ); |
211 | } | 218 | } |
212 | 219 | ||
213 | int Bu::Parser::addReduction( const Bu::FString &sName, const Reduction &r ) | 220 | int Bu::Parser::addReduction( const Bu::String &sName, const Reduction &r ) |
214 | { | 221 | { |
215 | int iId = aReduction.getSize(); | 222 | int iId = aReduction.getSize(); |
216 | aReduction.append( r ); | 223 | aReduction.append( r ); |
@@ -218,7 +225,7 @@ int Bu::Parser::addReduction( const Bu::FString &sName, const Reduction &r ) | |||
218 | return iId; | 225 | return iId; |
219 | } | 226 | } |
220 | 227 | ||
221 | int Bu::Parser::addReduction( const Bu::FString &sName ) | 228 | int Bu::Parser::addReduction( const Bu::String &sName ) |
222 | { | 229 | { |
223 | int iId = aReduction.getSize(); | 230 | int iId = aReduction.getSize(); |
224 | aReduction.append( Reduction() ); | 231 | aReduction.append( Reduction() ); |
@@ -226,17 +233,17 @@ int Bu::Parser::addReduction( const Bu::FString &sName ) | |||
226 | return iId; | 233 | return iId; |
227 | } | 234 | } |
228 | 235 | ||
229 | void Bu::Parser::setReduction( const Bu::FString &sName, const Reduction &r ) | 236 | void Bu::Parser::setReduction( const Bu::String &sName, const Reduction &r ) |
230 | { | 237 | { |
231 | aReduction[hReductionName.get(sName)] = r; | 238 | aReduction[hReductionName.get(sName)] = r; |
232 | } | 239 | } |
233 | 240 | ||
234 | int Bu::Parser::getReductionId( const Bu::FString &sName ) | 241 | int Bu::Parser::getReductionId( const Bu::String &sName ) |
235 | { | 242 | { |
236 | return hReductionName.get( sName ); | 243 | return hReductionName.get( sName ); |
237 | } | 244 | } |
238 | 245 | ||
239 | bool Bu::Parser::hasReduction( const Bu::FString &sName ) | 246 | bool Bu::Parser::hasReduction( const Bu::String &sName ) |
240 | { | 247 | { |
241 | return hReductionName.has( sName ); | 248 | return hReductionName.has( sName ); |
242 | } | 249 | } |
diff --git a/src/parser.h b/src/parser.h index a925188..a168c7b 100644 --- a/src/parser.h +++ b/src/parser.h | |||
@@ -1,7 +1,14 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. | ||
3 | * | ||
4 | * This file is part of the libbu++ library and is released under the | ||
5 | * terms of the license contained in the file LICENSE. | ||
6 | */ | ||
7 | |||
1 | #ifndef BU_PARSER_H | 8 | #ifndef BU_PARSER_H |
2 | #define BU_PARSER_H | 9 | #define BU_PARSER_H |
3 | 10 | ||
4 | #include "bu/fstring.h" | 11 | #include "bu/string.h" |
5 | #include "bu/list.h" | 12 | #include "bu/list.h" |
6 | #include "bu/array.h" | 13 | #include "bu/array.h" |
7 | #include "bu/hash.h" | 14 | #include "bu/hash.h" |
@@ -43,7 +50,7 @@ namespace Bu | |||
43 | void parse(); | 50 | void parse(); |
44 | 51 | ||
45 | void setRootNonTerminal( int iRoot ); | 52 | void setRootNonTerminal( int iRoot ); |
46 | void setRootNonTerminal( const Bu::FString &sRoot ); | 53 | void setRootNonTerminal( const Bu::String &sRoot ); |
47 | 54 | ||
48 | typedef Bu::Signal1<void, Parser &> Reduction; | 55 | typedef Bu::Signal1<void, Parser &> Reduction; |
49 | 56 | ||
@@ -87,17 +94,17 @@ namespace Bu | |||
87 | bool bCanSkip; | 94 | bool bCanSkip; |
88 | }; | 95 | }; |
89 | 96 | ||
90 | int addNonTerminal( const Bu::FString &sName, NonTerminal &nt ); | 97 | int addNonTerminal( const Bu::String &sName, NonTerminal &nt ); |
91 | int addNonTerminal( const Bu::FString &sName ); | 98 | int addNonTerminal( const Bu::String &sName ); |
92 | void setNonTerminal( const Bu::FString &sName, NonTerminal &nt ); | 99 | void setNonTerminal( const Bu::String &sName, NonTerminal &nt ); |
93 | int getNonTerminalId( const Bu::FString &sName ); | 100 | int getNonTerminalId( const Bu::String &sName ); |
94 | bool hasNonTerminal( const Bu::FString &sName ); | 101 | bool hasNonTerminal( const Bu::String &sName ); |
95 | 102 | ||
96 | int addReduction( const Bu::FString &sName, const Reduction &r ); | 103 | int addReduction( const Bu::String &sName, const Reduction &r ); |
97 | int addReduction( const Bu::FString &sName ); | 104 | int addReduction( const Bu::String &sName ); |
98 | void setReduction( const Bu::FString &sName, const Reduction &r ); | 105 | void setReduction( const Bu::String &sName, const Reduction &r ); |
99 | int getReductionId( const Bu::FString &sName ); | 106 | int getReductionId( const Bu::String &sName ); |
100 | bool hasReduction( const Bu::FString &sName ); | 107 | bool hasReduction( const Bu::String &sName ); |
101 | 108 | ||
102 | private: | 109 | private: |
103 | bool selectProduction( int iNt, Lexer::Token *ptCur ); | 110 | bool selectProduction( int iNt, Lexer::Token *ptCur ); |
@@ -108,7 +115,7 @@ namespace Bu | |||
108 | typedef Bu::List<Lexer::Token *> TokenStack; | 115 | typedef Bu::List<Lexer::Token *> TokenStack; |
109 | typedef Bu::List<Production::const_iterator> StateStack; | 116 | typedef Bu::List<Production::const_iterator> StateStack; |
110 | typedef Bu::Array<Reduction> ReductionArray; | 117 | typedef Bu::Array<Reduction> ReductionArray; |
111 | typedef Bu::Hash<Bu::FString,int> NameIndexHash; | 118 | typedef Bu::Hash<Bu::String,int> NameIndexHash; |
112 | typedef Bu::Array<NonTerminal> NonTerminalArray; | 119 | typedef Bu::Array<NonTerminal> NonTerminalArray; |
113 | 120 | ||
114 | LexerStack sLexer; | 121 | LexerStack sLexer; |
diff --git a/src/plugger.cpp b/src/plugger.cpp index 9d1ac3c..fb6850a 100644 --- a/src/plugger.cpp +++ b/src/plugger.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/plugger.h b/src/plugger.h index 2780356..2ba7b4b 100644 --- a/src/plugger.h +++ b/src/plugger.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -11,7 +11,7 @@ | |||
11 | #include "bu/hash.h" | 11 | #include "bu/hash.h" |
12 | #include "bu/list.h" | 12 | #include "bu/list.h" |
13 | #include "bu/exceptionbase.h" | 13 | #include "bu/exceptionbase.h" |
14 | #include "bu/fstring.h" | 14 | #include "bu/string.h" |
15 | #include <stddef.h> | 15 | #include <stddef.h> |
16 | 16 | ||
17 | #include "bu/config.h" | 17 | #include "bu/config.h" |
@@ -144,7 +144,7 @@ namespace Bu | |||
144 | class Plugger | 144 | class Plugger |
145 | { | 145 | { |
146 | public: | 146 | public: |
147 | typedef Bu::Hash<Bu::FString, PluginReg *> PluginHash; | 147 | typedef Bu::Hash<Bu::String, PluginReg *> PluginHash; |
148 | typedef Bu::Hash<ptrdiff_t, void *> InstHash; | 148 | typedef Bu::Hash<ptrdiff_t, void *> InstHash; |
149 | 149 | ||
150 | public: | 150 | public: |
@@ -184,8 +184,8 @@ namespace Bu | |||
184 | hPlugin.insert( pInfo->sID, pReg ); | 184 | hPlugin.insert( pInfo->sID, pReg ); |
185 | } | 185 | } |
186 | 186 | ||
187 | void registerExternalPlugin( const Bu::FString &sFName, | 187 | void registerExternalPlugin( const Bu::String &sFName, |
188 | const Bu::FString &sPluginName ) | 188 | const Bu::String &sPluginName ) |
189 | { | 189 | { |
190 | PluginReg *pReg; | 190 | PluginReg *pReg; |
191 | if( hPlugin.has( sPluginName ) ) | 191 | if( hPlugin.has( sPluginName ) ) |
@@ -227,7 +227,7 @@ namespace Bu | |||
227 | hPlugin.insert( pReg->pInfo->sID, pReg ); | 227 | hPlugin.insert( pReg->pInfo->sID, pReg ); |
228 | } | 228 | } |
229 | 229 | ||
230 | T *instantiate( const Bu::FString &lpName ) | 230 | T *instantiate( const Bu::String &lpName ) |
231 | { | 231 | { |
232 | PluginReg *pReg = (PluginReg *)hPlugin[lpName]; | 232 | PluginReg *pReg = (PluginReg *)hPlugin[lpName]; |
233 | if( pReg == NULL ) | 233 | if( pReg == NULL ) |
@@ -240,7 +240,7 @@ namespace Bu | |||
240 | return p; | 240 | return p; |
241 | } | 241 | } |
242 | 242 | ||
243 | bool hasPlugin( const Bu::FString &lpName ) | 243 | bool hasPlugin( const Bu::String &lpName ) |
244 | { | 244 | { |
245 | return hPlugin.has( lpName ); | 245 | return hPlugin.has( lpName ); |
246 | } | 246 | } |
@@ -275,7 +275,7 @@ namespace Bu | |||
275 | hPlugin.clear(); | 275 | hPlugin.clear(); |
276 | } | 276 | } |
277 | 277 | ||
278 | Bu::List<Bu::FString> getPluginList() | 278 | Bu::List<Bu::String> getPluginList() |
279 | { | 279 | { |
280 | return hPlugin.getKeys(); | 280 | return hPlugin.getKeys(); |
281 | } | 281 | } |
diff --git a/src/process.cpp b/src/process.cpp index 0e3e93a..8ea6ce3 100644 --- a/src/process.cpp +++ b/src/process.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -133,7 +133,7 @@ void Bu::Process::close() | |||
133 | } | 133 | } |
134 | } | 134 | } |
135 | 135 | ||
136 | size_t Bu::Process::read( void *pBuf, size_t nBytes ) | 136 | Bu::size Bu::Process::read( void *pBuf, Bu::size nBytes ) |
137 | { | 137 | { |
138 | if( bStdOutEos ) | 138 | if( bStdOutEos ) |
139 | return 0; | 139 | return 0; |
@@ -145,7 +145,7 @@ size_t Bu::Process::read( void *pBuf, size_t nBytes ) | |||
145 | throw Bu::ExceptionBase( strerror( errno ) ); | 145 | throw Bu::ExceptionBase( strerror( errno ) ); |
146 | if( FD_ISSET( iStdOut, &rfds ) || bBlocking ) | 146 | if( FD_ISSET( iStdOut, &rfds ) || bBlocking ) |
147 | { | 147 | { |
148 | ssize_t nRead = TEMP_FAILURE_RETRY( ::read( iStdOut, pBuf, nBytes ) ); | 148 | Bu::size nRead = TEMP_FAILURE_RETRY( ::read( iStdOut, pBuf, nBytes ) ); |
149 | if( nRead == 0 ) | 149 | if( nRead == 0 ) |
150 | { | 150 | { |
151 | bStdOutEos = true; | 151 | bStdOutEos = true; |
@@ -163,7 +163,7 @@ size_t Bu::Process::read( void *pBuf, size_t nBytes ) | |||
163 | return 0; | 163 | return 0; |
164 | } | 164 | } |
165 | 165 | ||
166 | size_t Bu::Process::readErr( void *pBuf, size_t nBytes ) | 166 | Bu::size Bu::Process::readErr( void *pBuf, Bu::size nBytes ) |
167 | { | 167 | { |
168 | if( bStdErrEos ) | 168 | if( bStdErrEos ) |
169 | return 0; | 169 | return 0; |
@@ -175,7 +175,7 @@ size_t Bu::Process::readErr( void *pBuf, size_t nBytes ) | |||
175 | throw Bu::ExceptionBase( strerror( errno ) ); | 175 | throw Bu::ExceptionBase( strerror( errno ) ); |
176 | if( FD_ISSET( iStdErr, &rfds ) || bBlocking ) | 176 | if( FD_ISSET( iStdErr, &rfds ) || bBlocking ) |
177 | { | 177 | { |
178 | ssize_t nRead = TEMP_FAILURE_RETRY( ::read( iStdErr, pBuf, nBytes ) ); | 178 | Bu::size nRead = TEMP_FAILURE_RETRY( ::read( iStdErr, pBuf, nBytes ) ); |
179 | if( nRead == 0 ) | 179 | if( nRead == 0 ) |
180 | { | 180 | { |
181 | bStdErrEos = true; | 181 | bStdErrEos = true; |
@@ -193,25 +193,25 @@ size_t Bu::Process::readErr( void *pBuf, size_t nBytes ) | |||
193 | return 0; | 193 | return 0; |
194 | } | 194 | } |
195 | 195 | ||
196 | size_t Bu::Process::write( const void *pBuf, size_t nBytes ) | 196 | Bu::size Bu::Process::write( const void *pBuf, Bu::size nBytes ) |
197 | { | 197 | { |
198 | return TEMP_FAILURE_RETRY( ::write( iStdIn, pBuf, nBytes ) ); | 198 | return TEMP_FAILURE_RETRY( ::write( iStdIn, pBuf, nBytes ) ); |
199 | } | 199 | } |
200 | 200 | ||
201 | long Bu::Process::tell() | 201 | Bu::size Bu::Process::tell() |
202 | { | 202 | { |
203 | return 0; | 203 | return 0; |
204 | } | 204 | } |
205 | 205 | ||
206 | void Bu::Process::seek( long ) | 206 | void Bu::Process::seek( Bu::size ) |
207 | { | 207 | { |
208 | } | 208 | } |
209 | 209 | ||
210 | void Bu::Process::setPos( long ) | 210 | void Bu::Process::setPos( Bu::size ) |
211 | { | 211 | { |
212 | } | 212 | } |
213 | 213 | ||
214 | void Bu::Process::setPosEnd( long ) | 214 | void Bu::Process::setPosEnd( Bu::size ) |
215 | { | 215 | { |
216 | } | 216 | } |
217 | 217 | ||
@@ -278,10 +278,25 @@ void Bu::Process::setBlocking( bool bBlocking ) | |||
278 | this->bBlocking = bBlocking; | 278 | this->bBlocking = bBlocking; |
279 | } | 279 | } |
280 | 280 | ||
281 | void Bu::Process::setSize( long ) | 281 | void Bu::Process::setSize( Bu::size ) |
282 | { | 282 | { |
283 | } | 283 | } |
284 | 284 | ||
285 | Bu::size Bu::Process::getBlockSize() const | ||
286 | { | ||
287 | return 0; | ||
288 | } | ||
289 | |||
290 | Bu::size Bu::Process::getSize() const | ||
291 | { | ||
292 | return 0; | ||
293 | } | ||
294 | |||
295 | Bu::String Bu::Process::getLocation() const | ||
296 | { | ||
297 | return ""; | ||
298 | } | ||
299 | |||
285 | void Bu::Process::select( bool &bStdOut, bool &bStdErr ) | 300 | void Bu::Process::select( bool &bStdOut, bool &bStdErr ) |
286 | { | 301 | { |
287 | fd_set rfds; | 302 | fd_set rfds; |
diff --git a/src/process.h b/src/process.h index 68678bd..4934408 100644 --- a/src/process.h +++ b/src/process.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -12,7 +12,7 @@ | |||
12 | #include <sys/types.h> | 12 | #include <sys/types.h> |
13 | 13 | ||
14 | #include "bu/stream.h" | 14 | #include "bu/stream.h" |
15 | #include "bu/fstring.h" | 15 | #include "bu/string.h" |
16 | 16 | ||
17 | namespace Bu | 17 | namespace Bu |
18 | { | 18 | { |
@@ -44,15 +44,15 @@ namespace Bu | |||
44 | void wait(); | 44 | void wait(); |
45 | 45 | ||
46 | virtual void close(); | 46 | virtual void close(); |
47 | virtual size_t read( void *pBuf, size_t nBytes ); | 47 | virtual Bu::size read( void *pBuf, Bu::size nBytes ); |
48 | virtual size_t readErr( void *pBuf, size_t nBytes ); | 48 | virtual Bu::size readErr( void *pBuf, Bu::size nBytes ); |
49 | virtual size_t write( const void *pBuf, size_t nBytes ); | 49 | virtual Bu::size write( const void *pBuf, Bu::size nBytes ); |
50 | using Stream::write; | 50 | using Stream::write; |
51 | 51 | ||
52 | virtual long tell(); | 52 | virtual Bu::size tell(); |
53 | virtual void seek( long offset ); | 53 | virtual void seek( Bu::size offset ); |
54 | virtual void setPos( long pos ); | 54 | virtual void setPos( Bu::size pos ); |
55 | virtual void setPosEnd( long pos ); | 55 | virtual void setPosEnd( Bu::size pos ); |
56 | virtual bool isEos(); | 56 | virtual bool isEos(); |
57 | virtual bool isOpen(); | 57 | virtual bool isOpen(); |
58 | 58 | ||
@@ -68,7 +68,11 @@ namespace Bu | |||
68 | virtual bool isBlocking(); | 68 | virtual bool isBlocking(); |
69 | virtual void setBlocking( bool bBlocking=true ); | 69 | virtual void setBlocking( bool bBlocking=true ); |
70 | 70 | ||
71 | virtual void setSize( long iSize ); | 71 | virtual void setSize( Bu::size iSize ); |
72 | |||
73 | virtual size getBlockSize() const; | ||
74 | virtual size getSize() const; | ||
75 | virtual Bu::String getLocation() const; | ||
72 | 76 | ||
73 | void select( bool &bStdOut, bool &bStdErr ); | 77 | void select( bool &bStdOut, bool &bStdErr ); |
74 | 78 | ||
diff --git a/src/programchain.cpp b/src/programchain.cpp index a86cf5a..ce0c9cc 100644 --- a/src/programchain.cpp +++ b/src/programchain.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/programchain.h b/src/programchain.h index 6d1666c..47797a2 100644 --- a/src/programchain.h +++ b/src/programchain.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/programlink.cpp b/src/programlink.cpp index c1a4df0..f9453c2 100644 --- a/src/programlink.cpp +++ b/src/programlink.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/programlink.h b/src/programlink.h index dc5e7e7..36a605e 100644 --- a/src/programlink.h +++ b/src/programlink.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/protocol.cpp b/src/protocol.cpp index 28d8c08..2489d05 100644 --- a/src/protocol.cpp +++ b/src/protocol.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -25,7 +25,7 @@ void Bu::Protocol::onNewData( Bu::Client * ) | |||
25 | { | 25 | { |
26 | } | 26 | } |
27 | 27 | ||
28 | void Bu::Protocol::onMessage( Bu::Client *, const Bu::FString & ) | 28 | void Bu::Protocol::onMessage( Bu::Client *, const Bu::String & ) |
29 | { | 29 | { |
30 | } | 30 | } |
31 | 31 | ||
diff --git a/src/protocol.h b/src/protocol.h index f462060..0058723 100644 --- a/src/protocol.h +++ b/src/protocol.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -10,7 +10,7 @@ | |||
10 | 10 | ||
11 | #include <stdint.h> | 11 | #include <stdint.h> |
12 | 12 | ||
13 | #include "bu/fstring.h" | 13 | #include "bu/string.h" |
14 | 14 | ||
15 | namespace Bu | 15 | namespace Bu |
16 | { | 16 | { |
@@ -27,7 +27,7 @@ namespace Bu | |||
27 | 27 | ||
28 | virtual void onNewConnection( Bu::Client *pClient ); | 28 | virtual void onNewConnection( Bu::Client *pClient ); |
29 | virtual void onNewData( Bu::Client *pClient ); | 29 | virtual void onNewData( Bu::Client *pClient ); |
30 | virtual void onMessage( Bu::Client *pClient, const Bu::FString &sMsg ); | 30 | virtual void onMessage( Bu::Client *pClient, const Bu::String &sMsg ); |
31 | virtual void onTick( Bu::Client *pClient ); | 31 | virtual void onTick( Bu::Client *pClient ); |
32 | 32 | ||
33 | private: | 33 | private: |
diff --git a/src/protocolhttp.cpp b/src/protocolhttp.cpp index 2a7fbdf..eaee9d0 100644 --- a/src/protocolhttp.cpp +++ b/src/protocolhttp.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -51,7 +51,7 @@ void Bu::ProtocolHttp::onNewData( Bu::Client *pClient ) | |||
51 | 51 | ||
52 | for(;;) | 52 | for(;;) |
53 | { | 53 | { |
54 | Bu::FString sToken; | 54 | Bu::String sToken; |
55 | TokenType tt = getToken( sToken ); | 55 | TokenType tt = getToken( sToken ); |
56 | 56 | ||
57 | if( tt == ttOutOfData ) | 57 | if( tt == ttOutOfData ) |
@@ -148,7 +148,7 @@ void Bu::ProtocolHttp::onNewData( Bu::Client *pClient ) | |||
148 | } | 148 | } |
149 | } | 149 | } |
150 | 150 | ||
151 | Bu::ProtocolHttp::TokenType Bu::ProtocolHttp::getToken( Bu::FString &line ) | 151 | Bu::ProtocolHttp::TokenType Bu::ProtocolHttp::getToken( Bu::String &line ) |
152 | { | 152 | { |
153 | char s; | 153 | char s; |
154 | int jmax = pClient->getInputSize(); | 154 | int jmax = pClient->getInputSize(); |
@@ -330,7 +330,7 @@ Bu::ProtocolHttp::Response::Response( int iCode ) : | |||
330 | } | 330 | } |
331 | } | 331 | } |
332 | 332 | ||
333 | Bu::ProtocolHttp::Response::Response( int iCode, const Bu::FString &sReason ) : | 333 | Bu::ProtocolHttp::Response::Response( int iCode, const Bu::String &sReason ) : |
334 | iCode( iCode ), | 334 | iCode( iCode ), |
335 | sReason( sReason ) | 335 | sReason( sReason ) |
336 | { | 336 | { |
@@ -341,12 +341,12 @@ Bu::ProtocolHttp::Response::~Response() | |||
341 | } | 341 | } |
342 | 342 | ||
343 | void Bu::ProtocolHttp::Response::setHeader( | 343 | void Bu::ProtocolHttp::Response::setHeader( |
344 | const Bu::FString &sKey, const Bu::FString &sVal ) | 344 | const Bu::String &sKey, const Bu::String &sVal ) |
345 | { | 345 | { |
346 | hHeaders.insert( sKey, sVal ); | 346 | hHeaders.insert( sKey, sVal ); |
347 | } | 347 | } |
348 | 348 | ||
349 | void Bu::ProtocolHttp::Response::setContent( const Bu::FString &sCont ) | 349 | void Bu::ProtocolHttp::Response::setContent( const Bu::String &sCont ) |
350 | { | 350 | { |
351 | sContent = sCont; | 351 | sContent = sCont; |
352 | } | 352 | } |
diff --git a/src/protocolhttp.h b/src/protocolhttp.h index 80a0db6..153a00d 100644 --- a/src/protocolhttp.h +++ b/src/protocolhttp.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -13,7 +13,7 @@ | |||
13 | 13 | ||
14 | #include "bu/protocol.h" | 14 | #include "bu/protocol.h" |
15 | #include "bu/client.h" | 15 | #include "bu/client.h" |
16 | #include "bu/fstring.h" | 16 | #include "bu/string.h" |
17 | #include "bu/hash.h" | 17 | #include "bu/hash.h" |
18 | 18 | ||
19 | namespace Bu | 19 | namespace Bu |
@@ -32,7 +32,7 @@ namespace Bu | |||
32 | class ProtocolHttp : public Protocol | 32 | class ProtocolHttp : public Protocol |
33 | { | 33 | { |
34 | public: /* Types */ | 34 | public: /* Types */ |
35 | typedef Bu::List<Bu::FString> TokenList; | 35 | typedef Bu::List<Bu::String> TokenList; |
36 | 36 | ||
37 | public: /* Interface */ | 37 | public: /* Interface */ |
38 | ProtocolHttp(); | 38 | ProtocolHttp(); |
@@ -42,25 +42,25 @@ namespace Bu | |||
42 | virtual void onNewData( Bu::Client *pClient ); | 42 | virtual void onNewData( Bu::Client *pClient ); |
43 | 43 | ||
44 | virtual void onRequest( | 44 | virtual void onRequest( |
45 | const Bu::FString &sMethod, const Bu::FString &sPath )=0; | 45 | const Bu::String &sMethod, const Bu::String &sPath )=0; |
46 | 46 | ||
47 | class Response | 47 | class Response |
48 | { | 48 | { |
49 | friend class Bu::ProtocolHttp; | 49 | friend class Bu::ProtocolHttp; |
50 | public: | 50 | public: |
51 | Response( int iCode ); | 51 | Response( int iCode ); |
52 | Response( int iCode, const Bu::FString &sReason ); | 52 | Response( int iCode, const Bu::String &sReason ); |
53 | virtual ~Response(); | 53 | virtual ~Response(); |
54 | 54 | ||
55 | void setHeader( const Bu::FString &sKey, const Bu::FString &sVal ); | 55 | void setHeader( const Bu::String &sKey, const Bu::String &sVal ); |
56 | void setContent( const Bu::FString &sCont ); | 56 | void setContent( const Bu::String &sCont ); |
57 | 57 | ||
58 | private: | 58 | private: |
59 | int iCode; | 59 | int iCode; |
60 | Bu::FString sReason; | 60 | Bu::String sReason; |
61 | typedef Bu::Hash<Bu::FString,Bu::FString> StringHash; | 61 | typedef Bu::Hash<Bu::String,Bu::String> StringHash; |
62 | StringHash hHeaders; | 62 | StringHash hHeaders; |
63 | Bu::FString sContent; | 63 | Bu::String sContent; |
64 | }; | 64 | }; |
65 | 65 | ||
66 | void sendResponse( const Response &rRes ); | 66 | void sendResponse( const Response &rRes ); |
@@ -83,7 +83,7 @@ namespace Bu | |||
83 | * processed, false if the end-of-line has not been reached, and more | 83 | * processed, false if the end-of-line has not been reached, and more |
84 | * data needs to be read before this operation can continue. | 84 | * data needs to be read before this operation can continue. |
85 | */ | 85 | */ |
86 | TokenType getToken( Bu::FString &line ); | 86 | TokenType getToken( Bu::String &line ); |
87 | bool isWS( char buf ); | 87 | bool isWS( char buf ); |
88 | bool isSeperator( char buf ); | 88 | bool isSeperator( char buf ); |
89 | 89 | ||
@@ -96,8 +96,8 @@ namespace Bu | |||
96 | 96 | ||
97 | int iState; | 97 | int iState; |
98 | 98 | ||
99 | Bu::FString sMethod; | 99 | Bu::String sMethod; |
100 | Bu::FString sPath; | 100 | Bu::String sPath; |
101 | int iMajor; | 101 | int iMajor; |
102 | int iMinor; | 102 | int iMinor; |
103 | }; | 103 | }; |
diff --git a/src/protocoltelnet.cpp b/src/protocoltelnet.cpp index 362b1cc..7e37cca 100644 --- a/src/protocoltelnet.cpp +++ b/src/protocoltelnet.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -273,7 +273,7 @@ bool Bu::ProtocolTelnet::isCanonical() | |||
273 | return bCanonical; | 273 | return bCanonical; |
274 | } | 274 | } |
275 | 275 | ||
276 | void Bu::ProtocolTelnet::write( const Bu::FString &sData ) | 276 | void Bu::ProtocolTelnet::write( const Bu::String &sData ) |
277 | { | 277 | { |
278 | write( sData.getStr(), sData.getSize() ); | 278 | write( sData.getStr(), sData.getSize() ); |
279 | } | 279 | } |
diff --git a/src/protocoltelnet.h b/src/protocoltelnet.h index 253be79..74d6478 100644 --- a/src/protocoltelnet.h +++ b/src/protocoltelnet.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -10,7 +10,7 @@ | |||
10 | 10 | ||
11 | #include "bu/protocol.h" | 11 | #include "bu/protocol.h" |
12 | #include "bu/hash.h" | 12 | #include "bu/hash.h" |
13 | #include "bu/fstring.h" | 13 | #include "bu/string.h" |
14 | 14 | ||
15 | // #define __TELNET_DEBUG | 15 | // #define __TELNET_DEBUG |
16 | 16 | ||
@@ -88,7 +88,7 @@ namespace Bu | |||
88 | * the line or not, the data will be cleared from the buffer when this | 88 | * the line or not, the data will be cleared from the buffer when this |
89 | * function returns, any changes made to the buffer will be destroyed. | 89 | * function returns, any changes made to the buffer will be destroyed. |
90 | */ | 90 | */ |
91 | virtual void gotLine( Bu::FString & /*sLine*/ ){}; | 91 | virtual void gotLine( Bu::String & /*sLine*/ ){}; |
92 | 92 | ||
93 | /** | 93 | /** |
94 | * Override this function to be notified of any new data that comes in | 94 | * Override this function to be notified of any new data that comes in |
@@ -98,7 +98,7 @@ namespace Bu | |||
98 | * child class in this function, the buffer will never be cleared unless | 98 | * child class in this function, the buffer will never be cleared unless |
99 | * it happens in this function's override. | 99 | * it happens in this function's override. |
100 | */ | 100 | */ |
101 | virtual void gotData( Bu::FString & /*sData*/ ){}; | 101 | virtual void gotData( Bu::String & /*sData*/ ){}; |
102 | 102 | ||
103 | /** | 103 | /** |
104 | * Using this function to enable or disable canonical mode only affects | 104 | * Using this function to enable or disable canonical mode only affects |
@@ -117,11 +117,11 @@ namespace Bu | |||
117 | void setCanonical( bool bCon=true ); | 117 | void setCanonical( bool bCon=true ); |
118 | bool isCanonical(); | 118 | bool isCanonical(); |
119 | 119 | ||
120 | void write( const Bu::FString &sData ); | 120 | void write( const Bu::String &sData ); |
121 | void write( const char *pData, int iSize ); | 121 | void write( const char *pData, int iSize ); |
122 | void write( char cData ); | 122 | void write( char cData ); |
123 | 123 | ||
124 | const Bu::FString &getBuffer() { return sDataBuf; } | 124 | const Bu::String &getBuffer() { return sDataBuf; } |
125 | 125 | ||
126 | public: | 126 | public: |
127 | /** | 127 | /** |
@@ -138,7 +138,7 @@ namespace Bu | |||
138 | * sSubBuf, it will be cleared as soon as this function returns anyway. | 138 | * sSubBuf, it will be cleared as soon as this function returns anyway. |
139 | */ | 139 | */ |
140 | virtual void onSubUnknown( char /*cSubOpt*/, | 140 | virtual void onSubUnknown( char /*cSubOpt*/, |
141 | Bu::FString & /*sSubBuf*/ ){}; | 141 | Bu::String & /*sSubBuf*/ ){}; |
142 | 142 | ||
143 | private: | 143 | private: |
144 | /** | 144 | /** |
@@ -208,8 +208,8 @@ namespace Bu | |||
208 | private: | 208 | private: |
209 | Client *pClient; | 209 | Client *pClient; |
210 | 210 | ||
211 | Bu::FString sDataBuf; /**< Buffer for regular line data. */ | 211 | Bu::String sDataBuf; /**< Buffer for regular line data. */ |
212 | Bu::FString sSubBuf; /**< Buffer for subnegotiation data. */ | 212 | Bu::String sSubBuf; /**< Buffer for subnegotiation data. */ |
213 | char cSubOpt; /**< Which suboption are we processing. */ | 213 | char cSubOpt; /**< Which suboption are we processing. */ |
214 | 214 | ||
215 | bool bCanonical; /**< Are we canonicalizing incoming data? */ | 215 | bool bCanonical; /**< Are we canonicalizing incoming data? */ |
diff --git a/src/queue.cpp b/src/queue.cpp index c6486eb..9d6edac 100644 --- a/src/queue.cpp +++ b/src/queue.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/queue.h b/src/queue.h index bfb07e4..e5d9b5f 100644 --- a/src/queue.h +++ b/src/queue.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/queuebuf.cpp b/src/queuebuf.cpp index e8eb2ed..69abf4b 100644 --- a/src/queuebuf.cpp +++ b/src/queuebuf.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -37,7 +37,7 @@ void Bu::QueueBuf::close() | |||
37 | iReadOffset = iWriteOffset = iTotalSize = 0; | 37 | iReadOffset = iWriteOffset = iTotalSize = 0; |
38 | } | 38 | } |
39 | 39 | ||
40 | size_t Bu::QueueBuf::read( void *pRawBuf, size_t nBytes ) | 40 | Bu::size Bu::QueueBuf::read( void *pRawBuf, Bu::size nBytes ) |
41 | { | 41 | { |
42 | if( nBytes <= 0 ) | 42 | if( nBytes <= 0 ) |
43 | return 0; | 43 | return 0; |
@@ -45,7 +45,7 @@ size_t Bu::QueueBuf::read( void *pRawBuf, size_t nBytes ) | |||
45 | if( lBlocks.isEmpty() ) | 45 | if( lBlocks.isEmpty() ) |
46 | return 0; | 46 | return 0; |
47 | 47 | ||
48 | size_t iLeft = nBytes; | 48 | Bu::size iLeft = nBytes; |
49 | char *pBuf = (char *)pRawBuf; | 49 | char *pBuf = (char *)pRawBuf; |
50 | 50 | ||
51 | while( iLeft > 0 && iTotalSize > 0 ) | 51 | while( iLeft > 0 && iTotalSize > 0 ) |
@@ -60,7 +60,7 @@ size_t Bu::QueueBuf::read( void *pRawBuf, size_t nBytes ) | |||
60 | iReadOffset = 0; | 60 | iReadOffset = 0; |
61 | } | 61 | } |
62 | char *pBlock = lBlocks.first(); | 62 | char *pBlock = lBlocks.first(); |
63 | size_t iCopy = iBlockSize-iReadOffset; | 63 | Bu::size iCopy = iBlockSize-iReadOffset; |
64 | if( iLeft < iCopy ) | 64 | if( iLeft < iCopy ) |
65 | iCopy = iLeft; | 65 | iCopy = iLeft; |
66 | if( iTotalSize < iCopy ) | 66 | if( iTotalSize < iCopy ) |
@@ -76,12 +76,12 @@ size_t Bu::QueueBuf::read( void *pRawBuf, size_t nBytes ) | |||
76 | return nBytes - iLeft; | 76 | return nBytes - iLeft; |
77 | } | 77 | } |
78 | 78 | ||
79 | size_t Bu::QueueBuf::peek( void *pBuf, size_t nBytes ) | 79 | Bu::size Bu::QueueBuf::peek( void *pBuf, Bu::size nBytes ) |
80 | { | 80 | { |
81 | return peek( pBuf, nBytes, 0 ); | 81 | return peek( pBuf, nBytes, 0 ); |
82 | } | 82 | } |
83 | 83 | ||
84 | size_t Bu::QueueBuf::peek( void *pRawBuf, size_t nBytes, size_t nSkip ) | 84 | Bu::size Bu::QueueBuf::peek( void *pRawBuf, Bu::size nBytes, Bu::size nSkip ) |
85 | { | 85 | { |
86 | if( nBytes <= 0 ) | 86 | if( nBytes <= 0 ) |
87 | return 0; | 87 | return 0; |
@@ -89,11 +89,11 @@ size_t Bu::QueueBuf::peek( void *pRawBuf, size_t nBytes, size_t nSkip ) | |||
89 | if( lBlocks.isEmpty() ) | 89 | if( lBlocks.isEmpty() ) |
90 | return 0; | 90 | return 0; |
91 | 91 | ||
92 | size_t iLeft = nBytes; | 92 | Bu::size iLeft = nBytes; |
93 | char *pBuf = (char *)pRawBuf; | 93 | char *pBuf = (char *)pRawBuf; |
94 | 94 | ||
95 | int iTmpReadOffset = iReadOffset + nSkip; | 95 | int iTmpReadOffset = iReadOffset + nSkip; |
96 | size_t iTmpRemSize = iTotalSize; | 96 | Bu::size iTmpRemSize = iTotalSize; |
97 | BlockList::iterator iBlock = lBlocks.begin(); | 97 | BlockList::iterator iBlock = lBlocks.begin(); |
98 | while( iTmpReadOffset > iBlockSize ) | 98 | while( iTmpReadOffset > iBlockSize ) |
99 | { | 99 | { |
@@ -112,7 +112,7 @@ size_t Bu::QueueBuf::peek( void *pRawBuf, size_t nBytes, size_t nSkip ) | |||
112 | iTmpReadOffset = 0; | 112 | iTmpReadOffset = 0; |
113 | } | 113 | } |
114 | char *pBlock = *iBlock; | 114 | char *pBlock = *iBlock; |
115 | size_t iCopy = iBlockSize-iTmpReadOffset; | 115 | Bu::size iCopy = iBlockSize-iTmpReadOffset; |
116 | if( iLeft < iCopy ) | 116 | if( iLeft < iCopy ) |
117 | iCopy = iLeft; | 117 | iCopy = iLeft; |
118 | if( iTmpRemSize < iCopy ) | 118 | if( iTmpRemSize < iCopy ) |
@@ -129,7 +129,7 @@ size_t Bu::QueueBuf::peek( void *pRawBuf, size_t nBytes, size_t nSkip ) | |||
129 | return nBytes - iLeft; | 129 | return nBytes - iLeft; |
130 | } | 130 | } |
131 | 131 | ||
132 | size_t Bu::QueueBuf::write( const void *pRawBuf, size_t nBytes ) | 132 | Bu::size Bu::QueueBuf::write( const void *pRawBuf, Bu::size nBytes ) |
133 | { | 133 | { |
134 | if( nBytes <= 0 ) | 134 | if( nBytes <= 0 ) |
135 | return 0; | 135 | return 0; |
@@ -139,7 +139,7 @@ size_t Bu::QueueBuf::write( const void *pRawBuf, size_t nBytes ) | |||
139 | addBlock(); | 139 | addBlock(); |
140 | iWriteOffset = 0; | 140 | iWriteOffset = 0; |
141 | } | 141 | } |
142 | size_t iLeft = nBytes; | 142 | Bu::size iLeft = nBytes; |
143 | const char *pBuf = (const char *)pRawBuf; | 143 | const char *pBuf = (const char *)pRawBuf; |
144 | 144 | ||
145 | while( iLeft > 0 ) | 145 | while( iLeft > 0 ) |
@@ -150,7 +150,7 @@ size_t Bu::QueueBuf::write( const void *pRawBuf, size_t nBytes ) | |||
150 | iWriteOffset = 0; | 150 | iWriteOffset = 0; |
151 | } | 151 | } |
152 | char *pBlock = lBlocks.last(); | 152 | char *pBlock = lBlocks.last(); |
153 | size_t iCopy = iBlockSize-iWriteOffset; | 153 | Bu::size iCopy = iBlockSize-iWriteOffset; |
154 | if( iLeft < iCopy ) | 154 | if( iLeft < iCopy ) |
155 | iCopy = iLeft; | 155 | iCopy = iLeft; |
156 | memcpy( pBlock+iWriteOffset, pBuf, iCopy ); | 156 | memcpy( pBlock+iWriteOffset, pBuf, iCopy ); |
@@ -165,17 +165,17 @@ size_t Bu::QueueBuf::write( const void *pRawBuf, size_t nBytes ) | |||
165 | return nBytes; | 165 | return nBytes; |
166 | } | 166 | } |
167 | 167 | ||
168 | long Bu::QueueBuf::tell() | 168 | Bu::size Bu::QueueBuf::tell() |
169 | { | 169 | { |
170 | return -1; | 170 | return -1; |
171 | } | 171 | } |
172 | 172 | ||
173 | void Bu::QueueBuf::seek( long iAmnt ) | 173 | void Bu::QueueBuf::seek( Bu::size iAmnt ) |
174 | { | 174 | { |
175 | if( iAmnt <= 0 ) | 175 | if( iAmnt <= 0 ) |
176 | return; | 176 | return; |
177 | 177 | ||
178 | if( (size_t)iAmnt >= iTotalSize ) | 178 | if( (Bu::size)iAmnt >= iTotalSize ) |
179 | { | 179 | { |
180 | // sio << "seek: clear all data (" << iAmnt << ">=" << iTotalSize | 180 | // sio << "seek: clear all data (" << iAmnt << ">=" << iTotalSize |
181 | // << ")." << sio.nl; | 181 | // << ")." << sio.nl; |
@@ -193,11 +193,11 @@ void Bu::QueueBuf::seek( long iAmnt ) | |||
193 | } | 193 | } |
194 | } | 194 | } |
195 | 195 | ||
196 | void Bu::QueueBuf::setPos( long ) | 196 | void Bu::QueueBuf::setPos( Bu::size ) |
197 | { | 197 | { |
198 | } | 198 | } |
199 | 199 | ||
200 | void Bu::QueueBuf::setPosEnd( long ) | 200 | void Bu::QueueBuf::setPosEnd( Bu::size ) |
201 | { | 201 | { |
202 | } | 202 | } |
203 | 203 | ||
@@ -249,10 +249,25 @@ void Bu::QueueBuf::setBlocking( bool ) | |||
249 | { | 249 | { |
250 | } | 250 | } |
251 | 251 | ||
252 | void Bu::QueueBuf::setSize( long ) | 252 | void Bu::QueueBuf::setSize( Bu::size ) |
253 | { | 253 | { |
254 | } | 254 | } |
255 | 255 | ||
256 | Bu::size Bu::QueueBuf::getSize() const | ||
257 | { | ||
258 | return iTotalSize; | ||
259 | } | ||
260 | |||
261 | Bu::size Bu::QueueBuf::getBlockSize() const | ||
262 | { | ||
263 | return iBlockSize; | ||
264 | } | ||
265 | |||
266 | Bu::String Bu::QueueBuf::getLocation() const | ||
267 | { | ||
268 | return ""; | ||
269 | } | ||
270 | |||
256 | void Bu::QueueBuf::addBlock() | 271 | void Bu::QueueBuf::addBlock() |
257 | { | 272 | { |
258 | lBlocks.append( new char[iBlockSize] ); | 273 | lBlocks.append( new char[iBlockSize] ); |
diff --git a/src/queuebuf.h b/src/queuebuf.h index 395c6ba..84b50e1 100644 --- a/src/queuebuf.h +++ b/src/queuebuf.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -27,14 +27,14 @@ namespace Bu | |||
27 | int getSize(); | 27 | int getSize(); |
28 | 28 | ||
29 | virtual void close(); | 29 | virtual void close(); |
30 | virtual size_t read( void *pBuf, size_t nBytes ); | 30 | virtual Bu::size read( void *pBuf, Bu::size nBytes ); |
31 | virtual size_t peek( void *pBuf, size_t nBytes ); | 31 | virtual Bu::size peek( void *pBuf, Bu::size nBytes ); |
32 | virtual size_t peek( void *pBuf, size_t nBytes, size_t nSkip ); | 32 | virtual Bu::size peek( void *pBuf, Bu::size nBytes, Bu::size nSkip ); |
33 | virtual size_t write( const void *pBuf, size_t nBytes ); | 33 | virtual Bu::size write( const void *pBuf, Bu::size nBytes ); |
34 | virtual long tell(); | 34 | virtual Bu::size tell(); |
35 | virtual void seek( long offset ); | 35 | virtual void seek( Bu::size offset ); |
36 | virtual void setPos( long pos ); | 36 | virtual void setPos( Bu::size pos ); |
37 | virtual void setPosEnd( long pos ); | 37 | virtual void setPosEnd( Bu::size pos ); |
38 | virtual bool isEos(); | 38 | virtual bool isEos(); |
39 | virtual bool isOpen(); | 39 | virtual bool isOpen(); |
40 | virtual void flush(); | 40 | virtual void flush(); |
@@ -45,7 +45,11 @@ namespace Bu | |||
45 | virtual bool isSeekable(); | 45 | virtual bool isSeekable(); |
46 | virtual bool isBlocking(); | 46 | virtual bool isBlocking(); |
47 | virtual void setBlocking( bool bBlocking=true ); | 47 | virtual void setBlocking( bool bBlocking=true ); |
48 | virtual void setSize( long iSize ); | 48 | virtual void setSize( Bu::size iSize ); |
49 | |||
50 | virtual size getSize() const; | ||
51 | virtual size getBlockSize() const; | ||
52 | virtual Bu::String getLocation() const; | ||
49 | 53 | ||
50 | private: | 54 | private: |
51 | void addBlock(); | 55 | void addBlock(); |
@@ -55,7 +59,7 @@ namespace Bu | |||
55 | int iBlockSize; | 59 | int iBlockSize; |
56 | int iReadOffset; | 60 | int iReadOffset; |
57 | int iWriteOffset; | 61 | int iWriteOffset; |
58 | size_t iTotalSize; | 62 | Bu::size iTotalSize; |
59 | typedef Bu::List<char *> BlockList; | 63 | typedef Bu::List<char *> BlockList; |
60 | BlockList lBlocks; | 64 | BlockList lBlocks; |
61 | }; | 65 | }; |
diff --git a/src/regex.cpp b/src/regex.cpp index e634639..af0d364 100644 --- a/src/regex.cpp +++ b/src/regex.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -19,7 +19,7 @@ Bu::RegEx::RegEx() : | |||
19 | { | 19 | { |
20 | } | 20 | } |
21 | 21 | ||
22 | Bu::RegEx::RegEx( const Bu::FString &sSrc ) : | 22 | Bu::RegEx::RegEx( const Bu::String &sSrc ) : |
23 | pRegEx( NULL ), | 23 | pRegEx( NULL ), |
24 | bCompiled( false ), | 24 | bCompiled( false ), |
25 | paSubStr( NULL ) | 25 | paSubStr( NULL ) |
@@ -37,7 +37,7 @@ Bu::RegEx::~RegEx() | |||
37 | } | 37 | } |
38 | } | 38 | } |
39 | 39 | ||
40 | void Bu::RegEx::compile( const Bu::FString &sSrc ) | 40 | void Bu::RegEx::compile( const Bu::String &sSrc ) |
41 | { | 41 | { |
42 | if( bCompiled ) | 42 | if( bCompiled ) |
43 | { | 43 | { |
@@ -54,7 +54,7 @@ void Bu::RegEx::compile( const Bu::FString &sSrc ) | |||
54 | size_t length = regerror( nErr, re, NULL, 0 ); | 54 | size_t length = regerror( nErr, re, NULL, 0 ); |
55 | char *buffer = new char[length]; | 55 | char *buffer = new char[length]; |
56 | (void) regerror( nErr, re, buffer, length ); | 56 | (void) regerror( nErr, re, buffer, length ); |
57 | Bu::FString s( buffer ); | 57 | Bu::String s( buffer ); |
58 | delete[] buffer; | 58 | delete[] buffer; |
59 | throw "???"; // BuildException( s.getStr() ); | 59 | throw "???"; // BuildException( s.getStr() ); |
60 | } | 60 | } |
@@ -70,7 +70,7 @@ int Bu::RegEx::getNumSubStrings() | |||
70 | return nSubStr; | 70 | return nSubStr; |
71 | } | 71 | } |
72 | 72 | ||
73 | bool Bu::RegEx::execute( const Bu::FString &sSrc ) | 73 | bool Bu::RegEx::execute( const Bu::String &sSrc ) |
74 | { | 74 | { |
75 | sTest = sSrc; | 75 | sTest = sSrc; |
76 | if( regexec( re, sSrc.getStr(), nSubStr, aSubStr, 0 ) ) | 76 | if( regexec( re, sSrc.getStr(), nSubStr, aSubStr, 0 ) ) |
@@ -84,10 +84,10 @@ void Bu::RegEx::getSubStringRange( int nIndex, int &iStart, int &iEnd ) | |||
84 | iEnd = aSubStr[nIndex].rm_eo; | 84 | iEnd = aSubStr[nIndex].rm_eo; |
85 | } | 85 | } |
86 | 86 | ||
87 | Bu::FString Bu::RegEx::getSubString( int nIndex ) | 87 | Bu::String Bu::RegEx::getSubString( int nIndex ) |
88 | { | 88 | { |
89 | // regmatch_t *Subs = aSubStr; | 89 | // regmatch_t *Subs = aSubStr; |
90 | return Bu::FString( | 90 | return Bu::String( |
91 | sTest.getStr()+aSubStr[nIndex].rm_so, | 91 | sTest.getStr()+aSubStr[nIndex].rm_so, |
92 | aSubStr[nIndex].rm_eo - aSubStr[nIndex].rm_so | 92 | aSubStr[nIndex].rm_eo - aSubStr[nIndex].rm_so |
93 | ); | 93 | ); |
diff --git a/src/regex.h b/src/regex.h index 6aac8e3..f0aa5d5 100644 --- a/src/regex.h +++ b/src/regex.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -8,7 +8,7 @@ | |||
8 | #ifndef BU_REG_EX_H | 8 | #ifndef BU_REG_EX_H |
9 | #define BU_REG_EX_H | 9 | #define BU_REG_EX_H |
10 | 10 | ||
11 | #include "bu/fstring.h" | 11 | #include "bu/string.h" |
12 | 12 | ||
13 | #include <stdint.h> | 13 | #include <stdint.h> |
14 | 14 | ||
@@ -18,22 +18,22 @@ namespace Bu | |||
18 | { | 18 | { |
19 | public: | 19 | public: |
20 | RegEx(); | 20 | RegEx(); |
21 | RegEx( const Bu::FString &sSrc ); | 21 | RegEx( const Bu::String &sSrc ); |
22 | virtual ~RegEx(); | 22 | virtual ~RegEx(); |
23 | 23 | ||
24 | void compile( const Bu::FString &sSrc ); | 24 | void compile( const Bu::String &sSrc ); |
25 | int getNumSubStrings(); | 25 | int getNumSubStrings(); |
26 | bool execute( const Bu::FString &sSrc ); | 26 | bool execute( const Bu::String &sSrc ); |
27 | void getSubStringRange( int nIndex, int &iStart, int &iEnd ); | 27 | void getSubStringRange( int nIndex, int &iStart, int &iEnd ); |
28 | Bu::FString getSubString( int nIndex ); | 28 | Bu::String getSubString( int nIndex ); |
29 | const Bu::FString &getSource() | 29 | const Bu::String &getSource() |
30 | { | 30 | { |
31 | return sSrc; | 31 | return sSrc; |
32 | } | 32 | } |
33 | 33 | ||
34 | private: | 34 | private: |
35 | Bu::FString sSrc; | 35 | Bu::String sSrc; |
36 | Bu::FString sTest; | 36 | Bu::String sTest; |
37 | void *pRegEx; | 37 | void *pRegEx; |
38 | bool bCompiled; | 38 | bool bCompiled; |
39 | int nSubStr; | 39 | int nSubStr; |
diff --git a/src/ringbuffer.cpp b/src/ringbuffer.cpp index 1dc603c..99b1b1c 100644 --- a/src/ringbuffer.cpp +++ b/src/ringbuffer.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/ringbuffer.h b/src/ringbuffer.h index f4fd58c..f43773d 100644 --- a/src/ringbuffer.h +++ b/src/ringbuffer.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/server.cpp b/src/server.cpp index e701a69..1972a3f 100644 --- a/src/server.cpp +++ b/src/server.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -34,7 +34,7 @@ void Bu::Server::addPort( int nPort, int nPoolSize ) | |||
34 | hServers.insert( nSocket, s ); | 34 | hServers.insert( nSocket, s ); |
35 | } | 35 | } |
36 | 36 | ||
37 | void Bu::Server::addPort( const FString &sAddr, int nPort, int nPoolSize ) | 37 | void Bu::Server::addPort( const String &sAddr, int nPort, int nPoolSize ) |
38 | { | 38 | { |
39 | TcpServerSocket *s = new TcpServerSocket( sAddr, nPort, nPoolSize ); | 39 | TcpServerSocket *s = new TcpServerSocket( sAddr, nPort, nPoolSize ); |
40 | int nSocket = s->getSocket(); | 40 | int nSocket = s->getSocket(); |
@@ -153,7 +153,7 @@ Bu::Server::SrvClientLink::~SrvClientLink() | |||
153 | { | 153 | { |
154 | } | 154 | } |
155 | 155 | ||
156 | void Bu::Server::SrvClientLink::sendMessage( const Bu::FString &sMsg ) | 156 | void Bu::Server::SrvClientLink::sendMessage( const Bu::String &sMsg ) |
157 | { | 157 | { |
158 | pClient->onMessage( sMsg ); | 158 | pClient->onMessage( sMsg ); |
159 | } | 159 | } |
diff --git a/src/server.h b/src/server.h index d6726fd..c59543a 100644 --- a/src/server.h +++ b/src/server.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -14,7 +14,7 @@ | |||
14 | #include <sys/select.h> | 14 | #include <sys/select.h> |
15 | #endif | 15 | #endif |
16 | 16 | ||
17 | #include "bu/fstring.h" | 17 | #include "bu/string.h" |
18 | #include "bu/list.h" | 18 | #include "bu/list.h" |
19 | 19 | ||
20 | #include "bu/clientlink.h" | 20 | #include "bu/clientlink.h" |
@@ -56,7 +56,7 @@ namespace Bu | |||
56 | virtual ~Server(); | 56 | virtual ~Server(); |
57 | 57 | ||
58 | void addPort( int nPort, int nPoolSize=40 ); | 58 | void addPort( int nPort, int nPoolSize=40 ); |
59 | void addPort( const FString &sAddr, int nPort, int nPoolSize=40 ); | 59 | void addPort( const String &sAddr, int nPort, int nPoolSize=40 ); |
60 | 60 | ||
61 | virtual void scan(); | 61 | virtual void scan(); |
62 | void setTimeout( int nTimeoutSec, int nTimeoutUSec=0 ); | 62 | void setTimeout( int nTimeoutSec, int nTimeoutUSec=0 ); |
@@ -79,7 +79,7 @@ namespace Bu | |||
79 | SrvClientLink( Bu::Client *pClient ); | 79 | SrvClientLink( Bu::Client *pClient ); |
80 | virtual ~SrvClientLink(); | 80 | virtual ~SrvClientLink(); |
81 | 81 | ||
82 | virtual void sendMessage( const Bu::FString &sMsg ); | 82 | virtual void sendMessage( const Bu::String &sMsg ); |
83 | 83 | ||
84 | private: | 84 | private: |
85 | Bu::Client *pClient; | 85 | Bu::Client *pClient; |
diff --git a/src/set.cpp b/src/set.cpp index f9937ef..e4e2849 100644 --- a/src/set.cpp +++ b/src/set.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/sha1.cpp b/src/sha1.cpp index a206a78..bfe4c5a 100644 --- a/src/sha1.cpp +++ b/src/sha1.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -38,7 +38,7 @@ void Bu::Sha1::reset() | |||
38 | uTotalBytes = 0; | 38 | uTotalBytes = 0; |
39 | } | 39 | } |
40 | 40 | ||
41 | void Bu::Sha1::setSalt( const Bu::FString & /*sSalt*/ ) | 41 | void Bu::Sha1::setSalt( const Bu::String & /*sSalt*/ ) |
42 | { | 42 | { |
43 | } | 43 | } |
44 | 44 | ||
@@ -73,7 +73,7 @@ void Bu::Sha1::addData( const void *sDataRaw, int iSize ) | |||
73 | } | 73 | } |
74 | } | 74 | } |
75 | 75 | ||
76 | Bu::FString Bu::Sha1::getResult() | 76 | Bu::String Bu::Sha1::getResult() |
77 | { | 77 | { |
78 | // save the message size | 78 | // save the message size |
79 | uint32_t totalBitsL = uTotalBytes << 3; | 79 | uint32_t totalBitsL = uTotalBytes << 3; |
@@ -102,7 +102,7 @@ Bu::FString Bu::Sha1::getResult() | |||
102 | // finish the final block | 102 | // finish the final block |
103 | addData( (char*)footer, iNeededZeros + 8 ); | 103 | addData( (char*)footer, iNeededZeros + 8 ); |
104 | 104 | ||
105 | Bu::FString sRet( 20 ); | 105 | Bu::String sRet( 20 ); |
106 | 106 | ||
107 | unsigned char *digest = (unsigned char *)sRet.getStr(); | 107 | unsigned char *digest = (unsigned char *)sRet.getStr(); |
108 | 108 | ||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -26,10 +26,10 @@ namespace Bu | |||
26 | ~Sha1(); | 26 | ~Sha1(); |
27 | 27 | ||
28 | virtual void reset(); | 28 | virtual void reset(); |
29 | virtual void setSalt( const Bu::FString &sSalt ); | 29 | virtual void setSalt( const Bu::String &sSalt ); |
30 | virtual void addData( const void *sData, int iSize ); | 30 | virtual void addData( const void *sData, int iSize ); |
31 | using CryptoHash::addData; | 31 | using CryptoHash::addData; |
32 | virtual FString getResult(); | 32 | virtual String getResult(); |
33 | virtual void writeResult( Stream &sOut ); | 33 | virtual void writeResult( Stream &sOut ); |
34 | 34 | ||
35 | void update( const char* data, int num ); | 35 | void update( const char* data, int num ); |
diff --git a/src/sharedcore.cpp b/src/sharedcore.cpp index 2c18872..75f92eb 100644 --- a/src/sharedcore.cpp +++ b/src/sharedcore.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/sharedcore.h b/src/sharedcore.h index 1887ca2..bf9395c 100644 --- a/src/sharedcore.h +++ b/src/sharedcore.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/signals.cpp b/src/signals.cpp index 7ba02c5..ffbc7ba 100644 --- a/src/signals.cpp +++ b/src/signals.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/signals.h b/src/signals.h index 5bdc53d..39f15ec 100644 --- a/src/signals.h +++ b/src/signals.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/singleton.h b/src/singleton.h index 5bc7abe..13db01b 100644 --- a/src/singleton.h +++ b/src/singleton.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/sio.cpp b/src/sio.cpp index 4567297..0fe60d9 100644 --- a/src/sio.cpp +++ b/src/sio.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/sptr.cpp b/src/sptr.cpp index 5761825..ea21e3b 100644 --- a/src/sptr.cpp +++ b/src/sptr.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/stack.cpp b/src/stack.cpp index 5d2a2c6..73352d3 100644 --- a/src/stack.cpp +++ b/src/stack.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/stack.h b/src/stack.h index 11ad057..a6ea1b9 100644 --- a/src/stack.h +++ b/src/stack.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/stdstream.cpp b/src/stdstream.cpp index 32ddec4..b1d5d61 100644 --- a/src/stdstream.cpp +++ b/src/stdstream.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -20,30 +20,30 @@ void Bu::StdStream::close() | |||
20 | { | 20 | { |
21 | } | 21 | } |
22 | 22 | ||
23 | size_t Bu::StdStream::read( void *pBuf, size_t nBytes ) | 23 | Bu::size Bu::StdStream::read( void *pBuf, Bu::size nBytes ) |
24 | { | 24 | { |
25 | return fread( pBuf, 1, nBytes, stdin ); | 25 | return fread( pBuf, 1, nBytes, stdin ); |
26 | } | 26 | } |
27 | 27 | ||
28 | size_t Bu::StdStream::write( const void *pBuf, size_t nBytes ) | 28 | Bu::size Bu::StdStream::write( const void *pBuf, Bu::size nBytes ) |
29 | { | 29 | { |
30 | return fwrite( pBuf, 1, nBytes, stdout ); | 30 | return fwrite( pBuf, 1, nBytes, stdout ); |
31 | } | 31 | } |
32 | 32 | ||
33 | long Bu::StdStream::tell() | 33 | Bu::size Bu::StdStream::tell() |
34 | { | 34 | { |
35 | return 0; | 35 | return 0; |
36 | } | 36 | } |
37 | 37 | ||
38 | void Bu::StdStream::seek( long ) | 38 | void Bu::StdStream::seek( Bu::size ) |
39 | { | 39 | { |
40 | } | 40 | } |
41 | 41 | ||
42 | void Bu::StdStream::setPos( long ) | 42 | void Bu::StdStream::setPos( Bu::size ) |
43 | { | 43 | { |
44 | } | 44 | } |
45 | 45 | ||
46 | void Bu::StdStream::setPosEnd( long ) | 46 | void Bu::StdStream::setPosEnd( Bu::size ) |
47 | { | 47 | { |
48 | } | 48 | } |
49 | 49 | ||
@@ -96,7 +96,22 @@ void Bu::StdStream::setBlocking( bool ) | |||
96 | { | 96 | { |
97 | } | 97 | } |
98 | 98 | ||
99 | void Bu::StdStream::setSize( long ) | 99 | void Bu::StdStream::setSize( Bu::size ) |
100 | { | 100 | { |
101 | } | 101 | } |
102 | 102 | ||
103 | Bu::size Bu::StdStream::getSize() const | ||
104 | { | ||
105 | return 0; | ||
106 | } | ||
107 | |||
108 | Bu::size Bu::StdStream::getBlockSize() const | ||
109 | { | ||
110 | return 0; | ||
111 | } | ||
112 | |||
113 | Bu::String Bu::StdStream::getLocation() const | ||
114 | { | ||
115 | return ""; | ||
116 | } | ||
117 | |||
diff --git a/src/stdstream.h b/src/stdstream.h index 4efeece..ff6c774 100644 --- a/src/stdstream.h +++ b/src/stdstream.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -23,13 +23,13 @@ namespace Bu | |||
23 | virtual ~StdStream(); | 23 | virtual ~StdStream(); |
24 | 24 | ||
25 | virtual void close(); | 25 | virtual void close(); |
26 | virtual size_t read( void *pBuf, size_t nBytes ); | 26 | virtual size read( void *pBuf, size nBytes ); |
27 | virtual size_t write( const void *pBuf, size_t nBytes ); | 27 | virtual size write( const void *pBuf, size nBytes ); |
28 | using Stream::write; | 28 | using Stream::write; |
29 | virtual long tell(); | 29 | virtual size tell(); |
30 | virtual void seek( long offset ); | 30 | virtual void seek( size offset ); |
31 | virtual void setPos( long pos ); | 31 | virtual void setPos( size pos ); |
32 | virtual void setPosEnd( long pos ); | 32 | virtual void setPosEnd( size pos ); |
33 | virtual bool isEos(); | 33 | virtual bool isEos(); |
34 | virtual bool isOpen(); | 34 | virtual bool isOpen(); |
35 | virtual void flush(); | 35 | virtual void flush(); |
@@ -40,7 +40,10 @@ namespace Bu | |||
40 | virtual bool isSeekable(); | 40 | virtual bool isSeekable(); |
41 | virtual bool isBlocking(); | 41 | virtual bool isBlocking(); |
42 | virtual void setBlocking( bool bBlocking=true ); | 42 | virtual void setBlocking( bool bBlocking=true ); |
43 | virtual void setSize( long iSize ); | 43 | virtual void setSize( size iSize ); |
44 | virtual size getSize() const; | ||
45 | virtual size getBlockSize() const; | ||
46 | virtual Bu::String getLocation() const; | ||
44 | }; | 47 | }; |
45 | } | 48 | } |
46 | 49 | ||
diff --git a/src/stream.cpp b/src/stream.cpp index 0e05cad..028166e 100644 --- a/src/stream.cpp +++ b/src/stream.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -15,9 +15,9 @@ Bu::Stream::~Stream() | |||
15 | { | 15 | { |
16 | } | 16 | } |
17 | 17 | ||
18 | Bu::FString Bu::Stream::readLine() | 18 | Bu::String Bu::Stream::readLine() |
19 | { | 19 | { |
20 | Bu::FString sRet; | 20 | Bu::String sRet; |
21 | 21 | ||
22 | for(;;) | 22 | for(;;) |
23 | { | 23 | { |
@@ -30,7 +30,7 @@ Bu::FString Bu::Stream::readLine() | |||
30 | } | 30 | } |
31 | } | 31 | } |
32 | 32 | ||
33 | size_t Bu::Stream::write( const Bu::FString &sBuf ) | 33 | Bu::size Bu::Stream::write( const Bu::String &sBuf ) |
34 | { | 34 | { |
35 | return write( sBuf.getStr(), sBuf.getSize() ); | 35 | return write( sBuf.getStr(), sBuf.getSize() ); |
36 | } | 36 | } |
diff --git a/src/stream.h b/src/stream.h index 0ea5560..fb70f21 100644 --- a/src/stream.h +++ b/src/stream.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -8,10 +8,12 @@ | |||
8 | #ifndef BU_STREAM_H | 8 | #ifndef BU_STREAM_H |
9 | #define BU_STREAM_H | 9 | #define BU_STREAM_H |
10 | 10 | ||
11 | #include "bu/config.h" | ||
12 | |||
11 | #include <stdint.h> | 13 | #include <stdint.h> |
12 | #include <stdio.h> | 14 | #include <stdio.h> |
13 | 15 | ||
14 | #include "bu/fstring.h" | 16 | #include "bu/string.h" |
15 | 17 | ||
16 | namespace Bu | 18 | namespace Bu |
17 | { | 19 | { |
@@ -43,7 +45,7 @@ namespace Bu | |||
43 | *@param nBytes (size_t) Max data to read. | 45 | *@param nBytes (size_t) Max data to read. |
44 | *@returns (size_t) Amount of data read. | 46 | *@returns (size_t) Amount of data read. |
45 | */ | 47 | */ |
46 | virtual size_t read( void *pBuf, size_t nBytes ) = 0; | 48 | virtual size read( void *pBuf, size iBytes ) = 0; |
47 | 49 | ||
48 | /** | 50 | /** |
49 | * Attempts to read a complete line from the stream. This will stop | 51 | * Attempts to read a complete line from the stream. This will stop |
@@ -51,7 +53,7 @@ namespace Bu | |||
51 | * data in a non-blocking stream. | 53 | * data in a non-blocking stream. |
52 | *@returns The line read, not including newline character. | 54 | *@returns The line read, not including newline character. |
53 | */ | 55 | */ |
54 | virtual Bu::FString readLine(); | 56 | virtual Bu::String readLine(); |
55 | 57 | ||
56 | /** | 58 | /** |
57 | * Write data to the stream. | 59 | * Write data to the stream. |
@@ -59,33 +61,33 @@ namespace Bu | |||
59 | *@param nBytes (size_t) Amount of data to write from pBuf. | 61 | *@param nBytes (size_t) Amount of data to write from pBuf. |
60 | *@returns (size_t) Amount of data actually written. | 62 | *@returns (size_t) Amount of data actually written. |
61 | */ | 63 | */ |
62 | virtual size_t write( const void *pBuf, size_t nBytes ) = 0; | 64 | virtual size write( const void *pBuf, size iBytes ) = 0; |
63 | 65 | ||
64 | virtual size_t write( const Bu::FString &sBuf ); | 66 | virtual size write( const Bu::String &sBuf ); |
65 | 67 | ||
66 | /** | 68 | /** |
67 | * Get the current position in the stream. | 69 | * Get the current position in the stream. |
68 | *@returns (long) The current position in the stream. | 70 | *@returns (long) The current position in the stream. |
69 | */ | 71 | */ |
70 | virtual long tell() = 0; | 72 | virtual size tell() = 0; |
71 | 73 | ||
72 | /** | 74 | /** |
73 | * Seek to a position in the stream relative to the current position. | 75 | * Seek to a position in the stream relative to the current position. |
74 | *@param offset (long) Offset from current position to seek to. | 76 | *@param offset (long) Offset from current position to seek to. |
75 | */ | 77 | */ |
76 | virtual void seek( long offset ) = 0; | 78 | virtual void seek( size offset ) = 0; |
77 | 79 | ||
78 | /** | 80 | /** |
79 | * Set position in the stream relative to the start of the stream. | 81 | * Set position in the stream relative to the start of the stream. |
80 | *@param pos (long) The position. | 82 | *@param pos (long) The position. |
81 | */ | 83 | */ |
82 | virtual void setPos( long pos ) = 0; | 84 | virtual void setPos( size pos ) = 0; |
83 | 85 | ||
84 | /** | 86 | /** |
85 | * Set position in the stream relative to the end of the stream. | 87 | * Set position in the stream relative to the end of the stream. |
86 | *@param pos (long) The position. | 88 | *@param pos (long) The position. |
87 | */ | 89 | */ |
88 | virtual void setPosEnd( long pos ) = 0; | 90 | virtual void setPosEnd( size pos ) = 0; |
89 | 91 | ||
90 | /** | 92 | /** |
91 | * Are we at the end of the stream? | 93 | * Are we at the end of the stream? |
@@ -158,10 +160,32 @@ namespace Bu | |||
158 | * removed from the end of the stream, but the content of the added | 160 | * removed from the end of the stream, but the content of the added |
159 | * data is undefined. | 161 | * data is undefined. |
160 | */ | 162 | */ |
161 | virtual void setSize( long iSize ) = 0; | 163 | virtual void setSize( size iSize ) = 0; |
164 | |||
165 | /** | ||
166 | * Returns the size of the stream if the stream can have a size. For | ||
167 | * streams that do not (sockets, pipes, etc.) this should throw an | ||
168 | * unsupported exception. | ||
169 | */ | ||
170 | virtual size getSize() const = 0; | ||
162 | 171 | ||
163 | public: // Filters | 172 | /** |
173 | * Returns the block-size of the stream, if it has one. This should | ||
174 | * throw an unsupported exception. In some cases the block size | ||
175 | * returned will not represent quite the same thing, for example, | ||
176 | * sockets will return their MTU, while files will return the | ||
177 | * filesystem's block size, and memory buffers will throw an exception. | ||
178 | */ | ||
179 | virtual size getBlockSize() const = 0; | ||
164 | 180 | ||
181 | /** | ||
182 | * If possible, this returns a string that can be used to describe how | ||
183 | * to access the open stream. Not all streams support this, such as | ||
184 | * MemBuf, but for files it may give you a path to a file, for a socket | ||
185 | * it may give you an ip address, etc. If it isn't supported, an empty | ||
186 | * string may be returned. | ||
187 | */ | ||
188 | virtual Bu::String getLocation() const = 0; | ||
165 | 189 | ||
166 | private: | 190 | private: |
167 | 191 | ||
diff --git a/src/streamstack.cpp b/src/streamstack.cpp index 011c721..d45306d 100644 --- a/src/streamstack.cpp +++ b/src/streamstack.cpp | |||
@@ -1,3 +1,10 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. | ||
3 | * | ||
4 | * This file is part of the libbu++ library and is released under the | ||
5 | * terms of the license contained in the file LICENSE. | ||
6 | */ | ||
7 | |||
1 | #include "bu/streamstack.h" | 8 | #include "bu/streamstack.h" |
2 | 9 | ||
3 | Bu::StreamStack::StreamStack() | 10 | Bu::StreamStack::StreamStack() |
@@ -72,49 +79,49 @@ void Bu::StreamStack::close() | |||
72 | lFilts.first()->close(); | 79 | lFilts.first()->close(); |
73 | } | 80 | } |
74 | 81 | ||
75 | size_t Bu::StreamStack::read( void *pBuf, size_t nBytes ) | 82 | Bu::size Bu::StreamStack::read( void *pBuf, Bu::size nBytes ) |
76 | { | 83 | { |
77 | checkStack(); | 84 | checkStack(); |
78 | 85 | ||
79 | return lFilts.first()->read( pBuf, nBytes ); | 86 | return lFilts.first()->read( pBuf, nBytes ); |
80 | } | 87 | } |
81 | 88 | ||
82 | size_t Bu::StreamStack::write( const void *pBuf, size_t nBytes ) | 89 | Bu::size Bu::StreamStack::write( const void *pBuf, Bu::size nBytes ) |
83 | { | 90 | { |
84 | checkStack(); | 91 | checkStack(); |
85 | 92 | ||
86 | return lFilts.first()->write( pBuf, nBytes ); | 93 | return lFilts.first()->write( pBuf, nBytes ); |
87 | } | 94 | } |
88 | 95 | ||
89 | size_t Bu::StreamStack::write( const Bu::FString &sBuf ) | 96 | Bu::size Bu::StreamStack::write( const Bu::String &sBuf ) |
90 | { | 97 | { |
91 | checkStack(); | 98 | checkStack(); |
92 | 99 | ||
93 | return lFilts.first()->write( sBuf ); | 100 | return lFilts.first()->write( sBuf ); |
94 | } | 101 | } |
95 | 102 | ||
96 | long Bu::StreamStack::tell() | 103 | Bu::size Bu::StreamStack::tell() |
97 | { | 104 | { |
98 | checkStack(); | 105 | checkStack(); |
99 | 106 | ||
100 | return lFilts.first()->tell(); | 107 | return lFilts.first()->tell(); |
101 | } | 108 | } |
102 | 109 | ||
103 | void Bu::StreamStack::seek( long offset ) | 110 | void Bu::StreamStack::seek( Bu::size offset ) |
104 | { | 111 | { |
105 | checkStack(); | 112 | checkStack(); |
106 | 113 | ||
107 | lFilts.first()->seek( offset ); | 114 | lFilts.first()->seek( offset ); |
108 | } | 115 | } |
109 | 116 | ||
110 | void Bu::StreamStack::setPos( long pos ) | 117 | void Bu::StreamStack::setPos( Bu::size pos ) |
111 | { | 118 | { |
112 | checkStack(); | 119 | checkStack(); |
113 | 120 | ||
114 | lFilts.first()->setPos( pos ); | 121 | lFilts.first()->setPos( pos ); |
115 | } | 122 | } |
116 | 123 | ||
117 | void Bu::StreamStack::setPosEnd( long pos ) | 124 | void Bu::StreamStack::setPosEnd( Bu::size pos ) |
118 | { | 125 | { |
119 | checkStack(); | 126 | checkStack(); |
120 | 127 | ||
@@ -191,14 +198,35 @@ void Bu::StreamStack::setBlocking( bool bBlocking ) | |||
191 | lFilts.first()->setBlocking( bBlocking ); | 198 | lFilts.first()->setBlocking( bBlocking ); |
192 | } | 199 | } |
193 | 200 | ||
194 | void Bu::StreamStack::setSize( long iSize ) | 201 | void Bu::StreamStack::setSize( Bu::size iSize ) |
195 | { | 202 | { |
196 | checkStack(); | 203 | checkStack(); |
197 | 204 | ||
198 | lFilts.first()->setSize( iSize ); | 205 | lFilts.first()->setSize( iSize ); |
199 | } | 206 | } |
200 | 207 | ||
201 | inline void Bu::StreamStack::checkStack() | 208 | Bu::size Bu::StreamStack::getSize() const |
209 | { | ||
210 | checkStack(); | ||
211 | |||
212 | return lFilts.first()->getSize(); | ||
213 | } | ||
214 | |||
215 | Bu::size Bu::StreamStack::getBlockSize() const | ||
216 | { | ||
217 | checkStack(); | ||
218 | |||
219 | return lFilts.first()->getBlockSize(); | ||
220 | } | ||
221 | |||
222 | Bu::String Bu::StreamStack::getLocation() const | ||
223 | { | ||
224 | checkStack(); | ||
225 | |||
226 | return lFilts.first()->getLocation(); | ||
227 | } | ||
228 | |||
229 | inline void Bu::StreamStack::checkStack() const | ||
202 | { | 230 | { |
203 | if( lFilts.isEmpty() ) | 231 | if( lFilts.isEmpty() ) |
204 | throw Bu::ExceptionBase("StreamStack is empty."); | 232 | throw Bu::ExceptionBase("StreamStack is empty."); |
diff --git a/src/streamstack.h b/src/streamstack.h index f40a760..846935b 100644 --- a/src/streamstack.h +++ b/src/streamstack.h | |||
@@ -1,3 +1,10 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. | ||
3 | * | ||
4 | * This file is part of the libbu++ library and is released under the | ||
5 | * terms of the license contained in the file LICENSE. | ||
6 | */ | ||
7 | |||
1 | #ifndef BU_STREAM_STACK_H | 8 | #ifndef BU_STREAM_STACK_H |
2 | #define BU_STREAM_STACK_H | 9 | #define BU_STREAM_STACK_H |
3 | 10 | ||
@@ -103,14 +110,14 @@ namespace Bu | |||
103 | // | 110 | // |
104 | 111 | ||
105 | virtual void close(); | 112 | virtual void close(); |
106 | virtual size_t read( void *pBuf, size_t nBytes ); | 113 | virtual Bu::size read( void *pBuf, Bu::size nBytes ); |
107 | virtual size_t write( const void *pBuf, size_t nBytes ); | 114 | virtual Bu::size write( const void *pBuf, Bu::size nBytes ); |
108 | 115 | ||
109 | virtual size_t write( const Bu::FString &sBuf ); | 116 | virtual Bu::size write( const Bu::String &sBuf ); |
110 | virtual long tell(); | 117 | virtual Bu::size tell(); |
111 | virtual void seek( long offset ); | 118 | virtual void seek( Bu::size offset ); |
112 | virtual void setPos( long pos ); | 119 | virtual void setPos( Bu::size pos ); |
113 | virtual void setPosEnd( long pos ); | 120 | virtual void setPosEnd( Bu::size pos ); |
114 | virtual bool isEos(); | 121 | virtual bool isEos(); |
115 | virtual bool isOpen(); | 122 | virtual bool isOpen(); |
116 | virtual void flush(); | 123 | virtual void flush(); |
@@ -121,10 +128,13 @@ namespace Bu | |||
121 | virtual bool isSeekable(); | 128 | virtual bool isSeekable(); |
122 | virtual bool isBlocking(); | 129 | virtual bool isBlocking(); |
123 | virtual void setBlocking( bool bBlocking=true ); | 130 | virtual void setBlocking( bool bBlocking=true ); |
124 | virtual void setSize( long iSize ); | 131 | virtual void setSize( Bu::size iSize ); |
132 | virtual size getSize() const; | ||
133 | virtual size getBlockSize() const; | ||
134 | virtual Bu::String getLocation() const; | ||
125 | 135 | ||
126 | private: | 136 | private: |
127 | void checkStack(); | 137 | void checkStack() const; |
128 | 138 | ||
129 | private: | 139 | private: |
130 | FilterList lFilts; | 140 | FilterList lFilts; |
diff --git a/src/fstring.cpp b/src/string.cpp index a3e0cb1..538ac52 100644 --- a/src/fstring.cpp +++ b/src/string.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -8,12 +8,12 @@ | |||
8 | #define BU_TRACE | 8 | #define BU_TRACE |
9 | #include "bu/trace.h" | 9 | #include "bu/trace.h" |
10 | 10 | ||
11 | #include "bu/fstring.h" | 11 | #include "bu/string.h" |
12 | #include "bu/hash.h" | 12 | #include "bu/hash.h" |
13 | 13 | ||
14 | template class Bu::FBasicString<char>; | 14 | template class Bu::BasicString<char>; |
15 | 15 | ||
16 | template<> uint32_t Bu::__calcHashCode<Bu::FString>( const Bu::FString &k ) | 16 | template<> uint32_t Bu::__calcHashCode<Bu::String>( const Bu::String &k ) |
17 | { | 17 | { |
18 | long j, sz = k.getSize(); | 18 | long j, sz = k.getSize(); |
19 | const char *s = k.getStr(); | 19 | const char *s = k.getStr(); |
@@ -27,18 +27,18 @@ template<> uint32_t Bu::__calcHashCode<Bu::FString>( const Bu::FString &k ) | |||
27 | return nPos; | 27 | return nPos; |
28 | } | 28 | } |
29 | 29 | ||
30 | template<> bool Bu::__cmpHashKeys<Bu::FString>( | 30 | template<> bool Bu::__cmpHashKeys<Bu::String>( |
31 | const Bu::FString &a, const Bu::FString &b ) | 31 | const Bu::String &a, const Bu::String &b ) |
32 | { | 32 | { |
33 | return a == b; | 33 | return a == b; |
34 | } | 34 | } |
35 | 35 | ||
36 | template<> void Bu::__tracer_format<Bu::FString>( const Bu::FString &v ) | 36 | template<> void Bu::__tracer_format<Bu::String>( const Bu::String &v ) |
37 | { | 37 | { |
38 | printf("(%ld)\"%s\"", v.getSize(), v.getStr() ); | 38 | printf("(%ld)\"%s\"", v.getSize(), v.getStr() ); |
39 | } | 39 | } |
40 | 40 | ||
41 | bool &Bu::operator<<( bool &dst, const Bu::FString &sIn ) | 41 | bool &Bu::operator<<( bool &dst, const Bu::String &sIn ) |
42 | { | 42 | { |
43 | if( sIn == "true" || sIn == "yes" || sIn == "t" ) | 43 | if( sIn == "true" || sIn == "yes" || sIn == "t" ) |
44 | dst = true; | 44 | dst = true; |
@@ -48,79 +48,79 @@ bool &Bu::operator<<( bool &dst, const Bu::FString &sIn ) | |||
48 | return dst; | 48 | return dst; |
49 | } | 49 | } |
50 | 50 | ||
51 | uint8_t &Bu::operator<<( uint8_t &dst, const Bu::FString &sIn ) | 51 | uint8_t &Bu::operator<<( uint8_t &dst, const Bu::String &sIn ) |
52 | { | 52 | { |
53 | sscanf( sIn.getStr(), "%hhu", &dst ); | 53 | sscanf( sIn.getStr(), "%hhu", &dst ); |
54 | return dst; | 54 | return dst; |
55 | } | 55 | } |
56 | 56 | ||
57 | int8_t &Bu::operator<<( int8_t &dst, const Bu::FString &sIn ) | 57 | int8_t &Bu::operator<<( int8_t &dst, const Bu::String &sIn ) |
58 | { | 58 | { |
59 | sscanf( sIn.getStr(), "%hhd", &dst ); | 59 | sscanf( sIn.getStr(), "%hhd", &dst ); |
60 | return dst; | 60 | return dst; |
61 | } | 61 | } |
62 | 62 | ||
63 | char &Bu::operator<<( char &dst, const Bu::FString &sIn ) | 63 | char &Bu::operator<<( char &dst, const Bu::String &sIn ) |
64 | { | 64 | { |
65 | sscanf( sIn.getStr(), "%hhd", &dst ); | 65 | sscanf( sIn.getStr(), "%hhd", &dst ); |
66 | return dst; | 66 | return dst; |
67 | } | 67 | } |
68 | 68 | ||
69 | uint16_t &Bu::operator<<( uint16_t &dst, const Bu::FString &sIn ) | 69 | uint16_t &Bu::operator<<( uint16_t &dst, const Bu::String &sIn ) |
70 | { | 70 | { |
71 | sscanf( sIn.getStr(), "%hu", &dst ); | 71 | sscanf( sIn.getStr(), "%hu", &dst ); |
72 | return dst; | 72 | return dst; |
73 | } | 73 | } |
74 | 74 | ||
75 | int16_t &Bu::operator<<( int16_t &dst, const Bu::FString &sIn ) | 75 | int16_t &Bu::operator<<( int16_t &dst, const Bu::String &sIn ) |
76 | { | 76 | { |
77 | sscanf( sIn.getStr(), "%hd", &dst ); | 77 | sscanf( sIn.getStr(), "%hd", &dst ); |
78 | return dst; | 78 | return dst; |
79 | } | 79 | } |
80 | 80 | ||
81 | uint32_t &Bu::operator<<( uint32_t &dst, const Bu::FString &sIn ) | 81 | uint32_t &Bu::operator<<( uint32_t &dst, const Bu::String &sIn ) |
82 | { | 82 | { |
83 | sscanf( sIn.getStr(), "%u", &dst ); | 83 | sscanf( sIn.getStr(), "%u", &dst ); |
84 | return dst; | 84 | return dst; |
85 | } | 85 | } |
86 | 86 | ||
87 | int32_t &Bu::operator<<( int32_t &dst, const Bu::FString &sIn ) | 87 | int32_t &Bu::operator<<( int32_t &dst, const Bu::String &sIn ) |
88 | { | 88 | { |
89 | sscanf( sIn.getStr(), "%d", &dst ); | 89 | sscanf( sIn.getStr(), "%d", &dst ); |
90 | return dst; | 90 | return dst; |
91 | } | 91 | } |
92 | 92 | ||
93 | uint64_t &Bu::operator<<( uint64_t &dst, const Bu::FString &sIn ) | 93 | uint64_t &Bu::operator<<( uint64_t &dst, const Bu::String &sIn ) |
94 | { | 94 | { |
95 | sscanf( sIn.getStr(), "%llu", &dst ); | 95 | sscanf( sIn.getStr(), "%llu", &dst ); |
96 | return dst; | 96 | return dst; |
97 | } | 97 | } |
98 | 98 | ||
99 | int64_t &Bu::operator<<( int64_t &dst, const Bu::FString &sIn ) | 99 | int64_t &Bu::operator<<( int64_t &dst, const Bu::String &sIn ) |
100 | { | 100 | { |
101 | sscanf( sIn.getStr(), "%lld", &dst ); | 101 | sscanf( sIn.getStr(), "%lld", &dst ); |
102 | return dst; | 102 | return dst; |
103 | } | 103 | } |
104 | 104 | ||
105 | float &Bu::operator<<( float &dst, const Bu::FString &sIn ) | 105 | float &Bu::operator<<( float &dst, const Bu::String &sIn ) |
106 | { | 106 | { |
107 | sscanf( sIn.getStr(), "%f", &dst ); | 107 | sscanf( sIn.getStr(), "%f", &dst ); |
108 | return dst; | 108 | return dst; |
109 | } | 109 | } |
110 | 110 | ||
111 | double &Bu::operator<<( double &dst, const Bu::FString &sIn ) | 111 | double &Bu::operator<<( double &dst, const Bu::String &sIn ) |
112 | { | 112 | { |
113 | sscanf( sIn.getStr(), "%lf", &dst ); | 113 | sscanf( sIn.getStr(), "%lf", &dst ); |
114 | return dst; | 114 | return dst; |
115 | } | 115 | } |
116 | 116 | ||
117 | long double &Bu::operator<<( long double &dst, const Bu::FString &sIn ) | 117 | long double &Bu::operator<<( long double &dst, const Bu::String &sIn ) |
118 | { | 118 | { |
119 | sscanf( sIn.getStr(), "%Lf", &dst ); | 119 | sscanf( sIn.getStr(), "%Lf", &dst ); |
120 | return dst; | 120 | return dst; |
121 | } | 121 | } |
122 | 122 | ||
123 | Bu::FString &Bu::operator<<( Bu::FString &dst, const Bu::FString &sIn ) | 123 | Bu::String &Bu::operator<<( Bu::String &dst, const Bu::String &sIn ) |
124 | { | 124 | { |
125 | dst = sIn; | 125 | dst = sIn; |
126 | return dst; | 126 | return dst; |
diff --git a/src/fbasicstring.h b/src/string.h index 064ff16..22db827 100644 --- a/src/fbasicstring.h +++ b/src/string.h | |||
@@ -1,12 +1,12 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
6 | */ | 6 | */ |
7 | 7 | ||
8 | #ifndef BU_F_BASIC_STRING_H | 8 | #ifndef BU_STRING_H |
9 | #define BU_F_BASIC_STRING_H | 9 | #define BU_STRING_H |
10 | 10 | ||
11 | #include <stdint.h> | 11 | #include <stdint.h> |
12 | #include <memory> | 12 | #include <memory> |
@@ -27,17 +27,15 @@ namespace Bu | |||
27 | { | 27 | { |
28 | /** @cond DEVEL */ | 28 | /** @cond DEVEL */ |
29 | template< typename chr > | 29 | template< typename chr > |
30 | struct FStringChunk | 30 | struct StringChunk |
31 | { | 31 | { |
32 | long nLength; | 32 | long nLength; |
33 | chr *pData; | 33 | chr *pData; |
34 | FStringChunk *pNext; | 34 | StringChunk *pNext; |
35 | }; | 35 | }; |
36 | 36 | ||
37 | #define cpy( dest, src, size ) Bu::memcpy( dest, src, size*sizeof(chr) ) | ||
38 | |||
39 | template< typename chr, int nMinSize, typename chralloc, | 37 | template< typename chr, int nMinSize, typename chralloc, |
40 | typename chunkalloc> class FBasicString; | 38 | typename chunkalloc> class BasicString; |
41 | 39 | ||
42 | template<typename chr> | 40 | template<typename chr> |
43 | size_t strlen( const chr *pData ) | 41 | size_t strlen( const chr *pData ) |
@@ -76,24 +74,24 @@ namespace Bu | |||
76 | } | 74 | } |
77 | 75 | ||
78 | template<typename chr, int nMinSize, typename chralloc, typename chunkalloc> | 76 | template<typename chr, int nMinSize, typename chralloc, typename chunkalloc> |
79 | struct FStringCore | 77 | struct StringCore |
80 | { | 78 | { |
81 | friend class FBasicString<chr, nMinSize, chralloc, chunkalloc>; | 79 | friend class BasicString<chr, nMinSize, chralloc, chunkalloc>; |
82 | friend class SharedCore< | 80 | friend class SharedCore< |
83 | FBasicString<chr, nMinSize, chralloc, chunkalloc>, | 81 | BasicString<chr, nMinSize, chralloc, chunkalloc>, |
84 | FStringCore<chr, nMinSize, chralloc, chunkalloc> | 82 | StringCore<chr, nMinSize, chralloc, chunkalloc> |
85 | >; | 83 | >; |
86 | private: | 84 | private: |
87 | typedef struct FStringCore<chr, nMinSize, chralloc, chunkalloc> MyType; | 85 | typedef struct StringCore<chr, nMinSize, chralloc, chunkalloc> MyType; |
88 | typedef struct FStringChunk<chr> Chunk; | 86 | typedef struct StringChunk<chr> Chunk; |
89 | FStringCore() : | 87 | StringCore() : |
90 | nLength( 0 ), | 88 | nLength( 0 ), |
91 | pFirst( NULL ), | 89 | pFirst( NULL ), |
92 | pLast( NULL ) | 90 | pLast( NULL ) |
93 | { | 91 | { |
94 | } | 92 | } |
95 | 93 | ||
96 | FStringCore( const MyType &rSrc ) : | 94 | StringCore( const MyType &rSrc ) : |
97 | nLength( rSrc.nLength ), | 95 | nLength( rSrc.nLength ), |
98 | pFirst( NULL ), | 96 | pFirst( NULL ), |
99 | pLast( NULL ), | 97 | pLast( NULL ), |
@@ -111,14 +109,14 @@ namespace Bu | |||
111 | int iPos = 0; | 109 | int iPos = 0; |
112 | while( pLink != NULL ) | 110 | while( pLink != NULL ) |
113 | { | 111 | { |
114 | cpy( pFirst->pData+iPos, pLink->pData, pLink->nLength ); | 112 | memcpy( pFirst->pData+iPos, pLink->pData, pLink->nLength ); |
115 | iPos += pLink->nLength; | 113 | iPos += pLink->nLength; |
116 | pLink = pLink->pNext; | 114 | pLink = pLink->pNext; |
117 | } | 115 | } |
118 | } | 116 | } |
119 | } | 117 | } |
120 | 118 | ||
121 | virtual ~FStringCore() | 119 | virtual ~StringCore() |
122 | { | 120 | { |
123 | clear(); | 121 | clear(); |
124 | } | 122 | } |
@@ -172,7 +170,7 @@ namespace Bu | |||
172 | pNew->pNext = pSrc->pNext; | 170 | pNew->pNext = pSrc->pNext; |
173 | pNew->nLength = pSrc->nLength; | 171 | pNew->nLength = pSrc->nLength; |
174 | pNew->pData = aChr.allocate( pSrc->nLength+1 ); | 172 | pNew->pData = aChr.allocate( pSrc->nLength+1 ); |
175 | cpy( pNew->pData, pSrc->pData, pSrc->nLength ); | 173 | memcpy( pNew->pData, pSrc->pData, pSrc->nLength ); |
176 | pNew->pData[pNew->nLength] = (chr)0; | 174 | pNew->pData[pNew->nLength] = (chr)0; |
177 | return pNew; | 175 | return pNew; |
178 | } | 176 | } |
@@ -214,7 +212,7 @@ namespace Bu | |||
214 | * internal ref-counting means that if you pass strings around between | 212 | * internal ref-counting means that if you pass strings around between |
215 | * functions there's almost no overhead in time or memory since a reference | 213 | * functions there's almost no overhead in time or memory since a reference |
216 | * is created and no data is actually copied. This also means that you | 214 | * is created and no data is actually copied. This also means that you |
217 | * never need to put any FBasicString into a ref-counting container class. | 215 | * never need to put any BasicString into a ref-counting container class. |
218 | * | 216 | * |
219 | *@param chr (typename) Type of character (i.e. char) | 217 | *@param chr (typename) Type of character (i.e. char) |
220 | *@param nMinSize (int) Chunk size (default: 256) | 218 | *@param nMinSize (int) Chunk size (default: 256) |
@@ -223,15 +221,15 @@ namespace Bu | |||
223 | */ | 221 | */ |
224 | template< typename chr, int nMinSize=256, | 222 | template< typename chr, int nMinSize=256, |
225 | typename chralloc=std::allocator<chr>, | 223 | typename chralloc=std::allocator<chr>, |
226 | typename chunkalloc=std::allocator<struct FStringChunk<chr> > > | 224 | typename chunkalloc=std::allocator<struct StringChunk<chr> > > |
227 | class FBasicString : public SharedCore< | 225 | class BasicString : public SharedCore< |
228 | FBasicString<chr, nMinSize, chralloc, chunkalloc>, | 226 | BasicString<chr, nMinSize, chralloc, chunkalloc>, |
229 | FStringCore<chr, nMinSize, chralloc, chunkalloc> > | 227 | StringCore<chr, nMinSize, chralloc, chunkalloc> > |
230 | { | 228 | { |
231 | protected: | 229 | protected: |
232 | typedef struct FStringChunk<chr> Chunk; | 230 | typedef struct StringChunk<chr> Chunk; |
233 | typedef struct FBasicString<chr, nMinSize, chralloc, chunkalloc> MyType; | 231 | typedef struct BasicString<chr, nMinSize, chralloc, chunkalloc> MyType; |
234 | typedef struct FStringCore<chr, nMinSize, chralloc, chunkalloc> Core; | 232 | typedef struct StringCore<chr, nMinSize, chralloc, chunkalloc> Core; |
235 | 233 | ||
236 | using SharedCore<MyType, Core >::core; | 234 | using SharedCore<MyType, Core >::core; |
237 | using SharedCore<MyType, Core >::_hardCopy; | 235 | using SharedCore<MyType, Core >::_hardCopy; |
@@ -240,7 +238,7 @@ namespace Bu | |||
240 | struct iterator; | 238 | struct iterator; |
241 | typedef struct const_iterator | 239 | typedef struct const_iterator |
242 | { | 240 | { |
243 | friend class FBasicString<chr, nMinSize, chralloc, chunkalloc>; | 241 | friend class BasicString<chr, nMinSize, chralloc, chunkalloc>; |
244 | friend struct iterator; | 242 | friend struct iterator; |
245 | private: | 243 | private: |
246 | const_iterator( Chunk *pChunk, int iPos ) : | 244 | const_iterator( Chunk *pChunk, int iPos ) : |
@@ -474,7 +472,7 @@ namespace Bu | |||
474 | 472 | ||
475 | typedef struct iterator | 473 | typedef struct iterator |
476 | { | 474 | { |
477 | friend class FBasicString<chr, nMinSize, chralloc, chunkalloc>; | 475 | friend class BasicString<chr, nMinSize, chralloc, chunkalloc>; |
478 | friend struct const_iterator; | 476 | friend struct const_iterator; |
479 | private: | 477 | private: |
480 | iterator( Chunk *pChunk, int iPos ) : | 478 | iterator( Chunk *pChunk, int iPos ) : |
@@ -719,52 +717,52 @@ namespace Bu | |||
719 | } iterator; | 717 | } iterator; |
720 | 718 | ||
721 | public: | 719 | public: |
722 | FBasicString() | 720 | BasicString() |
723 | { | 721 | { |
724 | } | 722 | } |
725 | 723 | ||
726 | FBasicString( const chr *pData ) | 724 | BasicString( const chr *pData ) |
727 | { | 725 | { |
728 | append( pData ); | 726 | append( pData ); |
729 | } | 727 | } |
730 | 728 | ||
731 | FBasicString( const chr *pData, long nLength ) | 729 | BasicString( const chr *pData, long nLength ) |
732 | { | 730 | { |
733 | append( pData, nLength ); | 731 | append( pData, nLength ); |
734 | } | 732 | } |
735 | 733 | ||
736 | FBasicString( const MyType &rSrc ) : | 734 | BasicString( const MyType &rSrc ) : |
737 | SharedCore<MyType, Core>( rSrc ) | 735 | SharedCore<MyType, Core>( rSrc ) |
738 | { | 736 | { |
739 | } | 737 | } |
740 | 738 | ||
741 | FBasicString( const MyType &rSrc, long nLength ) | 739 | BasicString( const MyType &rSrc, long nLength ) |
742 | { | 740 | { |
743 | append( rSrc, nLength ); | 741 | append( rSrc, nLength ); |
744 | } | 742 | } |
745 | 743 | ||
746 | FBasicString( const MyType &rSrc, long nStart, long nLength ) | 744 | BasicString( const MyType &rSrc, long nStart, long nLength ) |
747 | { | 745 | { |
748 | append( rSrc, nStart, nLength ); | 746 | append( rSrc, nStart, nLength ); |
749 | } | 747 | } |
750 | 748 | ||
751 | FBasicString( long nSize ) | 749 | BasicString( long nSize ) |
752 | { | 750 | { |
753 | core->pFirst = core->pLast = core->newChunk( nSize ); | 751 | core->pFirst = core->pLast = core->newChunk( nSize ); |
754 | core->nLength = nSize; | 752 | core->nLength = nSize; |
755 | } | 753 | } |
756 | 754 | ||
757 | FBasicString( const const_iterator &s ) | 755 | BasicString( const const_iterator &s ) |
758 | { | 756 | { |
759 | append( s ); | 757 | append( s ); |
760 | } | 758 | } |
761 | 759 | ||
762 | FBasicString( const const_iterator &s, const const_iterator &e ) | 760 | BasicString( const const_iterator &s, const const_iterator &e ) |
763 | { | 761 | { |
764 | append( s, e ); | 762 | append( s, e ); |
765 | } | 763 | } |
766 | 764 | ||
767 | virtual ~FBasicString() | 765 | virtual ~BasicString() |
768 | { | 766 | { |
769 | } | 767 | } |
770 | 768 | ||
@@ -812,7 +810,7 @@ namespace Bu | |||
812 | int nAmnt = nMinSize - core->pLast->nLength; | 810 | int nAmnt = nMinSize - core->pLast->nLength; |
813 | if( nAmnt > nLen ) | 811 | if( nAmnt > nLen ) |
814 | nAmnt = nLen; | 812 | nAmnt = nLen; |
815 | cpy( | 813 | memcpy( |
816 | core->pLast->pData+core->pLast->nLength, | 814 | core->pLast->pData+core->pLast->nLength, |
817 | pData, | 815 | pData, |
818 | nAmnt | 816 | nAmnt |
@@ -826,7 +824,7 @@ namespace Bu | |||
826 | if( nLen > 0 ) | 824 | if( nLen > 0 ) |
827 | { | 825 | { |
828 | Chunk *pNew = core->newChunk( nLen ); | 826 | Chunk *pNew = core->newChunk( nLen ); |
829 | cpy( pNew->pData, pData, nLen ); | 827 | memcpy( pNew->pData, pData, nLen ); |
830 | core->appendChunk( pNew ); | 828 | core->appendChunk( pNew ); |
831 | // core->nLength += nLen; | 829 | // core->nLength += nLen; |
832 | } | 830 | } |
@@ -852,8 +850,8 @@ namespace Bu | |||
852 | } | 850 | } |
853 | 851 | ||
854 | /** | 852 | /** |
855 | * Append another FString to this one. | 853 | * Append another String to this one. |
856 | *@param sData (MyType &) The FString to append. | 854 | *@param sData (MyType &) The String to append. |
857 | *@todo This function can be made much faster by not using getStr() | 855 | *@todo This function can be made much faster by not using getStr() |
858 | */ | 856 | */ |
859 | void append( const MyType & sData ) | 857 | void append( const MyType & sData ) |
@@ -862,8 +860,8 @@ namespace Bu | |||
862 | } | 860 | } |
863 | 861 | ||
864 | /** | 862 | /** |
865 | * Append another FString to this one. | 863 | * Append another String to this one. |
866 | *@param sData (MyType &) The FString to append. | 864 | *@param sData (MyType &) The String to append. |
867 | *@param nLen How much data to append. | 865 | *@param nLen How much data to append. |
868 | *@todo This function can be made much faster by not using getStr() | 866 | *@todo This function can be made much faster by not using getStr() |
869 | */ | 867 | */ |
@@ -873,8 +871,8 @@ namespace Bu | |||
873 | } | 871 | } |
874 | 872 | ||
875 | /** | 873 | /** |
876 | * Append another FString to this one. | 874 | * Append another String to this one. |
877 | *@param sData (MyType &) The FString to append. | 875 | *@param sData (MyType &) The String to append. |
878 | *@param nStart Start position in sData to start copying from. | 876 | *@param nStart Start position in sData to start copying from. |
879 | *@param nLen How much data to append. | 877 | *@param nLen How much data to append. |
880 | *@todo This function can be made much faster by not using getStr() | 878 | *@todo This function can be made much faster by not using getStr() |
@@ -887,9 +885,9 @@ namespace Bu | |||
887 | } | 885 | } |
888 | 886 | ||
889 | /** | 887 | /** |
890 | * Append data to this FString using the passed in iterator as a base. | 888 | * Append data to this String using the passed in iterator as a base. |
891 | * The iterator is const, it is not changed. | 889 | * The iterator is const, it is not changed. |
892 | *@param s Iterator from any compatible FBasicString to copy data from. | 890 | *@param s Iterator from any compatible BasicString to copy data from. |
893 | */ | 891 | */ |
894 | void append( const const_iterator &s ) | 892 | void append( const const_iterator &s ) |
895 | { | 893 | { |
@@ -898,7 +896,7 @@ namespace Bu | |||
898 | Chunk *pSrc = s.pChunk; | 896 | Chunk *pSrc = s.pChunk; |
899 | 897 | ||
900 | Chunk *pNew = core->newChunk( pSrc->nLength-s.iPos ); | 898 | Chunk *pNew = core->newChunk( pSrc->nLength-s.iPos ); |
901 | cpy( pNew->pData, pSrc->pData+s.iPos, pSrc->nLength-s.iPos ); | 899 | memcpy( pNew->pData, pSrc->pData+s.iPos, pSrc->nLength-s.iPos ); |
902 | 900 | ||
903 | _hardCopy(); | 901 | _hardCopy(); |
904 | core->appendChunk( pNew ); | 902 | core->appendChunk( pNew ); |
@@ -910,9 +908,9 @@ namespace Bu | |||
910 | } | 908 | } |
911 | 909 | ||
912 | /** | 910 | /** |
913 | * Append data to this FString using the passed in iterator as a base. | 911 | * Append data to this String using the passed in iterator as a base. |
914 | * The iterator is const, it is not changed. | 912 | * The iterator is const, it is not changed. |
915 | *@param s Iterator from any compatible FBasicString to copy data from. | 913 | *@param s Iterator from any compatible BasicString to copy data from. |
916 | */ | 914 | */ |
917 | void append( const iterator &s ) // I get complaints without this one | 915 | void append( const iterator &s ) // I get complaints without this one |
918 | { | 916 | { |
@@ -920,11 +918,11 @@ namespace Bu | |||
920 | } | 918 | } |
921 | 919 | ||
922 | /** | 920 | /** |
923 | * Append data to this FString using the passed in iterator as a base, | 921 | * Append data to this String using the passed in iterator as a base, |
924 | * and copy data until the ending iterator is reached. The character | 922 | * and copy data until the ending iterator is reached. The character |
925 | * at the ending iterator is not copied. | 923 | * at the ending iterator is not copied. |
926 | * The iterators are const, they are not changed. | 924 | * The iterators are const, they are not changed. |
927 | *@param s Iterator from any compatible FBasicString to copy data from. | 925 | *@param s Iterator from any compatible BasicString to copy data from. |
928 | *@param e Iterator to stop copying at. | 926 | *@param e Iterator to stop copying at. |
929 | */ | 927 | */ |
930 | void append( const const_iterator &s, const const_iterator &e ) | 928 | void append( const const_iterator &s, const const_iterator &e ) |
@@ -941,7 +939,7 @@ namespace Bu | |||
941 | { | 939 | { |
942 | // Simple case, they're the same chunk | 940 | // Simple case, they're the same chunk |
943 | Chunk *pNew = core->newChunk( e.iPos-s.iPos ); | 941 | Chunk *pNew = core->newChunk( e.iPos-s.iPos ); |
944 | cpy( pNew->pData, s.pChunk->pData+s.iPos, e.iPos-s.iPos ); | 942 | memcpy( pNew->pData, s.pChunk->pData+s.iPos, e.iPos-s.iPos ); |
945 | core->appendChunk( pNew ); | 943 | core->appendChunk( pNew ); |
946 | } | 944 | } |
947 | else | 945 | else |
@@ -949,7 +947,7 @@ namespace Bu | |||
949 | // A little trickier, scan the blocks... | 947 | // A little trickier, scan the blocks... |
950 | Chunk *pSrc = s.pChunk; | 948 | Chunk *pSrc = s.pChunk; |
951 | Chunk *pNew = core->newChunk( pSrc->nLength-s.iPos ); | 949 | Chunk *pNew = core->newChunk( pSrc->nLength-s.iPos ); |
952 | cpy( pNew->pData, pSrc->pData+s.iPos, pSrc->nLength-s.iPos ); | 950 | memcpy( pNew->pData, pSrc->pData+s.iPos, pSrc->nLength-s.iPos ); |
953 | core->appendChunk( pNew ); | 951 | core->appendChunk( pNew ); |
954 | 952 | ||
955 | while( (pSrc = pSrc->pNext) != e.pChunk ) | 953 | while( (pSrc = pSrc->pNext) != e.pChunk ) |
@@ -958,14 +956,14 @@ namespace Bu | |||
958 | } | 956 | } |
959 | 957 | ||
960 | pNew = core->newChunk( e.iPos ); | 958 | pNew = core->newChunk( e.iPos ); |
961 | cpy( pNew->pData, pSrc->pData, e.iPos ); | 959 | memcpy( pNew->pData, pSrc->pData, e.iPos ); |
962 | core->appendChunk( pNew ); | 960 | core->appendChunk( pNew ); |
963 | } | 961 | } |
964 | } | 962 | } |
965 | 963 | ||
966 | /** | 964 | /** |
967 | * Prepend another FString to this one. | 965 | * Prepend another String to this one. |
968 | *@param sData (MyType &) The FString to prepend. | 966 | *@param sData (MyType &) The String to prepend. |
969 | *@todo This function can be made much faster by not using getStr() | 967 | *@todo This function can be made much faster by not using getStr() |
970 | */ | 968 | */ |
971 | void prepend( const MyType & sData ) | 969 | void prepend( const MyType & sData ) |
@@ -987,7 +985,7 @@ namespace Bu | |||
987 | for( nLen = 0; pData[nLen] != (chr)0; nLen++ ) { } | 985 | for( nLen = 0; pData[nLen] != (chr)0; nLen++ ) { } |
988 | 986 | ||
989 | Chunk *pNew = core->newChunk( nLen ); | 987 | Chunk *pNew = core->newChunk( nLen ); |
990 | cpy( pNew->pData, pData, nLen ); | 988 | memcpy( pNew->pData, pData, nLen ); |
991 | 989 | ||
992 | core->prependChunk( pNew ); | 990 | core->prependChunk( pNew ); |
993 | } | 991 | } |
@@ -1001,7 +999,7 @@ namespace Bu | |||
1001 | { | 999 | { |
1002 | Chunk *pNew = core->newChunk( nLen ); | 1000 | Chunk *pNew = core->newChunk( nLen ); |
1003 | 1001 | ||
1004 | cpy( pNew->pData, pData, nLen ); | 1002 | memcpy( pNew->pData, pData, nLen ); |
1005 | 1003 | ||
1006 | _hardCopy(); | 1004 | _hardCopy(); |
1007 | core->prependChunk( pNew ); | 1005 | core->prependChunk( pNew ); |
@@ -1037,9 +1035,9 @@ namespace Bu | |||
1037 | Chunk *p1 = core->newChunk( nPos ); | 1035 | Chunk *p1 = core->newChunk( nPos ); |
1038 | Chunk *p2 = core->newChunk( nLen ); | 1036 | Chunk *p2 = core->newChunk( nLen ); |
1039 | Chunk *p3 = core->newChunk( core->nLength-nPos ); | 1037 | Chunk *p3 = core->newChunk( core->nLength-nPos ); |
1040 | cpy( p1->pData, core->pFirst->pData, nPos ); | 1038 | memcpy( p1->pData, core->pFirst->pData, nPos ); |
1041 | cpy( p2->pData, pData, nLen ); | 1039 | memcpy( p2->pData, pData, nLen ); |
1042 | cpy( p3->pData, core->pFirst->pData+nPos, core->nLength-nPos ); | 1040 | memcpy( p3->pData, core->pFirst->pData+nPos, core->nLength-nPos ); |
1043 | core->clear(); | 1041 | core->clear(); |
1044 | core->appendChunk( p1 ); | 1042 | core->appendChunk( p1 ); |
1045 | core->appendChunk( p2 ); | 1043 | core->appendChunk( p2 ); |
@@ -1063,8 +1061,8 @@ namespace Bu | |||
1063 | _hardCopy(); | 1061 | _hardCopy(); |
1064 | Chunk *p1 = core->newChunk( nPos ); | 1062 | Chunk *p1 = core->newChunk( nPos ); |
1065 | Chunk *p3 = core->newChunk( core->nLength-nPos ); | 1063 | Chunk *p3 = core->newChunk( core->nLength-nPos ); |
1066 | cpy( p1->pData, core->pFirst->pData, nPos ); | 1064 | memcpy( p1->pData, core->pFirst->pData, nPos ); |
1067 | cpy( p3->pData, core->pFirst->pData+nPos, core->nLength-nPos ); | 1065 | memcpy( p3->pData, core->pFirst->pData+nPos, core->nLength-nPos ); |
1068 | core->clear(); | 1066 | core->clear(); |
1069 | core->appendChunk( p1 ); | 1067 | core->appendChunk( p1 ); |
1070 | for( Chunk *pChnk = str.core->pFirst; pChnk; | 1068 | for( Chunk *pChnk = str.core->pFirst; pChnk; |
@@ -1148,7 +1146,7 @@ namespace Bu | |||
1148 | long nNewLen = (nNewSize<core->nLength)?(nNewSize):(core->nLength); | 1146 | long nNewLen = (nNewSize<core->nLength)?(nNewSize):(core->nLength); |
1149 | if( core->nLength > 0 ) | 1147 | if( core->nLength > 0 ) |
1150 | { | 1148 | { |
1151 | cpy( pNew->pData, core->pFirst->pData, nNewLen ); | 1149 | memcpy( pNew->pData, core->pFirst->pData, nNewLen ); |
1152 | core->aChr.deallocate( core->pFirst->pData, core->pFirst->nLength+1 ); | 1150 | core->aChr.deallocate( core->pFirst->pData, core->pFirst->nLength+1 ); |
1153 | core->aChunk.deallocate( core->pFirst, 1 ); | 1151 | core->aChunk.deallocate( core->pFirst, 1 ); |
1154 | } | 1152 | } |
@@ -1282,8 +1280,8 @@ namespace Bu | |||
1282 | } | 1280 | } |
1283 | 1281 | ||
1284 | /** | 1282 | /** |
1285 | * Plus equals operator for FString. | 1283 | * Plus equals operator for String. |
1286 | *@param pData (const chr *) The data to append to your FString. | 1284 | *@param pData (const chr *) The data to append to your String. |
1287 | */ | 1285 | */ |
1288 | MyType &operator+=( const chr *pData ) | 1286 | MyType &operator+=( const chr *pData ) |
1289 | { | 1287 | { |
@@ -1293,8 +1291,8 @@ namespace Bu | |||
1293 | } | 1291 | } |
1294 | 1292 | ||
1295 | /** | 1293 | /** |
1296 | * Plus equals operator for FString. | 1294 | * Plus equals operator for String. |
1297 | *@param rSrc (const MyType &) The FString to append to your FString. | 1295 | *@param rSrc (const MyType &) The String to append to your String. |
1298 | */ | 1296 | */ |
1299 | MyType &operator+=( const MyType &rSrc ) | 1297 | MyType &operator+=( const MyType &rSrc ) |
1300 | { | 1298 | { |
@@ -1311,8 +1309,8 @@ namespace Bu | |||
1311 | } | 1309 | } |
1312 | 1310 | ||
1313 | /** | 1311 | /** |
1314 | * Plus equals operator for FString. | 1312 | * Plus equals operator for String. |
1315 | *@param cData (const chr) The character to append to your FString. | 1313 | *@param cData (const chr) The character to append to your String. |
1316 | */ | 1314 | */ |
1317 | MyType &operator+=( const chr cData ) | 1315 | MyType &operator+=( const chr cData ) |
1318 | { | 1316 | { |
@@ -1335,7 +1333,7 @@ namespace Bu | |||
1335 | /** | 1333 | /** |
1336 | * Assignment operator. | 1334 | * Assignment operator. |
1337 | *@param pData (const chr *) The character array to append to your | 1335 | *@param pData (const chr *) The character array to append to your |
1338 | * FString. | 1336 | * String. |
1339 | */ | 1337 | */ |
1340 | MyType &operator=( const chr *pData ) | 1338 | MyType &operator=( const chr *pData ) |
1341 | { | 1339 | { |
@@ -1366,8 +1364,8 @@ namespace Bu | |||
1366 | } | 1364 | } |
1367 | 1365 | ||
1368 | /** | 1366 | /** |
1369 | * Reset your FString to this character array. | 1367 | * Reset your String to this character array. |
1370 | *@param pData (const chr *) The character array to set your FString to. | 1368 | *@param pData (const chr *) The character array to set your String to. |
1371 | */ | 1369 | */ |
1372 | void set( const chr *pData ) | 1370 | void set( const chr *pData ) |
1373 | { | 1371 | { |
@@ -1376,8 +1374,8 @@ namespace Bu | |||
1376 | } | 1374 | } |
1377 | 1375 | ||
1378 | /** | 1376 | /** |
1379 | * Reset your FString to this character array. | 1377 | * Reset your String to this character array. |
1380 | *@param pData (const chr *) The character array to set your FString to. | 1378 | *@param pData (const chr *) The character array to set your String to. |
1381 | *@param nSize (long) The length of the inputted character array. | 1379 | *@param nSize (long) The length of the inputted character array. |
1382 | */ | 1380 | */ |
1383 | void set( const chr *pData, long nSize ) | 1381 | void set( const chr *pData, long nSize ) |
@@ -1467,7 +1465,7 @@ namespace Bu | |||
1467 | 1465 | ||
1468 | /** | 1466 | /** |
1469 | * Assignment operator. | 1467 | * Assignment operator. |
1470 | *@param rSrc (const MyType &) The FString to set your FString to. | 1468 | *@param rSrc (const MyType &) The String to set your String to. |
1471 | */ | 1469 | */ |
1472 | /* MyType &operator=( const MyType &rSrc ) | 1470 | /* MyType &operator=( const MyType &rSrc ) |
1473 | { | 1471 | { |
@@ -1478,7 +1476,7 @@ namespace Bu | |||
1478 | 1476 | ||
1479 | /** | 1477 | /** |
1480 | * Equals comparison operator. | 1478 | * Equals comparison operator. |
1481 | *@param pData (const chr *) The character array to compare your FString | 1479 | *@param pData (const chr *) The character array to compare your String |
1482 | * to. | 1480 | * to. |
1483 | */ | 1481 | */ |
1484 | bool operator==( const chr *pData ) const | 1482 | bool operator==( const chr *pData ) const |
@@ -1508,7 +1506,7 @@ namespace Bu | |||
1508 | 1506 | ||
1509 | /** | 1507 | /** |
1510 | * Equals comparison operator. | 1508 | * Equals comparison operator. |
1511 | *@param pData (const MyType &) The FString to compare your FString to. | 1509 | *@param pData (const MyType &) The String to compare your String to. |
1512 | */ | 1510 | */ |
1513 | bool operator==( const MyType &pData ) const | 1511 | bool operator==( const MyType &pData ) const |
1514 | { | 1512 | { |
@@ -1538,7 +1536,7 @@ namespace Bu | |||
1538 | 1536 | ||
1539 | /** | 1537 | /** |
1540 | * Not equals comparison operator. | 1538 | * Not equals comparison operator. |
1541 | *@param pData (const chr *) The character array to compare your FString | 1539 | *@param pData (const chr *) The character array to compare your String |
1542 | * to. | 1540 | * to. |
1543 | */ | 1541 | */ |
1544 | bool operator!=(const chr *pData ) const | 1542 | bool operator!=(const chr *pData ) const |
@@ -1548,7 +1546,7 @@ namespace Bu | |||
1548 | 1546 | ||
1549 | /** | 1547 | /** |
1550 | * Not equals comparison operator. | 1548 | * Not equals comparison operator. |
1551 | *@param pData (const MyType &) The FString to compare your FString to. | 1549 | *@param pData (const MyType &) The String to compare your String to. |
1552 | */ | 1550 | */ |
1553 | bool operator!=(const MyType &pData ) const | 1551 | bool operator!=(const MyType &pData ) const |
1554 | { | 1552 | { |
@@ -1939,7 +1937,7 @@ namespace Bu | |||
1939 | long nNewLen = core->nLength - nAmnt; | 1937 | long nNewLen = core->nLength - nAmnt; |
1940 | flatten(); | 1938 | flatten(); |
1941 | Chunk *pNew = core->newChunk( nNewLen ); | 1939 | Chunk *pNew = core->newChunk( nNewLen ); |
1942 | cpy( pNew->pData, core->pFirst->pData+nAmnt, nNewLen ); | 1940 | memcpy( pNew->pData, core->pFirst->pData+nAmnt, nNewLen ); |
1943 | _hardCopy(); | 1941 | _hardCopy(); |
1944 | core->clear(); | 1942 | core->clear(); |
1945 | core->appendChunk( pNew ); | 1943 | core->appendChunk( pNew ); |
@@ -2051,7 +2049,7 @@ namespace Bu | |||
2051 | Chunk *i = core->pFirst; | 2049 | Chunk *i = core->pFirst; |
2052 | for(;;) | 2050 | for(;;) |
2053 | { | 2051 | { |
2054 | cpy( pos, i->pData, i->nLength ); | 2052 | memcpy( pos, i->pData, i->nLength ); |
2055 | pos += i->nLength; | 2053 | pos += i->nLength; |
2056 | i = i->pNext; | 2054 | i = i->pNext; |
2057 | if( i == NULL ) | 2055 | if( i == NULL ) |
@@ -2069,15 +2067,15 @@ namespace Bu | |||
2069 | } | 2067 | } |
2070 | }; | 2068 | }; |
2071 | 2069 | ||
2072 | template<class T> FBasicString<T> operator+( const T *pLeft, const FBasicString<T> &rRight ) | 2070 | template<class T> BasicString<T> operator+( const T *pLeft, const BasicString<T> &rRight ) |
2073 | { | 2071 | { |
2074 | Bu::FBasicString<T> ret( pLeft ); | 2072 | Bu::BasicString<T> ret( pLeft ); |
2075 | ret.append( rRight ); | 2073 | ret.append( rRight ); |
2076 | return ret; | 2074 | return ret; |
2077 | } | 2075 | } |
2078 | 2076 | ||
2079 | template<class chr, int b, class c, class d> | 2077 | template<class chr, int b, class c, class d> |
2080 | ArchiveBase &operator<<( ArchiveBase &ar, const FBasicString<chr, b, c, d> &s ) | 2078 | ArchiveBase &operator<<( ArchiveBase &ar, const BasicString<chr, b, c, d> &s ) |
2081 | { | 2079 | { |
2082 | long n = s.getSize(); | 2080 | long n = s.getSize(); |
2083 | ar << n; | 2081 | ar << n; |
@@ -2086,7 +2084,7 @@ namespace Bu | |||
2086 | } | 2084 | } |
2087 | 2085 | ||
2088 | template<class chr, int b, class c, class d> | 2086 | template<class chr, int b, class c, class d> |
2089 | ArchiveBase &operator>>( ArchiveBase &ar, FBasicString<chr, b, c, d> &s ) | 2087 | ArchiveBase &operator>>( ArchiveBase &ar, BasicString<chr, b, c, d> &s ) |
2090 | { | 2088 | { |
2091 | long n; | 2089 | long n; |
2092 | ar >> n; | 2090 | ar >> n; |
@@ -2094,8 +2092,38 @@ namespace Bu | |||
2094 | ar.read( s.getStr(), n ); | 2092 | ar.read( s.getStr(), n ); |
2095 | return ar; | 2093 | return ar; |
2096 | } | 2094 | } |
2097 | } | ||
2098 | 2095 | ||
2099 | #undef cpy | 2096 | typedef BasicString<char> String; |
2097 | |||
2098 | template<typename T> | ||
2099 | uint32_t __calcHashCode( const T &k ); | ||
2100 | |||
2101 | template<typename T> | ||
2102 | bool __cmpHashKeys( const T &a, const T &b ); | ||
2103 | |||
2104 | template<> uint32_t __calcHashCode<String>( const String &k ); | ||
2105 | template<> bool __cmpHashKeys<String>( | ||
2106 | const String &a, const String &b ); | ||
2107 | |||
2108 | template<typename t> void __tracer_format( const t &v ); | ||
2109 | template<> void __tracer_format<String>( const String &v ); | ||
2110 | |||
2111 | bool &operator<<( bool &dst, const String &sIn ); | ||
2112 | uint8_t &operator<<( uint8_t &dst, const String &sIn ); | ||
2113 | int8_t &operator<<( int8_t &dst, const String &sIn ); | ||
2114 | char &operator<<( char &dst, const String &sIn ); | ||
2115 | uint16_t &operator<<( uint16_t &dst, const String &sIn ); | ||
2116 | int16_t &operator<<( int16_t &dst, const String &sIn ); | ||
2117 | uint32_t &operator<<( uint32_t &dst, const String &sIn ); | ||
2118 | int32_t &operator<<( int32_t &dst, const String &sIn ); | ||
2119 | uint64_t &operator<<( uint64_t &dst, const String &sIn ); | ||
2120 | int64_t &operator<<( int64_t &dst, const String &sIn ); | ||
2121 | float &operator<<( float &dst, const String &sIn ); | ||
2122 | double &operator<<( double &dst, const String &sIn ); | ||
2123 | long double &operator<<( long double &dst, const String &sIn ); | ||
2124 | Bu::String &operator<<( Bu::String &dst, const String &sIn ); | ||
2125 | |||
2126 | typedef Bu::List<String> StringList; | ||
2127 | }; | ||
2100 | 2128 | ||
2101 | #endif | 2129 | #endif |
diff --git a/src/substream.cpp b/src/substream.cpp index 25d301a..c201752 100644 --- a/src/substream.cpp +++ b/src/substream.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -7,7 +7,7 @@ | |||
7 | 7 | ||
8 | #include "bu/substream.h" | 8 | #include "bu/substream.h" |
9 | 9 | ||
10 | Bu::SubStream::SubStream( Bu::Stream &rNext, long iSize ) : | 10 | Bu::SubStream::SubStream( Bu::Stream &rNext, Bu::size iSize ) : |
11 | Bu::Filter( rNext ), | 11 | Bu::Filter( rNext ), |
12 | iStart( 0 ), | 12 | iStart( 0 ), |
13 | iPos( 0 ), | 13 | iPos( 0 ), |
@@ -20,18 +20,18 @@ Bu::SubStream::~SubStream() | |||
20 | { | 20 | { |
21 | } | 21 | } |
22 | 22 | ||
23 | size_t Bu::SubStream::read( void *pBuf, size_t nBytes ) | 23 | Bu::size Bu::SubStream::read( void *pBuf, Bu::size nBytes ) |
24 | { | 24 | { |
25 | if( (long)nBytes > iSize-iPos ) | 25 | if( (Bu::size)nBytes > iSize-iPos ) |
26 | nBytes = iSize-iPos; | 26 | nBytes = iSize-iPos; |
27 | nBytes = rNext.read( pBuf, nBytes ); | 27 | nBytes = rNext.read( pBuf, nBytes ); |
28 | iPos += nBytes; | 28 | iPos += nBytes; |
29 | return nBytes; | 29 | return nBytes; |
30 | } | 30 | } |
31 | 31 | ||
32 | size_t Bu::SubStream::write( const void *pBuf, size_t nBytes ) | 32 | Bu::size Bu::SubStream::write( const void *pBuf, Bu::size nBytes ) |
33 | { | 33 | { |
34 | if( (long)nBytes > iSize-iPos ) | 34 | if( (Bu::size)nBytes > iSize-iPos ) |
35 | nBytes = iSize-iPos; | 35 | nBytes = iSize-iPos; |
36 | nBytes = rNext.write( pBuf, nBytes ); | 36 | nBytes = rNext.write( pBuf, nBytes ); |
37 | iPos += nBytes; | 37 | iPos += nBytes; |
@@ -43,7 +43,7 @@ void Bu::SubStream::start() | |||
43 | // doesn't mean anything... | 43 | // doesn't mean anything... |
44 | } | 44 | } |
45 | 45 | ||
46 | size_t Bu::SubStream::stop() | 46 | Bu::size Bu::SubStream::stop() |
47 | { | 47 | { |
48 | // doesn't mean anything... | 48 | // doesn't mean anything... |
49 | return 0; | 49 | return 0; |
@@ -54,12 +54,12 @@ void Bu::SubStream::close() | |||
54 | // don't do anything? maybe... | 54 | // don't do anything? maybe... |
55 | } | 55 | } |
56 | 56 | ||
57 | long Bu::SubStream::tell() | 57 | Bu::size Bu::SubStream::tell() |
58 | { | 58 | { |
59 | return iPos; | 59 | return iPos; |
60 | } | 60 | } |
61 | 61 | ||
62 | void Bu::SubStream::seek( long offset ) | 62 | void Bu::SubStream::seek( Bu::size offset ) |
63 | { | 63 | { |
64 | if( iPos+offset < 0 ) | 64 | if( iPos+offset < 0 ) |
65 | offset = -iPos; | 65 | offset = -iPos; |
@@ -69,7 +69,7 @@ void Bu::SubStream::seek( long offset ) | |||
69 | iPos += offset; | 69 | iPos += offset; |
70 | } | 70 | } |
71 | 71 | ||
72 | void Bu::SubStream::setPos( long pos ) | 72 | void Bu::SubStream::setPos( Bu::size pos ) |
73 | { | 73 | { |
74 | if( pos < 0 ) | 74 | if( pos < 0 ) |
75 | pos = 0; | 75 | pos = 0; |
@@ -80,7 +80,7 @@ void Bu::SubStream::setPos( long pos ) | |||
80 | rNext.setPos( pos ); | 80 | rNext.setPos( pos ); |
81 | } | 81 | } |
82 | 82 | ||
83 | void Bu::SubStream::setPosEnd( long pos ) | 83 | void Bu::SubStream::setPosEnd( Bu::size pos ) |
84 | { | 84 | { |
85 | if( iSize-pos < 0 ) | 85 | if( iSize-pos < 0 ) |
86 | pos = 0; | 86 | pos = 0; |
diff --git a/src/substream.h b/src/substream.h index b460f13..1db4d6c 100644 --- a/src/substream.h +++ b/src/substream.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -34,29 +34,29 @@ namespace Bu | |||
34 | class SubStream : public Bu::Filter | 34 | class SubStream : public Bu::Filter |
35 | { | 35 | { |
36 | public: | 36 | public: |
37 | SubStream( Bu::Stream &rNext, long iSize ); | 37 | SubStream( Bu::Stream &rNext, Bu::size iSize ); |
38 | virtual ~SubStream(); | 38 | virtual ~SubStream(); |
39 | 39 | ||
40 | virtual size_t read( void *pBuf, size_t nBytes ); | 40 | virtual Bu::size read( void *pBuf, Bu::size nBytes ); |
41 | virtual size_t write( const void *pBuf, size_t nBytes ); | 41 | virtual Bu::size write( const void *pBuf, Bu::size nBytes ); |
42 | using Bu::Stream::write; | 42 | using Bu::Stream::write; |
43 | 43 | ||
44 | virtual void start(); | 44 | virtual void start(); |
45 | virtual size_t stop(); | 45 | virtual Bu::size stop(); |
46 | virtual void close(); | 46 | virtual void close(); |
47 | virtual long tell(); | 47 | virtual Bu::size tell(); |
48 | virtual void seek( long offset ); | 48 | virtual void seek( Bu::size offset ); |
49 | virtual void setPos( long pos ); | 49 | virtual void setPos( Bu::size pos ); |
50 | virtual void setPosEnd( long pos ); | 50 | virtual void setPosEnd( Bu::size pos ); |
51 | virtual bool isEos(); | 51 | virtual bool isEos(); |
52 | 52 | ||
53 | virtual bool canRead(); | 53 | virtual bool canRead(); |
54 | virtual bool canWrite(); | 54 | virtual bool canWrite(); |
55 | 55 | ||
56 | protected: | 56 | protected: |
57 | long iStart; | 57 | Bu::size iStart; |
58 | long iPos; | 58 | Bu::size iPos; |
59 | long iSize; | 59 | Bu::size iSize; |
60 | }; | 60 | }; |
61 | }; | 61 | }; |
62 | 62 | ||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/tafcomment.cpp b/src/tafcomment.cpp index 77b7ee4..c7096ca 100644 --- a/src/tafcomment.cpp +++ b/src/tafcomment.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -14,7 +14,7 @@ Bu::TafComment::TafComment( const Bu::TafComment &rSrc ) : | |||
14 | { | 14 | { |
15 | } | 15 | } |
16 | 16 | ||
17 | Bu::TafComment::TafComment( const Bu::FString &sText, bool bEOL ) : | 17 | Bu::TafComment::TafComment( const Bu::String &sText, bool bEOL ) : |
18 | TafNode( typeComment ), | 18 | TafNode( typeComment ), |
19 | sText( sText ), | 19 | sText( sText ), |
20 | bEOL( bEOL ) | 20 | bEOL( bEOL ) |
@@ -25,7 +25,7 @@ Bu::TafComment::~TafComment() | |||
25 | { | 25 | { |
26 | } | 26 | } |
27 | 27 | ||
28 | const Bu::FString &Bu::TafComment::getText() const | 28 | const Bu::String &Bu::TafComment::getText() const |
29 | { | 29 | { |
30 | return sText; | 30 | return sText; |
31 | } | 31 | } |
diff --git a/src/tafcomment.h b/src/tafcomment.h index 5b51f99..4efd548 100644 --- a/src/tafcomment.h +++ b/src/tafcomment.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -21,14 +21,14 @@ namespace Bu | |||
21 | { | 21 | { |
22 | public: | 22 | public: |
23 | TafComment( const Bu::TafComment &rSrc ); | 23 | TafComment( const Bu::TafComment &rSrc ); |
24 | TafComment( const Bu::FString &sText, bool bEOL=false ); | 24 | TafComment( const Bu::String &sText, bool bEOL=false ); |
25 | virtual ~TafComment(); | 25 | virtual ~TafComment(); |
26 | 26 | ||
27 | const Bu::FString &getText() const; | 27 | const Bu::String &getText() const; |
28 | bool isEOLStyle() const; | 28 | bool isEOLStyle() const; |
29 | 29 | ||
30 | private: | 30 | private: |
31 | Bu::FString sText; | 31 | Bu::String sText; |
32 | bool bEOL; | 32 | bool bEOL; |
33 | }; | 33 | }; |
34 | } | 34 | } |
diff --git a/src/tafgroup.cpp b/src/tafgroup.cpp index c3f5b1e..ee180c3 100644 --- a/src/tafgroup.cpp +++ b/src/tafgroup.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -32,7 +32,7 @@ Bu::TafGroup::TafGroup( const TafGroup &rSrc ) : | |||
32 | } | 32 | } |
33 | } | 33 | } |
34 | 34 | ||
35 | Bu::TafGroup::TafGroup( const Bu::FString &sName ) : | 35 | Bu::TafGroup::TafGroup( const Bu::String &sName ) : |
36 | TafNode( typeGroup ), | 36 | TafNode( typeGroup ), |
37 | sName( sName ) | 37 | sName( sName ) |
38 | { | 38 | { |
@@ -46,12 +46,12 @@ Bu::TafGroup::~TafGroup() | |||
46 | } | 46 | } |
47 | } | 47 | } |
48 | 48 | ||
49 | const Bu::FString &Bu::TafGroup::getName() const | 49 | const Bu::String &Bu::TafGroup::getName() const |
50 | { | 50 | { |
51 | return sName; | 51 | return sName; |
52 | } | 52 | } |
53 | 53 | ||
54 | void Bu::TafGroup::setName( const Bu::FString &sName ) | 54 | void Bu::TafGroup::setName( const Bu::String &sName ) |
55 | { | 55 | { |
56 | this->sName = sName; | 56 | this->sName = sName; |
57 | } | 57 | } |
@@ -102,23 +102,23 @@ Bu::TafComment *Bu::TafGroup::addChild( TafComment *pNode ) | |||
102 | return pNode; | 102 | return pNode; |
103 | } | 103 | } |
104 | 104 | ||
105 | Bu::TafGroup *Bu::TafGroup::addGroup( const Bu::FString &sName ) | 105 | Bu::TafGroup *Bu::TafGroup::addGroup( const Bu::String &sName ) |
106 | { | 106 | { |
107 | return addChild( new TafGroup( sName ) ); | 107 | return addChild( new TafGroup( sName ) ); |
108 | } | 108 | } |
109 | 109 | ||
110 | Bu::TafProperty *Bu::TafGroup::addProperty( | 110 | Bu::TafProperty *Bu::TafGroup::addProperty( |
111 | const Bu::FString &sName, const Bu::FString &sValue ) | 111 | const Bu::String &sName, const Bu::String &sValue ) |
112 | { | 112 | { |
113 | return addChild( new TafProperty( sName, sValue ) ); | 113 | return addChild( new TafProperty( sName, sValue ) ); |
114 | } | 114 | } |
115 | 115 | ||
116 | bool Bu::TafGroup::hasChild( const Bu::FString &sName ) const | 116 | bool Bu::TafGroup::hasChild( const Bu::String &sName ) const |
117 | { | 117 | { |
118 | return hChildren.has( sName ); | 118 | return hChildren.has( sName ); |
119 | } | 119 | } |
120 | 120 | ||
121 | const Bu::TafGroup::GroupList &Bu::TafGroup::getChildren( const Bu::FString &sName ) const | 121 | const Bu::TafGroup::GroupList &Bu::TafGroup::getChildren( const Bu::String &sName ) const |
122 | { | 122 | { |
123 | try { | 123 | try { |
124 | return hChildren.get( sName ); | 124 | return hChildren.get( sName ); |
@@ -134,7 +134,7 @@ const Bu::TafGroup::NodeList &Bu::TafGroup::getChildren() const | |||
134 | return lChildren; | 134 | return lChildren; |
135 | } | 135 | } |
136 | 136 | ||
137 | const Bu::TafGroup *Bu::TafGroup::getChild( const Bu::FString &sName ) const | 137 | const Bu::TafGroup *Bu::TafGroup::getChild( const Bu::String &sName ) const |
138 | { | 138 | { |
139 | try { | 139 | try { |
140 | return hChildren.get( sName ).first(); | 140 | return hChildren.get( sName ).first(); |
@@ -145,12 +145,12 @@ const Bu::TafGroup *Bu::TafGroup::getChild( const Bu::FString &sName ) const | |||
145 | } | 145 | } |
146 | } | 146 | } |
147 | 147 | ||
148 | bool Bu::TafGroup::hasProperty( const Bu::FString &sName ) const | 148 | bool Bu::TafGroup::hasProperty( const Bu::String &sName ) const |
149 | { | 149 | { |
150 | return hProp.has( sName ); | 150 | return hProp.has( sName ); |
151 | } | 151 | } |
152 | 152 | ||
153 | const Bu::TafGroup::PropList &Bu::TafGroup::getProperties( const Bu::FString &sName ) const | 153 | const Bu::TafGroup::PropList &Bu::TafGroup::getProperties( const Bu::String &sName ) const |
154 | { | 154 | { |
155 | try { | 155 | try { |
156 | return hProp.get( sName ); | 156 | return hProp.get( sName ); |
@@ -161,7 +161,7 @@ const Bu::TafGroup::PropList &Bu::TafGroup::getProperties( const Bu::FString &sN | |||
161 | } | 161 | } |
162 | } | 162 | } |
163 | 163 | ||
164 | const Bu::FString &Bu::TafGroup::getProperty( const Bu::FString &sName ) const | 164 | const Bu::String &Bu::TafGroup::getProperty( const Bu::String &sName ) const |
165 | { | 165 | { |
166 | try { | 166 | try { |
167 | return hProp.get( sName ).first(); | 167 | return hProp.get( sName ).first(); |
@@ -172,8 +172,8 @@ const Bu::FString &Bu::TafGroup::getProperty( const Bu::FString &sName ) const | |||
172 | } | 172 | } |
173 | } | 173 | } |
174 | 174 | ||
175 | const Bu::FString &Bu::TafGroup::getProperty( const Bu::FString &sName, | 175 | const Bu::String &Bu::TafGroup::getProperty( const Bu::String &sName, |
176 | const Bu::FString &sDef ) const | 176 | const Bu::String &sDef ) const |
177 | { | 177 | { |
178 | try | 178 | try |
179 | { | 179 | { |
@@ -186,7 +186,7 @@ const Bu::FString &Bu::TafGroup::getProperty( const Bu::FString &sName, | |||
186 | } | 186 | } |
187 | 187 | ||
188 | const Bu::TafGroup *Bu::TafGroup::getChildByPath( | 188 | const Bu::TafGroup *Bu::TafGroup::getChildByPath( |
189 | const Bu::FString &sPath ) const | 189 | const Bu::String &sPath ) const |
190 | { | 190 | { |
191 | return getChildByPath( sPath.split('/') ); | 191 | return getChildByPath( sPath.split('/') ); |
192 | } | 192 | } |
@@ -203,12 +203,12 @@ const Bu::TafGroup *Bu::TafGroup::getChildByPath( Bu::StrList lPath ) const | |||
203 | return cur; | 203 | return cur; |
204 | } | 204 | } |
205 | 205 | ||
206 | const Bu::FString &Bu::TafGroup::getByPath( const Bu::FString &sPath ) const | 206 | const Bu::String &Bu::TafGroup::getByPath( const Bu::String &sPath ) const |
207 | { | 207 | { |
208 | return getByPath( sPath.split('/') ); | 208 | return getByPath( sPath.split('/') ); |
209 | } | 209 | } |
210 | 210 | ||
211 | const Bu::FString &Bu::TafGroup::getByPath( Bu::StrList lPath ) const | 211 | const Bu::String &Bu::TafGroup::getByPath( Bu::StrList lPath ) const |
212 | { | 212 | { |
213 | const Bu::TafGroup *cur = this; | 213 | const Bu::TafGroup *cur = this; |
214 | 214 | ||
diff --git a/src/tafgroup.h b/src/tafgroup.h index ed70e8c..119e827 100644 --- a/src/tafgroup.h +++ b/src/tafgroup.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -10,13 +10,13 @@ | |||
10 | 10 | ||
11 | #include <stdint.h> | 11 | #include <stdint.h> |
12 | #include "bu/tafnode.h" | 12 | #include "bu/tafnode.h" |
13 | #include "bu/fstring.h" | 13 | #include "bu/string.h" |
14 | #include "bu/hash.h" | 14 | #include "bu/hash.h" |
15 | #include "bu/list.h" | 15 | #include "bu/list.h" |
16 | 16 | ||
17 | namespace Bu | 17 | namespace Bu |
18 | { | 18 | { |
19 | typedef Bu::List<Bu::FString> StrList; | 19 | typedef Bu::List<Bu::String> StrList; |
20 | class TafProperty; | 20 | class TafProperty; |
21 | class TafComment; | 21 | class TafComment; |
22 | /** | 22 | /** |
@@ -26,42 +26,42 @@ namespace Bu | |||
26 | class TafGroup : public TafNode | 26 | class TafGroup : public TafNode |
27 | { | 27 | { |
28 | public: | 28 | public: |
29 | typedef Bu::List<Bu::FString> PropList; | 29 | typedef Bu::List<Bu::String> PropList; |
30 | typedef Bu::Hash<Bu::FString, PropList> PropHash; | 30 | typedef Bu::Hash<Bu::String, PropList> PropHash; |
31 | typedef Bu::List<class Bu::TafGroup *> GroupList; | 31 | typedef Bu::List<class Bu::TafGroup *> GroupList; |
32 | typedef Bu::Hash<Bu::FString, GroupList> GroupHash; | 32 | typedef Bu::Hash<Bu::String, GroupList> GroupHash; |
33 | typedef Bu::List<class Bu::TafNode *> NodeList; | 33 | typedef Bu::List<class Bu::TafNode *> NodeList; |
34 | 34 | ||
35 | TafGroup( const TafGroup &rSrc ); | 35 | TafGroup( const TafGroup &rSrc ); |
36 | TafGroup( const Bu::FString &sName ); | 36 | TafGroup( const Bu::String &sName ); |
37 | virtual ~TafGroup(); | 37 | virtual ~TafGroup(); |
38 | 38 | ||
39 | const Bu::FString &getName() const; | 39 | const Bu::String &getName() const; |
40 | void setName( const Bu::FString &sName ); | 40 | void setName( const Bu::String &sName ); |
41 | 41 | ||
42 | bool hasProperty( const Bu::FString &sName ) const; | 42 | bool hasProperty( const Bu::String &sName ) const; |
43 | const Bu::FString &getProperty( const Bu::FString &sName ) const; | 43 | const Bu::String &getProperty( const Bu::String &sName ) const; |
44 | const Bu::FString &getProperty( const Bu::FString &sName, | 44 | const Bu::String &getProperty( const Bu::String &sName, |
45 | const Bu::FString &sDef ) const; | 45 | const Bu::String &sDef ) const; |
46 | const PropList &getProperties( const Bu::FString &sName ) const; | 46 | const PropList &getProperties( const Bu::String &sName ) const; |
47 | bool hasChild( const Bu::FString &sName ) const; | 47 | bool hasChild( const Bu::String &sName ) const; |
48 | const TafGroup *getChild( const Bu::FString &sName ) const; | 48 | const TafGroup *getChild( const Bu::String &sName ) const; |
49 | const GroupList &getChildren( const Bu::FString &sName ) const; | 49 | const GroupList &getChildren( const Bu::String &sName ) const; |
50 | TafNode *addChild( TafNode *pNode ); | 50 | TafNode *addChild( TafNode *pNode ); |
51 | TafGroup *addChild( TafGroup *pNode ); | 51 | TafGroup *addChild( TafGroup *pNode ); |
52 | TafProperty *addChild( TafProperty *pNode ); | 52 | TafProperty *addChild( TafProperty *pNode ); |
53 | TafComment *addChild( TafComment *pNode ); | 53 | TafComment *addChild( TafComment *pNode ); |
54 | TafGroup *addGroup( const Bu::FString &sName ); | 54 | TafGroup *addGroup( const Bu::String &sName ); |
55 | TafProperty *addProperty( | 55 | TafProperty *addProperty( |
56 | const Bu::FString &sName, const Bu::FString &sValue ); | 56 | const Bu::String &sName, const Bu::String &sValue ); |
57 | const NodeList &getChildren() const; | 57 | const NodeList &getChildren() const; |
58 | const TafGroup *getChildByPath( const Bu::FString &sPath ) const; | 58 | const TafGroup *getChildByPath( const Bu::String &sPath ) const; |
59 | const TafGroup *getChildByPath( StrList lPath ) const; | 59 | const TafGroup *getChildByPath( StrList lPath ) const; |
60 | const Bu::FString &getByPath( const Bu::FString &sPath ) const; | 60 | const Bu::String &getByPath( const Bu::String &sPath ) const; |
61 | const Bu::FString &getByPath( StrList lPath ) const; | 61 | const Bu::String &getByPath( StrList lPath ) const; |
62 | 62 | ||
63 | private: | 63 | private: |
64 | Bu::FString sName; | 64 | Bu::String sName; |
65 | PropHash hProp; | 65 | PropHash hProp; |
66 | GroupHash hChildren; | 66 | GroupHash hChildren; |
67 | NodeList lChildren; | 67 | NodeList lChildren; |
diff --git a/src/tafnode.cpp b/src/tafnode.cpp index da85d20..0757a46 100644 --- a/src/tafnode.cpp +++ b/src/tafnode.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/tafnode.h b/src/tafnode.h index a535f65..d7a9159 100644 --- a/src/tafnode.h +++ b/src/tafnode.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -9,7 +9,7 @@ | |||
9 | #define BU_TAF_NODE_H | 9 | #define BU_TAF_NODE_H |
10 | 10 | ||
11 | #include <stdint.h> | 11 | #include <stdint.h> |
12 | #include "bu/fstring.h" | 12 | #include "bu/string.h" |
13 | #include "bu/hash.h" | 13 | #include "bu/hash.h" |
14 | #include "bu/exceptionbase.h" | 14 | #include "bu/exceptionbase.h" |
15 | 15 | ||
diff --git a/src/tafproperty.cpp b/src/tafproperty.cpp index c847344..4ef5c24 100644 --- a/src/tafproperty.cpp +++ b/src/tafproperty.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -14,7 +14,7 @@ Bu::TafProperty::TafProperty( const Bu::TafProperty &rSrc ) : | |||
14 | { | 14 | { |
15 | } | 15 | } |
16 | 16 | ||
17 | Bu::TafProperty::TafProperty( const Bu::FString &sName, const Bu::FString &sValue ) : | 17 | Bu::TafProperty::TafProperty( const Bu::String &sName, const Bu::String &sValue ) : |
18 | TafNode( typeProperty ), | 18 | TafNode( typeProperty ), |
19 | sName( sName ), | 19 | sName( sName ), |
20 | sValue( sValue ) | 20 | sValue( sValue ) |
@@ -25,12 +25,12 @@ Bu::TafProperty::~TafProperty() | |||
25 | { | 25 | { |
26 | } | 26 | } |
27 | 27 | ||
28 | const Bu::FString &Bu::TafProperty::getName() const | 28 | const Bu::String &Bu::TafProperty::getName() const |
29 | { | 29 | { |
30 | return sName; | 30 | return sName; |
31 | } | 31 | } |
32 | 32 | ||
33 | const Bu::FString &Bu::TafProperty::getValue() const | 33 | const Bu::String &Bu::TafProperty::getValue() const |
34 | { | 34 | { |
35 | return sValue; | 35 | return sValue; |
36 | } | 36 | } |
diff --git a/src/tafproperty.h b/src/tafproperty.h index 62cc517..7091de5 100644 --- a/src/tafproperty.h +++ b/src/tafproperty.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -21,15 +21,15 @@ namespace Bu | |||
21 | { | 21 | { |
22 | public: | 22 | public: |
23 | TafProperty( const Bu::TafProperty &rSrc ); | 23 | TafProperty( const Bu::TafProperty &rSrc ); |
24 | TafProperty( const Bu::FString &sName, const Bu::FString &sValue ); | 24 | TafProperty( const Bu::String &sName, const Bu::String &sValue ); |
25 | virtual ~TafProperty(); | 25 | virtual ~TafProperty(); |
26 | 26 | ||
27 | const Bu::FString &getName() const; | 27 | const Bu::String &getName() const; |
28 | const Bu::FString &getValue() const; | 28 | const Bu::String &getValue() const; |
29 | 29 | ||
30 | private: | 30 | private: |
31 | Bu::FString sName; | 31 | Bu::String sName; |
32 | Bu::FString sValue; | 32 | Bu::String sValue; |
33 | }; | 33 | }; |
34 | } | 34 | } |
35 | 35 | ||
diff --git a/src/tafreader.cpp b/src/tafreader.cpp index ca06daf..6708c8c 100644 --- a/src/tafreader.cpp +++ b/src/tafreader.cpp | |||
@@ -1,12 +1,12 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
6 | */ | 6 | */ |
7 | 7 | ||
8 | #include "bu/taf.h" | 8 | #include "bu/taf.h" |
9 | #include "bu/fstring.h" | 9 | #include "bu/string.h" |
10 | #include "bu/stream.h" | 10 | #include "bu/stream.h" |
11 | 11 | ||
12 | #include <stdlib.h> | 12 | #include <stdlib.h> |
@@ -34,7 +34,7 @@ Bu::TafGroup *Bu::TafReader::readGroup() | |||
34 | throw TafException("%d:%d: Expected '{' got '%c'.", iLine, iCol, c ); | 34 | throw TafException("%d:%d: Expected '{' got '%c'.", iLine, iCol, c ); |
35 | next(); | 35 | next(); |
36 | ws(); | 36 | ws(); |
37 | FString sName = readStr(); | 37 | String sName = readStr(); |
38 | TafGroup *pGroup = new TafGroup( sName ); | 38 | TafGroup *pGroup = new TafGroup( sName ); |
39 | try | 39 | try |
40 | { | 40 | { |
@@ -88,7 +88,7 @@ void Bu::TafReader::groupContent( Bu::TafGroup *pGroup ) | |||
88 | 88 | ||
89 | Bu::TafProperty *Bu::TafReader::readProperty() | 89 | Bu::TafProperty *Bu::TafReader::readProperty() |
90 | { | 90 | { |
91 | FString sName = readStr(); | 91 | String sName = readStr(); |
92 | ws(); | 92 | ws(); |
93 | if( c != '=' ) | 93 | if( c != '=' ) |
94 | { | 94 | { |
@@ -96,14 +96,14 @@ Bu::TafProperty *Bu::TafReader::readProperty() | |||
96 | return new Bu::TafProperty( "", sName ); | 96 | return new Bu::TafProperty( "", sName ); |
97 | } | 97 | } |
98 | next(); | 98 | next(); |
99 | FString sValue = readStr(); | 99 | String sValue = readStr(); |
100 | return new Bu::TafProperty( sName, sValue ); | 100 | return new Bu::TafProperty( sName, sValue ); |
101 | //printf(" %s = %s\n", sName.getStr(), sValue.getStr() ); | 101 | //printf(" %s = %s\n", sName.getStr(), sValue.getStr() ); |
102 | } | 102 | } |
103 | 103 | ||
104 | Bu::TafComment *Bu::TafReader::readComment( bool bEOL ) | 104 | Bu::TafComment *Bu::TafReader::readComment( bool bEOL ) |
105 | { | 105 | { |
106 | FString sCmnt; | 106 | String sCmnt; |
107 | next(); | 107 | next(); |
108 | if( bEOL ) | 108 | if( bEOL ) |
109 | { | 109 | { |
@@ -140,10 +140,10 @@ Bu::TafComment *Bu::TafReader::readComment( bool bEOL ) | |||
140 | return new TafComment( sCmnt, bEOL ); | 140 | return new TafComment( sCmnt, bEOL ); |
141 | } | 141 | } |
142 | 142 | ||
143 | Bu::FString Bu::TafReader::readStr() | 143 | Bu::String Bu::TafReader::readStr() |
144 | { | 144 | { |
145 | ws(); | 145 | ws(); |
146 | FString s; | 146 | String s; |
147 | if( c == '"' ) | 147 | if( c == '"' ) |
148 | { | 148 | { |
149 | next(); | 149 | next(); |
diff --git a/src/tafreader.h b/src/tafreader.h index d60f4d2..10ebfc0 100644 --- a/src/tafreader.h +++ b/src/tafreader.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -9,7 +9,7 @@ | |||
9 | #define BU_TAF_READER_H | 9 | #define BU_TAF_READER_H |
10 | 10 | ||
11 | #include <stdint.h> | 11 | #include <stdint.h> |
12 | #include "bu/fstring.h" | 12 | #include "bu/string.h" |
13 | 13 | ||
14 | namespace Bu | 14 | namespace Bu |
15 | { | 15 | { |
@@ -38,7 +38,7 @@ namespace Bu | |||
38 | void ws(); | 38 | void ws(); |
39 | bool isws(); | 39 | bool isws(); |
40 | void next(); | 40 | void next(); |
41 | Bu::FString readStr(); | 41 | Bu::String readStr(); |
42 | void rawread( char *c ); | 42 | void rawread( char *c ); |
43 | char c, la; | 43 | char c, la; |
44 | Bu::Stream &sIn; | 44 | Bu::Stream &sIn; |
diff --git a/src/tafwriter.cpp b/src/tafwriter.cpp index 215cb68..b24bd1e 100644 --- a/src/tafwriter.cpp +++ b/src/tafwriter.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -88,10 +88,10 @@ void Bu::TafWriter::writeComment( const Bu::TafComment *pComment ) | |||
88 | } | 88 | } |
89 | } | 89 | } |
90 | 90 | ||
91 | void Bu::TafWriter::writeString( const Bu::FString &str ) | 91 | void Bu::TafWriter::writeString( const Bu::String &str ) |
92 | { | 92 | { |
93 | sOut.write("\"", 1 ); | 93 | sOut.write("\"", 1 ); |
94 | for( Bu::FString::const_iterator s = str.begin(); s != str.end(); s++ ) | 94 | for( Bu::String::const_iterator s = str.begin(); s != str.end(); s++ ) |
95 | { | 95 | { |
96 | if( *s == '\"' ) | 96 | if( *s == '\"' ) |
97 | sOut.write("\\\"", 2 ); | 97 | sOut.write("\\\"", 2 ); |
diff --git a/src/tafwriter.h b/src/tafwriter.h index 5b7bd74..3fd71de 100644 --- a/src/tafwriter.h +++ b/src/tafwriter.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -10,7 +10,7 @@ | |||
10 | 10 | ||
11 | #include <stdint.h> | 11 | #include <stdint.h> |
12 | 12 | ||
13 | #include "bu/fstring.h" | 13 | #include "bu/string.h" |
14 | 14 | ||
15 | namespace Bu | 15 | namespace Bu |
16 | { | 16 | { |
@@ -35,7 +35,7 @@ namespace Bu | |||
35 | private: | 35 | private: |
36 | void writeProperty( const Bu::TafProperty *pProp ); | 36 | void writeProperty( const Bu::TafProperty *pProp ); |
37 | void writeComment( const Bu::TafComment *pComment ); | 37 | void writeComment( const Bu::TafComment *pComment ); |
38 | void writeString( const Bu::FString &str ); | 38 | void writeString( const Bu::String &str ); |
39 | void ident(); | 39 | void ident(); |
40 | Bu::Stream &sOut; | 40 | Bu::Stream &sOut; |
41 | int iDepth; | 41 | int iDepth; |
diff --git a/src/tcpserversocket.cpp b/src/tcpserversocket.cpp index 7d7f6e4..a2fe6b4 100644 --- a/src/tcpserversocket.cpp +++ b/src/tcpserversocket.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -48,7 +48,7 @@ Bu::TcpServerSocket::TcpServerSocket( int nPort, int nPoolSize ) : | |||
48 | startServer( name, nPoolSize ); | 48 | startServer( name, nPoolSize ); |
49 | } | 49 | } |
50 | 50 | ||
51 | Bu::TcpServerSocket::TcpServerSocket(const FString &sAddr,int nPort, int nPoolSize) : | 51 | Bu::TcpServerSocket::TcpServerSocket(const String &sAddr,int nPort, int nPoolSize) : |
52 | nPort( nPort ) | 52 | nPort( nPort ) |
53 | { | 53 | { |
54 | #ifdef WIN32 | 54 | #ifdef WIN32 |
diff --git a/src/tcpserversocket.h b/src/tcpserversocket.h index b1d7e02..efb7287 100644 --- a/src/tcpserversocket.h +++ b/src/tcpserversocket.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -9,7 +9,7 @@ | |||
9 | #define BU_TCP_SERVER_SOCKET_H | 9 | #define BU_TCP_SERVER_SOCKET_H |
10 | 10 | ||
11 | #include <stdint.h> | 11 | #include <stdint.h> |
12 | #include "bu/fstring.h" | 12 | #include "bu/string.h" |
13 | #include "bu/exceptionbase.h" | 13 | #include "bu/exceptionbase.h" |
14 | 14 | ||
15 | #ifdef WIN32 | 15 | #ifdef WIN32 |
@@ -38,7 +38,7 @@ namespace Bu | |||
38 | { | 38 | { |
39 | public: | 39 | public: |
40 | TcpServerSocket( int nPort, int nPoolSize=40 ); | 40 | TcpServerSocket( int nPort, int nPoolSize=40 ); |
41 | TcpServerSocket( const FString &sAddr, int nPort, int nPoolSize=40 ); | 41 | TcpServerSocket( const String &sAddr, int nPort, int nPoolSize=40 ); |
42 | TcpServerSocket( int nSocket, bool bInit, int nPoolSize=40 ); | 42 | TcpServerSocket( int nSocket, bool bInit, int nPoolSize=40 ); |
43 | TcpServerSocket( const TcpServerSocket &rSrc ); | 43 | TcpServerSocket( const TcpServerSocket &rSrc ); |
44 | virtual ~TcpServerSocket(); | 44 | virtual ~TcpServerSocket(); |
diff --git a/src/tcpsocket.cpp b/src/tcpsocket.cpp index bbd9cf5..52dfc5c 100644 --- a/src/tcpsocket.cpp +++ b/src/tcpsocket.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -42,7 +42,7 @@ Bu::TcpSocket::TcpSocket( int nTcpSocket ) : | |||
42 | setAddress(); | 42 | setAddress(); |
43 | } | 43 | } |
44 | 44 | ||
45 | Bu::TcpSocket::TcpSocket( const Bu::FString &sAddr, int nPort, int nTimeout, | 45 | Bu::TcpSocket::TcpSocket( const Bu::String &sAddr, int nPort, int nTimeout, |
46 | bool bBlocking ) : | 46 | bool bBlocking ) : |
47 | nTcpSocket( 0 ), | 47 | nTcpSocket( 0 ), |
48 | bActive( false ), | 48 | bActive( false ), |
@@ -149,7 +149,7 @@ void Bu::TcpSocket::close() | |||
149 | bActive = false; | 149 | bActive = false; |
150 | } | 150 | } |
151 | 151 | ||
152 | size_t Bu::TcpSocket::read( void *pBuf, size_t nBytes ) | 152 | Bu::size Bu::TcpSocket::read( void *pBuf, Bu::size nBytes ) |
153 | { | 153 | { |
154 | fd_set rfds; | 154 | fd_set rfds; |
155 | FD_ZERO(&rfds); | 155 | FD_ZERO(&rfds); |
@@ -195,11 +195,11 @@ size_t Bu::TcpSocket::read( void *pBuf, size_t nBytes ) | |||
195 | return 0; | 195 | return 0; |
196 | } | 196 | } |
197 | 197 | ||
198 | size_t Bu::TcpSocket::read( void *pBuf, size_t nBytes, | 198 | Bu::size Bu::TcpSocket::read( void *pBuf, Bu::size nBytes, |
199 | uint32_t nSec, uint32_t nUSec ) | 199 | uint32_t nSec, uint32_t nUSec ) |
200 | { | 200 | { |
201 | struct timeval tv; | 201 | struct timeval tv; |
202 | size_t nRead = 0; | 202 | Bu::size nRead = 0; |
203 | 203 | ||
204 | fd_set rfds; | 204 | fd_set rfds; |
205 | FD_ZERO(&rfds); | 205 | FD_ZERO(&rfds); |
@@ -239,7 +239,7 @@ size_t Bu::TcpSocket::read( void *pBuf, size_t nBytes, | |||
239 | return nRead; | 239 | return nRead; |
240 | } | 240 | } |
241 | 241 | ||
242 | size_t Bu::TcpSocket::write( const void *pBuf, size_t nBytes ) | 242 | Bu::size Bu::TcpSocket::write( const void *pBuf, Bu::size nBytes ) |
243 | { | 243 | { |
244 | //#ifdef WIN32 | 244 | //#ifdef WIN32 |
245 | int nWrote = TEMP_FAILURE_RETRY( | 245 | int nWrote = TEMP_FAILURE_RETRY( |
@@ -261,10 +261,10 @@ size_t Bu::TcpSocket::write( const void *pBuf, size_t nBytes ) | |||
261 | return nWrote; | 261 | return nWrote; |
262 | } | 262 | } |
263 | 263 | ||
264 | size_t Bu::TcpSocket::write( const void *pBuf, size_t nBytes, uint32_t nSec, uint32_t nUSec ) | 264 | Bu::size Bu::TcpSocket::write( const void *pBuf, Bu::size nBytes, uint32_t nSec, uint32_t nUSec ) |
265 | { | 265 | { |
266 | struct timeval tv; | 266 | struct timeval tv; |
267 | size_t nWrote = 0; | 267 | Bu::size nWrote = 0; |
268 | 268 | ||
269 | fd_set wfds; | 269 | fd_set wfds; |
270 | FD_ZERO(&wfds); | 270 | FD_ZERO(&wfds); |
@@ -304,22 +304,22 @@ size_t Bu::TcpSocket::write( const void *pBuf, size_t nBytes, uint32_t nSec, uin | |||
304 | return nWrote; | 304 | return nWrote; |
305 | } | 305 | } |
306 | 306 | ||
307 | long Bu::TcpSocket::tell() | 307 | Bu::size Bu::TcpSocket::tell() |
308 | { | 308 | { |
309 | throw UnsupportedException(); | 309 | throw UnsupportedException(); |
310 | } | 310 | } |
311 | 311 | ||
312 | void Bu::TcpSocket::seek( long ) | 312 | void Bu::TcpSocket::seek( Bu::size ) |
313 | { | 313 | { |
314 | throw UnsupportedException(); | 314 | throw UnsupportedException(); |
315 | } | 315 | } |
316 | 316 | ||
317 | void Bu::TcpSocket::setPos( long ) | 317 | void Bu::TcpSocket::setPos( Bu::size ) |
318 | { | 318 | { |
319 | throw UnsupportedException(); | 319 | throw UnsupportedException(); |
320 | } | 320 | } |
321 | 321 | ||
322 | void Bu::TcpSocket::setPosEnd( long ) | 322 | void Bu::TcpSocket::setPosEnd( Bu::size ) |
323 | { | 323 | { |
324 | throw UnsupportedException(); | 324 | throw UnsupportedException(); |
325 | } | 325 | } |
@@ -401,7 +401,7 @@ void Bu::TcpSocket::setBlocking( bool bBlocking ) | |||
401 | fcntl( nTcpSocket, F_SETFL, fcntl( nTcpSocket, F_GETFL, 0 ) | O_NONBLOCK ); | 401 | fcntl( nTcpSocket, F_SETFL, fcntl( nTcpSocket, F_GETFL, 0 ) | O_NONBLOCK ); |
402 | } | 402 | } |
403 | #else | 403 | #else |
404 | u_long iMode; | 404 | u_Bu::size iMode; |
405 | if( bBlocking ) | 405 | if( bBlocking ) |
406 | iMode = 0; | 406 | iMode = 0; |
407 | else | 407 | else |
@@ -416,7 +416,7 @@ void Bu::TcpSocket::setBlocking( bool bBlocking ) | |||
416 | #endif | 416 | #endif |
417 | } | 417 | } |
418 | 418 | ||
419 | void Bu::TcpSocket::setSize( long ) | 419 | void Bu::TcpSocket::setSize( Bu::size ) |
420 | { | 420 | { |
421 | } | 421 | } |
422 | 422 | ||
@@ -438,7 +438,7 @@ void Bu::TcpSocket::setAddress() | |||
438 | sAddress = bu_inet_ntoa( addr.sin_addr ); | 438 | sAddress = bu_inet_ntoa( addr.sin_addr ); |
439 | } | 439 | } |
440 | 440 | ||
441 | Bu::FString Bu::TcpSocket::getAddress() const | 441 | Bu::String Bu::TcpSocket::getAddress() const |
442 | { | 442 | { |
443 | return sAddress; | 443 | return sAddress; |
444 | } | 444 | } |
@@ -448,3 +448,18 @@ Bu::TcpSocket::operator int() const | |||
448 | return nTcpSocket; | 448 | return nTcpSocket; |
449 | } | 449 | } |
450 | 450 | ||
451 | Bu::size Bu::TcpSocket::getSize() const | ||
452 | { | ||
453 | throw UnsupportedException(); | ||
454 | } | ||
455 | |||
456 | Bu::size Bu::TcpSocket::getBlockSize() const | ||
457 | { | ||
458 | return 1500; //TODO: Fix this, it's stupid. | ||
459 | } | ||
460 | |||
461 | Bu::String Bu::TcpSocket::getLocation() const | ||
462 | { | ||
463 | return getAddress(); | ||
464 | } | ||
465 | |||
diff --git a/src/tcpsocket.h b/src/tcpsocket.h index ce15172..dbaaa5e 100644 --- a/src/tcpsocket.h +++ b/src/tcpsocket.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -10,8 +10,9 @@ | |||
10 | 10 | ||
11 | #include <stdint.h> | 11 | #include <stdint.h> |
12 | 12 | ||
13 | #include "bu/config.h" | ||
13 | #include "bu/stream.h" | 14 | #include "bu/stream.h" |
14 | #include "bu/fstring.h" | 15 | #include "bu/string.h" |
15 | #include "bu/exceptionbase.h" | 16 | #include "bu/exceptionbase.h" |
16 | 17 | ||
17 | namespace Bu | 18 | namespace Bu |
@@ -60,23 +61,23 @@ namespace Bu | |||
60 | { | 61 | { |
61 | public: | 62 | public: |
62 | TcpSocket( int nTcpSocket ); | 63 | TcpSocket( int nTcpSocket ); |
63 | TcpSocket( const FString &sAddr, int nPort, int nTimeout=30, | 64 | TcpSocket( const String &sAddr, int nPort, int nTimeout=30, |
64 | bool bBlocking=true ); | 65 | bool bBlocking=true ); |
65 | virtual ~TcpSocket(); | 66 | virtual ~TcpSocket(); |
66 | 67 | ||
67 | virtual void close(); | 68 | virtual void close(); |
68 | virtual size_t read( void *pBuf, size_t nBytes ); | 69 | virtual size read( void *pBuf, size nBytes ); |
69 | virtual size_t read( void *pBuf, size_t nBytes, | 70 | virtual size read( void *pBuf, size nBytes, |
70 | uint32_t nSec, uint32_t nUSec=0 ); | 71 | uint32_t nSec, uint32_t nUSec=0 ); |
71 | virtual size_t write( const void *pBuf, size_t nBytes ); | 72 | virtual size write( const void *pBuf, size nBytes ); |
72 | virtual size_t write( const void *pBuf, size_t nBytes, | 73 | virtual size write( const void *pBuf, size nBytes, |
73 | uint32_t nSec, uint32_t nUSec=0 ); | 74 | uint32_t nSec, uint32_t nUSec=0 ); |
74 | using Stream::write; | 75 | using Stream::write; |
75 | 76 | ||
76 | virtual long tell(); | 77 | virtual size tell(); |
77 | virtual void seek( long offset ); | 78 | virtual void seek( size offset ); |
78 | virtual void setPos( long pos ); | 79 | virtual void setPos( size pos ); |
79 | virtual void setPosEnd( long pos ); | 80 | virtual void setPosEnd( size pos ); |
80 | virtual bool isEos(); | 81 | virtual bool isEos(); |
81 | virtual bool isOpen(); | 82 | virtual bool isOpen(); |
82 | 83 | ||
@@ -92,11 +93,15 @@ namespace Bu | |||
92 | virtual bool isBlocking(); | 93 | virtual bool isBlocking(); |
93 | virtual void setBlocking( bool bBlocking=true ); | 94 | virtual void setBlocking( bool bBlocking=true ); |
94 | 95 | ||
95 | virtual void setSize( long iSize ); | 96 | virtual void setSize( size iSize ); |
96 | 97 | ||
97 | Bu::FString getAddress() const; | 98 | Bu::String getAddress() const; |
98 | operator int() const; | 99 | operator int() const; |
99 | 100 | ||
101 | virtual size getSize() const; | ||
102 | virtual size getBlockSize() const; | ||
103 | virtual Bu::String getLocation() const; | ||
104 | |||
100 | private: | 105 | private: |
101 | void setAddress(); | 106 | void setAddress(); |
102 | 107 | ||
@@ -107,8 +112,8 @@ namespace Bu | |||
107 | #endif | 112 | #endif |
108 | bool bActive; | 113 | bool bActive; |
109 | bool bBlocking; | 114 | bool bBlocking; |
110 | FString sReadBuf; | 115 | String sReadBuf; |
111 | FString sAddress; | 116 | String sAddress; |
112 | }; | 117 | }; |
113 | } | 118 | } |
114 | 119 | ||
diff --git a/src/tests/archive.cpp b/src/tests/archive.cpp index 08e3b17..c905007 100644 --- a/src/tests/archive.cpp +++ b/src/tests/archive.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -7,7 +7,7 @@ | |||
7 | 7 | ||
8 | #include "bu/archive.h" | 8 | #include "bu/archive.h" |
9 | #include "bu/file.h" | 9 | #include "bu/file.h" |
10 | #include "bu/fstring.h" | 10 | #include "bu/string.h" |
11 | 11 | ||
12 | using namespace Bu; | 12 | using namespace Bu; |
13 | 13 | ||
@@ -16,7 +16,7 @@ int main() | |||
16 | File f("test.dat", File::WriteNew ); | 16 | File f("test.dat", File::WriteNew ); |
17 | Archive ar( f, Archive::save ); | 17 | Archive ar( f, Archive::save ); |
18 | 18 | ||
19 | Bu::FString s("Hello there"); | 19 | Bu::String s("Hello there"); |
20 | ar << s; | 20 | ar << s; |
21 | 21 | ||
22 | ar.setProp("hi", 45 ); | 22 | ar.setProp("hi", 45 ); |
diff --git a/src/tests/archive2.cpp b/src/tests/archive2.cpp index 75db442..e8d3360 100644 --- a/src/tests/archive2.cpp +++ b/src/tests/archive2.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/tests/atom.cpp b/src/tests/atom.cpp index 7784a9e..7808282 100644 --- a/src/tests/atom.cpp +++ b/src/tests/atom.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/tests/base64.cpp b/src/tests/base64.cpp index 483199c..413ff92 100644 --- a/src/tests/base64.cpp +++ b/src/tests/base64.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/tests/buffer.cpp b/src/tests/buffer.cpp index a12223a..f3f6f41 100644 --- a/src/tests/buffer.cpp +++ b/src/tests/buffer.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/tests/bzip2.cpp b/src/tests/bzip2.cpp index f869939..603e937 100644 --- a/src/tests/bzip2.cpp +++ b/src/tests/bzip2.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/tests/cache.cpp b/src/tests/cache.cpp index 7fe660a..243012d 100644 --- a/src/tests/cache.cpp +++ b/src/tests/cache.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -14,7 +14,7 @@ | |||
14 | 14 | ||
15 | #include "bu/cache.h" | 15 | #include "bu/cache.h" |
16 | #include "bu/file.h" | 16 | #include "bu/file.h" |
17 | #include "bu/fstring.h" | 17 | #include "bu/string.h" |
18 | #include "bu/cachecalc.h" | 18 | #include "bu/cachecalc.h" |
19 | 19 | ||
20 | class Bob | 20 | class Bob |
@@ -90,7 +90,7 @@ public: | |||
90 | writeNum("bobcache/last", cLastId ); | 90 | writeNum("bobcache/last", cLastId ); |
91 | } | 91 | } |
92 | 92 | ||
93 | long readNum( const Bu::FString &sFile ) | 93 | long readNum( const Bu::String &sFile ) |
94 | { | 94 | { |
95 | TRACE( sFile ); | 95 | TRACE( sFile ); |
96 | Bu::File f( sFile, Bu::File::Read ); | 96 | Bu::File f( sFile, Bu::File::Read ); |
@@ -99,13 +99,13 @@ public: | |||
99 | return strtol( buf, NULL, 0 ); | 99 | return strtol( buf, NULL, 0 ); |
100 | } | 100 | } |
101 | 101 | ||
102 | void writeNum( const Bu::FString &sFile, long num ) | 102 | void writeNum( const Bu::String &sFile, long num ) |
103 | { | 103 | { |
104 | TRACE( sFile, num ); | 104 | TRACE( sFile, num ); |
105 | Bu::File f( sFile, | 105 | Bu::File f( sFile, |
106 | Bu::File::Write|Bu::File::Create|Bu::File::Truncate | 106 | Bu::File::Write|Bu::File::Create|Bu::File::Truncate |
107 | ); | 107 | ); |
108 | Bu::FString s; | 108 | Bu::String s; |
109 | s.format("%d", num ); | 109 | s.format("%d", num ); |
110 | f.write( s ); | 110 | f.write( s ); |
111 | } | 111 | } |
@@ -126,7 +126,7 @@ public: | |||
126 | virtual Bob *load( const long &key ) | 126 | virtual Bob *load( const long &key ) |
127 | { | 127 | { |
128 | TRACE( key ); | 128 | TRACE( key ); |
129 | Bu::FString sDest; | 129 | Bu::String sDest; |
130 | sDest.format("bobcache/%d", key ); | 130 | sDest.format("bobcache/%d", key ); |
131 | return new Bob( readNum( sDest ) ); | 131 | return new Bob( readNum( sDest ) ); |
132 | } | 132 | } |
@@ -134,7 +134,7 @@ public: | |||
134 | virtual void unload( Bob *pObj, const long &key ) | 134 | virtual void unload( Bob *pObj, const long &key ) |
135 | { | 135 | { |
136 | TRACE( pObj, key ); | 136 | TRACE( pObj, key ); |
137 | Bu::FString sDest; | 137 | Bu::String sDest; |
138 | sDest.format("bobcache/%d", key ); | 138 | sDest.format("bobcache/%d", key ); |
139 | writeNum( sDest, pObj->getInt() ); | 139 | writeNum( sDest, pObj->getInt() ); |
140 | delete pObj; | 140 | delete pObj; |
@@ -144,7 +144,7 @@ public: | |||
144 | { | 144 | { |
145 | TRACE( rSrc ); | 145 | TRACE( rSrc ); |
146 | long id = ++cLastId; | 146 | long id = ++cLastId; |
147 | Bu::FString sDest; | 147 | Bu::String sDest; |
148 | sDest.format("bobcache/%d", id ); | 148 | sDest.format("bobcache/%d", id ); |
149 | writeNum( sDest, rSrc->getInt() ); | 149 | writeNum( sDest, rSrc->getInt() ); |
150 | return id; | 150 | return id; |
@@ -153,7 +153,7 @@ public: | |||
153 | virtual void destroy( Bob *pObj, const long &key ) | 153 | virtual void destroy( Bob *pObj, const long &key ) |
154 | { | 154 | { |
155 | TRACE( pObj, key ); | 155 | TRACE( pObj, key ); |
156 | Bu::FString sDest; | 156 | Bu::String sDest; |
157 | sDest.format("bobcache/%d", key ); | 157 | sDest.format("bobcache/%d", key ); |
158 | if( !access( sDest.getStr(), F_OK ) ) | 158 | if( !access( sDest.getStr(), F_OK ) ) |
159 | unlink( sDest.getStr() ); | 159 | unlink( sDest.getStr() ); |
@@ -163,7 +163,7 @@ public: | |||
163 | virtual void destroy( const long &key ) | 163 | virtual void destroy( const long &key ) |
164 | { | 164 | { |
165 | TRACE( pObj, key ); | 165 | TRACE( pObj, key ); |
166 | Bu::FString sDest; | 166 | Bu::String sDest; |
167 | sDest.format("bobcache/%d", key ); | 167 | sDest.format("bobcache/%d", key ); |
168 | if( !access( sDest.getStr(), F_OK ) ) | 168 | if( !access( sDest.getStr(), F_OK ) ) |
169 | unlink( sDest.getStr() ); | 169 | unlink( sDest.getStr() ); |
diff --git a/src/tests/console.cpp b/src/tests/console.cpp index 8d2f469..670ff5b 100644 --- a/src/tests/console.cpp +++ b/src/tests/console.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/tests/cryptpass.cpp b/src/tests/cryptpass.cpp index f9abef6..d272344 100644 --- a/src/tests/cryptpass.cpp +++ b/src/tests/cryptpass.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/tests/csv.cpp b/src/tests/csv.cpp index e5efcfb..850fda8 100644 --- a/src/tests/csv.cpp +++ b/src/tests/csv.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/tests/daysinmonth.cpp b/src/tests/daysinmonth.cpp index e0aafc6..1e78eb3 100644 --- a/src/tests/daysinmonth.cpp +++ b/src/tests/daysinmonth.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/tests/fastcgi.cpp b/src/tests/fastcgi.cpp index a3fa675..7ca4ebc 100644 --- a/src/tests/fastcgi.cpp +++ b/src/tests/fastcgi.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -27,10 +27,10 @@ public: | |||
27 | } | 27 | } |
28 | 28 | ||
29 | virtual int onRequest( const StrHash &hParams, | 29 | virtual int onRequest( const StrHash &hParams, |
30 | const Bu::FString &sStdIn, Bu::Stream &sStdOut, | 30 | const Bu::String &sStdIn, Bu::Stream &sStdOut, |
31 | Bu::Stream &/*sStdErr*/ ) | 31 | Bu::Stream &/*sStdErr*/ ) |
32 | { | 32 | { |
33 | Bu::FString sOut("Content-Type: text/html\r\n\r\n"); | 33 | Bu::String sOut("Content-Type: text/html\r\n\r\n"); |
34 | sOut += "<html><body><h1>Environment:</h1><ul>"; | 34 | sOut += "<html><body><h1>Environment:</h1><ul>"; |
35 | for( StrHash::const_iterator i = hParams.begin(); i; i++ ) | 35 | for( StrHash::const_iterator i = hParams.begin(); i; i++ ) |
36 | { | 36 | { |
@@ -44,8 +44,8 @@ public: | |||
44 | sOut += "</li></ul>"; | 44 | sOut += "</li></ul>"; |
45 | sOut += "<h1>Stdin:</h1>"; | 45 | sOut += "<h1>Stdin:</h1>"; |
46 | sOut.formatAppend("%d bytes<pre>", sStdIn.getSize() ); | 46 | sOut.formatAppend("%d bytes<pre>", sStdIn.getSize() ); |
47 | Bu::FString sL, sR; | 47 | Bu::String sL, sR; |
48 | for( Bu::FString::const_iterator i = sStdIn.begin(); | 48 | for( Bu::String::const_iterator i = sStdIn.begin(); |
49 | i; i++ ) | 49 | i; i++ ) |
50 | { | 50 | { |
51 | sL.formatAppend("%02X ", | 51 | sL.formatAppend("%02X ", |
diff --git a/src/tests/formula.cpp b/src/tests/formula.cpp index b9c4446..a90ddaf 100644 --- a/src/tests/formula.cpp +++ b/src/tests/formula.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/tests/fstratsptr.cpp b/src/tests/fstratsptr.cpp index 2303d6a..5053dd1 100644 --- a/src/tests/fstratsptr.cpp +++ b/src/tests/fstratsptr.cpp | |||
@@ -1,11 +1,11 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
6 | */ | 6 | */ |
7 | 7 | ||
8 | #include "bu/fstring.h" | 8 | #include "bu/string.h" |
9 | #include "bu/atom.h" | 9 | #include "bu/atom.h" |
10 | #include "bu/sptr.h" | 10 | #include "bu/sptr.h" |
11 | 11 | ||
@@ -15,8 +15,8 @@ public: | |||
15 | Person(){}; | 15 | Person(){}; |
16 | virtual ~Person(){}; | 16 | virtual ~Person(){}; |
17 | 17 | ||
18 | Bu::Atom<Bu::FString> sFirstName; | 18 | Bu::Atom<Bu::String> sFirstName; |
19 | Bu::Atom<Bu::FString> sLastName; | 19 | Bu::Atom<Bu::String> sLastName; |
20 | }; | 20 | }; |
21 | 21 | ||
22 | typedef Bu::SPtr<Person> PersonPtr; | 22 | typedef Bu::SPtr<Person> PersonPtr; |
@@ -45,7 +45,7 @@ int main() | |||
45 | Swap(one, two); | 45 | Swap(one, two); |
46 | */ | 46 | */ |
47 | 47 | ||
48 | Bu::Atom<Bu::FString> sOne, sTwo; | 48 | Bu::Atom<Bu::String> sOne, sTwo; |
49 | sOne = "Hello"; | 49 | sOne = "Hello"; |
50 | sTwo = sOne; | 50 | sTwo = sOne; |
51 | 51 | ||
diff --git a/src/tests/fstrformat.cpp b/src/tests/fstrformat.cpp index a8e9def..a911a8f 100644 --- a/src/tests/fstrformat.cpp +++ b/src/tests/fstrformat.cpp | |||
@@ -1,16 +1,16 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
6 | */ | 6 | */ |
7 | 7 | ||
8 | #include "bu/fstring.h" | 8 | #include "bu/string.h" |
9 | #include <stdio.h> | 9 | #include <stdio.h> |
10 | 10 | ||
11 | int main() | 11 | int main() |
12 | { | 12 | { |
13 | Bu::FString s; | 13 | Bu::String s; |
14 | 14 | ||
15 | s.format("%d, %f, \'%s\'", 144, 12.5, "bob" ); | 15 | s.format("%d, %f, \'%s\'", 144, 12.5, "bob" ); |
16 | 16 | ||
diff --git a/src/tests/fstrstd.cpp b/src/tests/fstrstd.cpp index 86d7c5c..b2fed8a 100644 --- a/src/tests/fstrstd.cpp +++ b/src/tests/fstrstd.cpp | |||
@@ -1,16 +1,16 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
6 | */ | 6 | */ |
7 | 7 | ||
8 | #include <iostream> | 8 | #include <iostream> |
9 | #include "bu/fstring.h" | 9 | #include "bu/string.h" |
10 | 10 | ||
11 | int main() | 11 | int main() |
12 | { | 12 | { |
13 | Bu::FString s("Hey there, dude.\n"); | 13 | Bu::String s("Hey there, dude.\n"); |
14 | 14 | ||
15 | // std::cout << s << 5; | 15 | // std::cout << s << 5; |
16 | } | 16 | } |
diff --git a/src/tests/hash.cpp b/src/tests/hash.cpp index 5bd70f6..7cefb79 100644 --- a/src/tests/hash.cpp +++ b/src/tests/hash.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/tests/hash2.cpp b/src/tests/hash2.cpp index 4db248e..55bb4c9 100644 --- a/src/tests/hash2.cpp +++ b/src/tests/hash2.cpp | |||
@@ -1,16 +1,16 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
6 | */ | 6 | */ |
7 | 7 | ||
8 | #include <bu/fstring.h> | 8 | #include <bu/string.h> |
9 | #include <bu/hash.h> | 9 | #include <bu/hash.h> |
10 | 10 | ||
11 | int main() | 11 | int main() |
12 | { | 12 | { |
13 | Bu::Hash<Bu::FString, int> hCmd; | 13 | Bu::Hash<Bu::String, int> hCmd; |
14 | 14 | ||
15 | hCmd.insert("help", 5 ); | 15 | hCmd.insert("help", 5 ); |
16 | hCmd.insert("exit", 5 ); | 16 | hCmd.insert("exit", 5 ); |
diff --git a/src/tests/heap.cpp b/src/tests/heap.cpp index 7538936..14da55a 100644 --- a/src/tests/heap.cpp +++ b/src/tests/heap.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -10,7 +10,7 @@ | |||
10 | 10 | ||
11 | #include "bu/formatter.h" | 11 | #include "bu/formatter.h" |
12 | #include "bu/heap.h" | 12 | #include "bu/heap.h" |
13 | #include "bu/fstring.h" | 13 | #include "bu/string.h" |
14 | #include "bu/file.h" | 14 | #include "bu/file.h" |
15 | 15 | ||
16 | typedef struct num | 16 | typedef struct num |
@@ -38,15 +38,15 @@ typedef struct num | |||
38 | } | 38 | } |
39 | } num; | 39 | } num; |
40 | 40 | ||
41 | void printHeap( Bu::Heap<Bu::FString> &h, int j ) | 41 | void printHeap( Bu::Heap<Bu::String> &h, int j ) |
42 | { | 42 | { |
43 | // return; | 43 | // return; |
44 | Bu::FString sFName; | 44 | Bu::String sFName; |
45 | sFName.format("graph-step-%02d.dot", j ); | 45 | sFName.format("graph-step-%02d.dot", j ); |
46 | Bu::File fOut( sFName, Bu::File::WriteNew ); | 46 | Bu::File fOut( sFName, Bu::File::WriteNew ); |
47 | Bu::Formatter f( fOut ); | 47 | Bu::Formatter f( fOut ); |
48 | f << "Graph step: " << j << ", total size: " << h.getSize() << f.nl; | 48 | f << "Graph step: " << j << ", total size: " << h.getSize() << f.nl; |
49 | for( Bu::Heap<Bu::FString>::iterator i = h.begin(); i; i++ ) | 49 | for( Bu::Heap<Bu::String>::iterator i = h.begin(); i; i++ ) |
50 | { | 50 | { |
51 | f << *i << f.nl; | 51 | f << *i << f.nl; |
52 | } | 52 | } |
@@ -73,7 +73,7 @@ int main() | |||
73 | } | 73 | } |
74 | printf("\n"); | 74 | printf("\n"); |
75 | */ | 75 | */ |
76 | Bu::Heap<Bu::FString> hStr; | 76 | Bu::Heap<Bu::String> hStr; |
77 | int j = 0; | 77 | int j = 0; |
78 | 78 | ||
79 | hStr.enqueue("George"); | 79 | hStr.enqueue("George"); |
@@ -100,7 +100,7 @@ int main() | |||
100 | } | 100 | } |
101 | printf("\n"); | 101 | printf("\n"); |
102 | 102 | ||
103 | Bu::List<Bu::FString> lStr; | 103 | Bu::List<Bu::String> lStr; |
104 | 104 | ||
105 | lStr.insertSorted("George"); | 105 | lStr.insertSorted("George"); |
106 | lStr.insertSorted("George"); | 106 | lStr.insertSorted("George"); |
@@ -110,7 +110,7 @@ int main() | |||
110 | lStr.insertSorted("Brianna"); | 110 | lStr.insertSorted("Brianna"); |
111 | lStr.insertSorted("Kate"); | 111 | lStr.insertSorted("Kate"); |
112 | lStr.insertSorted("Soggy"); | 112 | lStr.insertSorted("Soggy"); |
113 | for( Bu::List<Bu::FString>::iterator i = lStr.begin(); i; i++ ) | 113 | for( Bu::List<Bu::String>::iterator i = lStr.begin(); i; i++ ) |
114 | { | 114 | { |
115 | printf("\"%s\" ", (*i).getStr() ); | 115 | printf("\"%s\" ", (*i).getStr() ); |
116 | } | 116 | } |
diff --git a/src/tests/itoheap.cpp b/src/tests/itoheap.cpp index 347f1e0..ec06b90 100644 --- a/src/tests/itoheap.cpp +++ b/src/tests/itoheap.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/tests/itoqueue1.cpp b/src/tests/itoqueue1.cpp index 11dbb49..27cb93c 100644 --- a/src/tests/itoqueue1.cpp +++ b/src/tests/itoqueue1.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/tests/itoqueue2.cpp b/src/tests/itoqueue2.cpp index 5283854..10bc566 100644 --- a/src/tests/itoqueue2.cpp +++ b/src/tests/itoqueue2.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/tests/itoserver.cpp b/src/tests/itoserver.cpp index 5f6e4fa..48ef527 100644 --- a/src/tests/itoserver.cpp +++ b/src/tests/itoserver.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/tests/list.cpp b/src/tests/list.cpp index c70fbc8..aa3d32d 100644 --- a/src/tests/list.cpp +++ b/src/tests/list.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/tests/list2.cpp b/src/tests/list2.cpp index dc936d3..567370e 100644 --- a/src/tests/list2.cpp +++ b/src/tests/list2.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/tests/listsort.cpp b/src/tests/listsort.cpp index 60d9611..4873a05 100644 --- a/src/tests/listsort.cpp +++ b/src/tests/listsort.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -7,7 +7,7 @@ | |||
7 | 7 | ||
8 | #include <bu/list.h> | 8 | #include <bu/list.h> |
9 | #include <bu/sio.h> | 9 | #include <bu/sio.h> |
10 | #include <bu/fstring.h> | 10 | #include <bu/string.h> |
11 | 11 | ||
12 | using namespace Bu; | 12 | using namespace Bu; |
13 | 13 | ||
@@ -25,7 +25,7 @@ int main() | |||
25 | il.sortI( cmp ); | 25 | il.sortI( cmp ); |
26 | */ | 26 | */ |
27 | 27 | ||
28 | FString a("Soggy"), b("Sam"); | 28 | String a("Soggy"), b("Sam"); |
29 | 29 | ||
30 | if( a < b ) | 30 | if( a < b ) |
31 | { | 31 | { |
@@ -36,7 +36,7 @@ int main() | |||
36 | sio << "Good" << sio.nl; | 36 | sio << "Good" << sio.nl; |
37 | } | 37 | } |
38 | 38 | ||
39 | typedef List<FString> StrList; | 39 | typedef List<String> StrList; |
40 | 40 | ||
41 | StrList lNames; | 41 | StrList lNames; |
42 | 42 | ||
diff --git a/src/tests/logger.cpp b/src/tests/logger.cpp index e9043db..e97193c 100644 --- a/src/tests/logger.cpp +++ b/src/tests/logger.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/tests/md5.cpp b/src/tests/md5.cpp index 368b033..a32f669 100644 --- a/src/tests/md5.cpp +++ b/src/tests/md5.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/tests/minicron.cpp b/src/tests/minicron.cpp index 0749f90..aed63e2 100644 --- a/src/tests/minicron.cpp +++ b/src/tests/minicron.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/tests/mmparse.cpp b/src/tests/mmparse.cpp index b2c3bf5..c1ce862 100644 --- a/src/tests/mmparse.cpp +++ b/src/tests/mmparse.cpp | |||
@@ -1,12 +1,12 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
6 | */ | 6 | */ |
7 | 7 | ||
8 | #include "bu/minimacro.h" | 8 | #include "bu/minimacro.h" |
9 | #include "bu/fstring.h" | 9 | #include "bu/string.h" |
10 | 10 | ||
11 | int main() | 11 | int main() |
12 | { | 12 | { |
diff --git a/src/tests/multiserver.cpp b/src/tests/multiserver.cpp index 85971b5..12f4681 100644 --- a/src/tests/multiserver.cpp +++ b/src/tests/multiserver.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/tests/optparser.cpp b/src/tests/optparser.cpp index f5d1512..aadb07c 100644 --- a/src/tests/optparser.cpp +++ b/src/tests/optparser.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -72,7 +72,7 @@ public: | |||
72 | 72 | ||
73 | int iBob; | 73 | int iBob; |
74 | float dBob; | 74 | float dBob; |
75 | Bu::FString sVar; | 75 | Bu::String sVar; |
76 | }; | 76 | }; |
77 | 77 | ||
78 | int main( int argc, char *argv[] ) | 78 | int main( int argc, char *argv[] ) |
diff --git a/src/tests/procs.cpp b/src/tests/procs.cpp index bb5ff96..94d2cc5 100644 --- a/src/tests/procs.cpp +++ b/src/tests/procs.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/tests/queuebuf.cpp b/src/tests/queuebuf.cpp index 0cb8b48..f872738 100644 --- a/src/tests/queuebuf.cpp +++ b/src/tests/queuebuf.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/tests/regex.cpp b/src/tests/regex.cpp index 0a33a93..376fbb2 100644 --- a/src/tests/regex.cpp +++ b/src/tests/regex.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/tests/ringbuffer.cpp b/src/tests/ringbuffer.cpp index 003d7be..da5126c 100644 --- a/src/tests/ringbuffer.cpp +++ b/src/tests/ringbuffer.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/tests/rot13.cpp b/src/tests/rot13.cpp index 03ba385..1530af3 100644 --- a/src/tests/rot13.cpp +++ b/src/tests/rot13.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -28,21 +28,21 @@ public: | |||
28 | { | 28 | { |
29 | } | 29 | } |
30 | 30 | ||
31 | virtual size_t stop() | 31 | virtual Bu::size stop() |
32 | { | 32 | { |
33 | return 0; | 33 | return 0; |
34 | } | 34 | } |
35 | 35 | ||
36 | virtual size_t read( void *pBuf, size_t nBytes ) | 36 | virtual Bu::size read( void *pBuf, Bu::size nBytes ) |
37 | { | 37 | { |
38 | return rNext.read( pBuf, nBytes ); | 38 | return rNext.read( pBuf, nBytes ); |
39 | } | 39 | } |
40 | 40 | ||
41 | virtual size_t write( const void *pBuf, size_t nBytes ) | 41 | virtual Bu::size write( const void *pBuf, Bu::size nBytes ) |
42 | { | 42 | { |
43 | const char *cBuf = (const char *)pBuf; | 43 | const char *cBuf = (const char *)pBuf; |
44 | char *buf = new char[nBytes]; | 44 | char *buf = new char[nBytes]; |
45 | for( size_t j = 0; j < nBytes; j++ ) | 45 | for( Bu::size j = 0; j < nBytes; j++ ) |
46 | { | 46 | { |
47 | if( cBuf[j] >= 'a' && cBuf[j] <= 'z' ) | 47 | if( cBuf[j] >= 'a' && cBuf[j] <= 'z' ) |
48 | buf[j] = (cBuf[j]-'a'+13)%26+'a'; | 48 | buf[j] = (cBuf[j]-'a'+13)%26+'a'; |
diff --git a/src/tests/serverticks.cpp b/src/tests/serverticks.cpp index bffa363..3872a16 100644 --- a/src/tests/serverticks.cpp +++ b/src/tests/serverticks.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/tests/sha1.cpp b/src/tests/sha1.cpp index b1c798a..ac795e7 100644 --- a/src/tests/sha1.cpp +++ b/src/tests/sha1.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -28,8 +28,8 @@ int main( int argc, char *argv[] ) | |||
28 | break; | 28 | break; |
29 | } | 29 | } |
30 | 30 | ||
31 | Bu::FString sRes = m.getResult(); | 31 | Bu::String sRes = m.getResult(); |
32 | for( Bu::FString::iterator i = sRes.begin(); i; i++ ) | 32 | for( Bu::String::iterator i = sRes.begin(); i; i++ ) |
33 | { | 33 | { |
34 | sio << Fmt::hex(2,false) << (int)(unsigned char)(*i); | 34 | sio << Fmt::hex(2,false) << (int)(unsigned char)(*i); |
35 | } | 35 | } |
diff --git a/src/tests/sharedcore.cpp b/src/tests/sharedcore.cpp index 9b0a0ec..c68f07b 100644 --- a/src/tests/sharedcore.cpp +++ b/src/tests/sharedcore.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/tests/signals.cpp b/src/tests/signals.cpp index e53c16e..14bbc9c 100644 --- a/src/tests/signals.cpp +++ b/src/tests/signals.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -32,22 +32,22 @@ public: | |||
32 | sio << iState << ": void fnc1( " << a << " )" << sio.nl; | 32 | sio << iState << ": void fnc1( " << a << " )" << sio.nl; |
33 | } | 33 | } |
34 | 34 | ||
35 | void fnc2( int a, Bu::FString b ) | 35 | void fnc2( int a, Bu::String b ) |
36 | { | 36 | { |
37 | sio << iState << ": void fnc2( " << a << ", \"" << b << "\" )" << sio.nl; | 37 | sio << iState << ": void fnc2( " << a << ", \"" << b << "\" )" << sio.nl; |
38 | } | 38 | } |
39 | 39 | ||
40 | void fnc3( int a, Bu::FString b, double c ) | 40 | void fnc3( int a, Bu::String b, double c ) |
41 | { | 41 | { |
42 | sio << iState << ": void fnc3( " << a << ", \"" << b << "\", " << c << " )" << sio.nl; | 42 | sio << iState << ": void fnc3( " << a << ", \"" << b << "\", " << c << " )" << sio.nl; |
43 | } | 43 | } |
44 | 44 | ||
45 | void fnc4( int a, Bu::FString b, double c, char d ) | 45 | void fnc4( int a, Bu::String b, double c, char d ) |
46 | { | 46 | { |
47 | sio << iState << ": void fnc4( " << a << ", \"" << b << "\", " << c << ", '" << d << "' )" << sio.nl; | 47 | sio << iState << ": void fnc4( " << a << ", \"" << b << "\", " << c << ", '" << d << "' )" << sio.nl; |
48 | } | 48 | } |
49 | 49 | ||
50 | void fnc5( int a, Bu::FString b, double c, char d, long e ) | 50 | void fnc5( int a, Bu::String b, double c, char d, long e ) |
51 | { | 51 | { |
52 | sio << iState << ": void fnc5( " << a << ", \"" << b << "\", " << c << ", '" << d << "', " << e << " )" << sio.nl; | 52 | sio << iState << ": void fnc5( " << a << ", \"" << b << "\", " << c << ", '" << d << "', " << e << " )" << sio.nl; |
53 | } | 53 | } |
@@ -66,22 +66,22 @@ void pfnc1( int a ) | |||
66 | sio << ": void pfnc1( " << a << " )" << sio.nl; | 66 | sio << ": void pfnc1( " << a << " )" << sio.nl; |
67 | } | 67 | } |
68 | 68 | ||
69 | void pfnc2( int a, Bu::FString b ) | 69 | void pfnc2( int a, Bu::String b ) |
70 | { | 70 | { |
71 | sio << ": void pfnc2( " << a << ", \"" << b << "\" )" << sio.nl; | 71 | sio << ": void pfnc2( " << a << ", \"" << b << "\" )" << sio.nl; |
72 | } | 72 | } |
73 | 73 | ||
74 | void pfnc3( int a, Bu::FString b, double c ) | 74 | void pfnc3( int a, Bu::String b, double c ) |
75 | { | 75 | { |
76 | sio << ": void pfnc3( " << a << ", \"" << b << "\", " << c << " )" << sio.nl; | 76 | sio << ": void pfnc3( " << a << ", \"" << b << "\", " << c << " )" << sio.nl; |
77 | } | 77 | } |
78 | 78 | ||
79 | void pfnc4( int a, Bu::FString b, double c, char d ) | 79 | void pfnc4( int a, Bu::String b, double c, char d ) |
80 | { | 80 | { |
81 | sio << ": void pfnc4( " << a << ", \"" << b << "\", " << c << ", '" << d << "' )" << sio.nl; | 81 | sio << ": void pfnc4( " << a << ", \"" << b << "\", " << c << ", '" << d << "' )" << sio.nl; |
82 | } | 82 | } |
83 | 83 | ||
84 | void pfnc5( int a, Bu::FString b, double c, char d, long e ) | 84 | void pfnc5( int a, Bu::String b, double c, char d, long e ) |
85 | { | 85 | { |
86 | sio << ": void pfnc5( " << a << ", \"" << b << "\", " << c << ", '" << d << "', " << e << " )" << sio.nl; | 86 | sio << ": void pfnc5( " << a << ", \"" << b << "\", " << c << ", '" << d << "', " << e << " )" << sio.nl; |
87 | } | 87 | } |
@@ -105,22 +105,22 @@ int main() | |||
105 | cb1 = slot( &pfnc1 ); | 105 | cb1 = slot( &pfnc1 ); |
106 | cb1( 5 ); | 106 | cb1( 5 ); |
107 | 107 | ||
108 | Signal2<void, int, Bu::FString> cb2( slot( &t, &Thing::fnc2 ) ); | 108 | Signal2<void, int, Bu::String> cb2( slot( &t, &Thing::fnc2 ) ); |
109 | cb2( 5, "Hi there" ); | 109 | cb2( 5, "Hi there" ); |
110 | cb2 = slot( &pfnc2 ); | 110 | cb2 = slot( &pfnc2 ); |
111 | cb2( 5, "Hi there" ); | 111 | cb2( 5, "Hi there" ); |
112 | 112 | ||
113 | Signal3<void, int, Bu::FString, double> cb3( slot( &t, &Thing::fnc3 ) ); | 113 | Signal3<void, int, Bu::String, double> cb3( slot( &t, &Thing::fnc3 ) ); |
114 | cb3( 5, "Hi there", 12.85 ); | 114 | cb3( 5, "Hi there", 12.85 ); |
115 | cb3 = slot( &pfnc3 ); | 115 | cb3 = slot( &pfnc3 ); |
116 | cb3( 5, "Hi there", 12.85 ); | 116 | cb3( 5, "Hi there", 12.85 ); |
117 | 117 | ||
118 | Signal4<void, int, Bu::FString, double, char> cb4( slot( &t, &Thing::fnc4 ) ); | 118 | Signal4<void, int, Bu::String, double, char> cb4( slot( &t, &Thing::fnc4 ) ); |
119 | cb4( 5, "Hi there", 12.85, 'z' ); | 119 | cb4( 5, "Hi there", 12.85, 'z' ); |
120 | cb4 = slot( &pfnc4 ); | 120 | cb4 = slot( &pfnc4 ); |
121 | cb4( 5, "Hi there", 12.85, 'z' ); | 121 | cb4( 5, "Hi there", 12.85, 'z' ); |
122 | 122 | ||
123 | Signal5<void, int, Bu::FString, double, char, long> cb5( slot( &t, &Thing::fnc5 ) ); | 123 | Signal5<void, int, Bu::String, double, char, long> cb5( slot( &t, &Thing::fnc5 ) ); |
124 | cb5( 5, "Hi there", 12.85, 'z', 849 ); | 124 | cb5( 5, "Hi there", 12.85, 'z', 849 ); |
125 | cb5 = slot( &pfnc5 ); | 125 | cb5 = slot( &pfnc5 ); |
126 | cb5( 5, "Hi there", 12.85, 'z', 849 ); | 126 | cb5( 5, "Hi there", 12.85, 'z', 849 ); |
diff --git a/src/tests/size.cpp b/src/tests/size.cpp index a9a921d..dfad16f 100644 --- a/src/tests/size.cpp +++ b/src/tests/size.cpp | |||
@@ -1,20 +1,20 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
6 | */ | 6 | */ |
7 | 7 | ||
8 | #include "bu/hash.h" | 8 | #include "bu/hash.h" |
9 | #include "bu/fstring.h" | 9 | #include "bu/string.h" |
10 | 10 | ||
11 | #define pSize( t ) printf("%15s: %db\n", #t, sizeof( t ) ); | 11 | #define pSize( t ) printf("%15s: %db\n", #t, sizeof( t ) ); |
12 | 12 | ||
13 | int main() | 13 | int main() |
14 | { | 14 | { |
15 | typedef Bu::Hash<char, char> charcharHash; | 15 | typedef Bu::Hash<char, char> charcharHash; |
16 | typedef Bu::Hash<Bu::FString, Bu::FString> strstrHash; | 16 | typedef Bu::Hash<Bu::String, Bu::String> strstrHash; |
17 | pSize( Bu::FString ); | 17 | pSize( Bu::String ); |
18 | pSize( charcharHash ); | 18 | pSize( charcharHash ); |
19 | pSize( strstrHash ); | 19 | pSize( strstrHash ); |
20 | } | 20 | } |
diff --git a/src/tests/socketblock.cpp b/src/tests/socketblock.cpp index 793ef96..e36bb33 100644 --- a/src/tests/socketblock.cpp +++ b/src/tests/socketblock.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/tests/socketbreak.cpp b/src/tests/socketbreak.cpp index 7d3c71a..d58ebcf 100644 --- a/src/tests/socketbreak.cpp +++ b/src/tests/socketbreak.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -26,9 +26,9 @@ int main() | |||
26 | 26 | ||
27 | char buf[3]; | 27 | char buf[3]; |
28 | printf("About to write.\n"); | 28 | printf("About to write.\n"); |
29 | printf("write: %d\n", sSend.write("hi", 2 ) ); | 29 | printf("write: %lld\n", sSend.write("hi", 2 ) ); |
30 | printf("About to read.\n"); | 30 | printf("About to read.\n"); |
31 | printf("read: %d\n", sSend.read( buf, 2 ) ); | 31 | printf("read: %lld\n", sSend.read( buf, 2 ) ); |
32 | 32 | ||
33 | return 0; | 33 | return 0; |
34 | } | 34 | } |
diff --git a/src/tests/speed.cpp b/src/tests/speed.cpp index c6770de..2fa29aa 100644 --- a/src/tests/speed.cpp +++ b/src/tests/speed.cpp | |||
@@ -1,11 +1,11 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
6 | */ | 6 | */ |
7 | 7 | ||
8 | #include "bu/fstring.h" | 8 | #include "bu/string.h" |
9 | #include <sys/time.h> | 9 | #include <sys/time.h> |
10 | 10 | ||
11 | template<typename a> | 11 | template<typename a> |
@@ -50,9 +50,9 @@ void fullTest( tst t ) | |||
50 | 50 | ||
51 | int main() | 51 | int main() |
52 | { | 52 | { |
53 | Bu::FString str; | 53 | Bu::String str; |
54 | for( int j = 0; j < 500; j++ ) | 54 | for( int j = 0; j < 500; j++ ) |
55 | str.append("Hey, this is a test string. It will be reapeated many, many times. How's that?"); | 55 | str.append("Hey, this is a test string. It will be reapeated many, many times. How's that?"); |
56 | fullTest( tstCopy<Bu::FString>( str ) ); | 56 | fullTest( tstCopy<Bu::String>( str ) ); |
57 | } | 57 | } |
58 | 58 | ||
diff --git a/src/tests/stdstream.cpp b/src/tests/stdstream.cpp index e1f04f5..95df42e 100644 --- a/src/tests/stdstream.cpp +++ b/src/tests/stdstream.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/tests/streamstack.cpp b/src/tests/streamstack.cpp index b8c48e7..4a0e128 100644 --- a/src/tests/streamstack.cpp +++ b/src/tests/streamstack.cpp | |||
@@ -1,3 +1,10 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. | ||
3 | * | ||
4 | * This file is part of the libbu++ library and is released under the | ||
5 | * terms of the license contained in the file LICENSE. | ||
6 | */ | ||
7 | |||
1 | #include "bu/streamstack.h" | 8 | #include "bu/streamstack.h" |
2 | 9 | ||
3 | #include "bu/file.h" | 10 | #include "bu/file.h" |
@@ -24,7 +31,7 @@ public: | |||
24 | 31 | ||
25 | void write() | 32 | void write() |
26 | { | 33 | { |
27 | Bu::FString s; | 34 | Bu::String s; |
28 | time_t tNow = time( NULL ); | 35 | time_t tNow = time( NULL ); |
29 | s = ctime( &tNow ); | 36 | s = ctime( &tNow ); |
30 | long lSize = s.getSize()-1; | 37 | long lSize = s.getSize()-1; |
@@ -34,7 +41,7 @@ public: | |||
34 | 41 | ||
35 | void read() | 42 | void read() |
36 | { | 43 | { |
37 | Bu::FString s; | 44 | Bu::String s; |
38 | long lSize; | 45 | long lSize; |
39 | rStream.read( &lSize, sizeof(long) ); | 46 | rStream.read( &lSize, sizeof(long) ); |
40 | s.setSize( lSize ); | 47 | s.setSize( lSize ); |
diff --git a/src/tests/fstring.cpp b/src/tests/string.cpp index c343172..12ce8a8 100644 --- a/src/tests/fstring.cpp +++ b/src/tests/string.cpp | |||
@@ -1,12 +1,12 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
6 | */ | 6 | */ |
7 | 7 | ||
8 | #include "bu/hash.h" | 8 | #include "bu/hash.h" |
9 | #include "bu/fstring.h" | 9 | #include "bu/string.h" |
10 | #include <sys/time.h> | 10 | #include <sys/time.h> |
11 | #include <string> | 11 | #include <string> |
12 | 12 | ||
@@ -27,9 +27,9 @@ inline double getTime() | |||
27 | } | 27 | } |
28 | #endif | 28 | #endif |
29 | 29 | ||
30 | Bu::FString genThing() | 30 | Bu::String genThing() |
31 | { | 31 | { |
32 | Bu::FString bob; | 32 | Bu::String bob; |
33 | bob.append("ab "); | 33 | bob.append("ab "); |
34 | bob += "cd "; | 34 | bob += "cd "; |
35 | bob += "efg"; | 35 | bob += "efg"; |
@@ -39,7 +39,7 @@ Bu::FString genThing() | |||
39 | return bob; | 39 | return bob; |
40 | } | 40 | } |
41 | 41 | ||
42 | void thing( Bu::FString str ) | 42 | void thing( Bu::String str ) |
43 | { | 43 | { |
44 | printf("Hey: %s\n", str.getStr() ); | 44 | printf("Hey: %s\n", str.getStr() ); |
45 | } | 45 | } |
@@ -49,21 +49,21 @@ void copyfunc( std::string temp ) | |||
49 | temp += "Hi"; | 49 | temp += "Hi"; |
50 | } | 50 | } |
51 | 51 | ||
52 | void copyfunc( Bu::FString temp ) | 52 | void copyfunc( Bu::String temp ) |
53 | { | 53 | { |
54 | temp += "Hi"; | 54 | temp += "Hi"; |
55 | } | 55 | } |
56 | 56 | ||
57 | void doTimings() | 57 | void doTimings() |
58 | { | 58 | { |
59 | Bu::FString fs1, fs2; | 59 | Bu::String fs1, fs2; |
60 | std::string ss1, ss2; | 60 | std::string ss1, ss2; |
61 | double dStart, dEnd, tfs1, tfs2, tfs3, tss1, tss2, tss3; | 61 | double dStart, dEnd, tfs1, tfs2, tfs3, tss1, tss2, tss3; |
62 | int nChars = 500000, nChunks=5000, nCopies=5000000, nChunkSize=1024*4; | 62 | int nChars = 500000, nChunks=5000, nCopies=5000000, nChunkSize=1024*4; |
63 | char *buf = new char[nChunkSize]; | 63 | char *buf = new char[nChunkSize]; |
64 | memset( buf, '!', nChunkSize ); | 64 | memset( buf, '!', nChunkSize ); |
65 | 65 | ||
66 | printf("Timing Bu::FString single chars...\n"); | 66 | printf("Timing Bu::String single chars...\n"); |
67 | dStart = getTime(); | 67 | dStart = getTime(); |
68 | for( int j = 0; j < nChars; j++ ) fs1 += (char)('a'+(j%26)); | 68 | for( int j = 0; j < nChars; j++ ) fs1 += (char)('a'+(j%26)); |
69 | fs1.getStr(); | 69 | fs1.getStr(); |
@@ -77,7 +77,7 @@ void doTimings() | |||
77 | dEnd = getTime(); | 77 | dEnd = getTime(); |
78 | tss1 = dEnd-dStart; | 78 | tss1 = dEnd-dStart; |
79 | 79 | ||
80 | printf("Timing Bu::FString %d char chunks...\n", nChunkSize); | 80 | printf("Timing Bu::String %d char chunks...\n", nChunkSize); |
81 | dStart = getTime(); | 81 | dStart = getTime(); |
82 | for( int j = 0; j < nChunks; j++ ) fs2.append(buf, nChunkSize); | 82 | for( int j = 0; j < nChunks; j++ ) fs2.append(buf, nChunkSize); |
83 | fs2.getStr(); | 83 | fs2.getStr(); |
@@ -93,9 +93,9 @@ void doTimings() | |||
93 | 93 | ||
94 | fs2 = "Hello there."; | 94 | fs2 = "Hello there."; |
95 | ss2 = "Hello there."; | 95 | ss2 = "Hello there."; |
96 | printf("Timing Bu::FString copies...\n"); | 96 | printf("Timing Bu::String copies...\n"); |
97 | dStart = getTime(); | 97 | dStart = getTime(); |
98 | for( int j = 0; j < nCopies; j++ ) Bu::FString stmp = fs2; | 98 | for( int j = 0; j < nCopies; j++ ) Bu::String stmp = fs2; |
99 | dEnd = getTime(); | 99 | dEnd = getTime(); |
100 | tfs3 = dEnd-dStart; | 100 | tfs3 = dEnd-dStart; |
101 | 101 | ||
@@ -107,7 +107,7 @@ void doTimings() | |||
107 | 107 | ||
108 | printf( | 108 | printf( |
109 | "Results: singles: chunks: copies:\n" | 109 | "Results: singles: chunks: copies:\n" |
110 | "Bu::FString %10.2f/s %10.2f/s %10.2f/s\n" | 110 | "Bu::String %10.2f/s %10.2f/s %10.2f/s\n" |
111 | "std::string %10.2f/s %10.2f/s %10.2f/s\n", | 111 | "std::string %10.2f/s %10.2f/s %10.2f/s\n", |
112 | nChars/tfs1, nChunks/tfs2, nCopies/tfs3, | 112 | nChars/tfs1, nChunks/tfs2, nCopies/tfs3, |
113 | nChars/tss1, nChunks/tss2, nCopies/tss3 ); | 113 | nChars/tss1, nChunks/tss2, nCopies/tss3 ); |
@@ -118,16 +118,16 @@ void doTimings() | |||
118 | #define pem printf("---------\n%08tX: %s\n%08tX: %s\n", (ptrdiff_t)str.getStr(), str.getStr(), (ptrdiff_t)str2.getStr(), str2.getStr() ); | 118 | #define pem printf("---------\n%08tX: %s\n%08tX: %s\n", (ptrdiff_t)str.getStr(), str.getStr(), (ptrdiff_t)str2.getStr(), str2.getStr() ); |
119 | int main( ) | 119 | int main( ) |
120 | { | 120 | { |
121 | Bu::FString fs1; | 121 | Bu::String fs1; |
122 | for( int j = 0; j < 500000; j++ ) fs1 += (char)('a'+(j%26)); | 122 | for( int j = 0; j < 500000; j++ ) fs1 += (char)('a'+(j%26)); |
123 | return 0; | 123 | return 0; |
124 | 124 | ||
125 | Bu::FString str("th"); | 125 | Bu::String str("th"); |
126 | 126 | ||
127 | str.prepend("Hello "); | 127 | str.prepend("Hello "); |
128 | str.append("ere."); | 128 | str.append("ere."); |
129 | 129 | ||
130 | Bu::FString str2( str ); | 130 | Bu::String str2( str ); |
131 | pem; | 131 | pem; |
132 | str += " What's up?"; | 132 | str += " What's up?"; |
133 | pem; | 133 | pem; |
diff --git a/src/tests/taf.cpp b/src/tests/taf.cpp index 484e784..1703fbc 100644 --- a/src/tests/taf.cpp +++ b/src/tests/taf.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/tests/tcpsocket.cpp b/src/tests/tcpsocket.cpp index 30dd22f..89c015c 100644 --- a/src/tests/tcpsocket.cpp +++ b/src/tests/tcpsocket.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/tests/telnetsrv.cpp b/src/tests/telnetsrv.cpp index 4504aaf..aac6b39 100644 --- a/src/tests/telnetsrv.cpp +++ b/src/tests/telnetsrv.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -36,7 +36,7 @@ public: | |||
36 | printf("New dim = (%dx%d)\n", iWidth, iHeight ); | 36 | printf("New dim = (%dx%d)\n", iWidth, iHeight ); |
37 | } | 37 | } |
38 | 38 | ||
39 | virtual void gotLine( Bu::FString &sLine ) | 39 | virtual void gotLine( Bu::String &sLine ) |
40 | { | 40 | { |
41 | printf("Line: \"%s\"\n", sLine.getStr() ); | 41 | printf("Line: \"%s\"\n", sLine.getStr() ); |
42 | write("\n\r", 2 ); | 42 | write("\n\r", 2 ); |
diff --git a/src/tests/tracer.cpp b/src/tests/tracer.cpp index c736d9e..703fa1a 100644 --- a/src/tests/tracer.cpp +++ b/src/tests/tracer.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/tests/udpsocket.cpp b/src/tests/udpsocket.cpp index 18c7bb9..2a74acf 100644 --- a/src/tests/udpsocket.cpp +++ b/src/tests/udpsocket.cpp | |||
@@ -1,3 +1,10 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. | ||
3 | * | ||
4 | * This file is part of the libbu++ library and is released under the | ||
5 | * terms of the license contained in the file LICENSE. | ||
6 | */ | ||
7 | |||
1 | #include "bu/udpsocket.h" | 8 | #include "bu/udpsocket.h" |
2 | #include "bu/sio.h" | 9 | #include "bu/sio.h" |
3 | 10 | ||
diff --git a/src/tests/url.cpp b/src/tests/url.cpp index 6331664..a381cbe 100644 --- a/src/tests/url.cpp +++ b/src/tests/url.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/tests/uuid.cpp b/src/tests/uuid.cpp index 1393e8c..b6470fa 100644 --- a/src/tests/uuid.cpp +++ b/src/tests/uuid.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/tests/variant.cpp b/src/tests/variant.cpp index 79893c0..68dec4f 100644 --- a/src/tests/variant.cpp +++ b/src/tests/variant.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/tools/bnfcompile.cpp b/src/tools/bnfcompile.cpp index 16e75a5..011ec84 100644 --- a/src/tools/bnfcompile.cpp +++ b/src/tools/bnfcompile.cpp | |||
@@ -1,3 +1,10 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. | ||
3 | * | ||
4 | * This file is part of the libbu++ library and is released under the | ||
5 | * terms of the license contained in the file LICENSE. | ||
6 | */ | ||
7 | |||
1 | #include <bu/sio.h> | 8 | #include <bu/sio.h> |
2 | #include <bu/lexer.h> | 9 | #include <bu/lexer.h> |
3 | #include <bu/parser.h> | 10 | #include <bu/parser.h> |
@@ -123,7 +130,7 @@ public: | |||
123 | } | 130 | } |
124 | } | 131 | } |
125 | 132 | ||
126 | virtual FString tokenToString( const Token &t ) | 133 | virtual String tokenToString( const Token &t ) |
127 | { | 134 | { |
128 | switch( (TokenType)t.iToken ) | 135 | switch( (TokenType)t.iToken ) |
129 | { | 136 | { |
@@ -146,7 +153,7 @@ public: | |||
146 | private: | 153 | private: |
147 | Stream &rSrc; | 154 | Stream &rSrc; |
148 | QueueBuf qbIn; | 155 | QueueBuf qbIn; |
149 | FString sBuf; | 156 | String sBuf; |
150 | }; | 157 | }; |
151 | 158 | ||
152 | class BnfParser | 159 | class BnfParser |
@@ -201,9 +208,9 @@ private: | |||
201 | next(); | 208 | next(); |
202 | if( pCur->iToken == tokIdentifier ) | 209 | if( pCur->iToken == tokIdentifier ) |
203 | { | 210 | { |
204 | hTokens.insert( pCur->vExtra.get<Bu::FString>(), ++iLastToken ); | 211 | hTokens.insert( pCur->vExtra.get<Bu::String>(), ++iLastToken ); |
205 | sio << "Added token[" << iLastToken << "]: " | 212 | sio << "Added token[" << iLastToken << "]: " |
206 | << pCur->vExtra.get<Bu::FString>() << sio.nl; | 213 | << pCur->vExtra.get<Bu::String>() << sio.nl; |
207 | } | 214 | } |
208 | else if( pCur->iToken == tokSemiColon ) | 215 | else if( pCur->iToken == tokSemiColon ) |
209 | break; | 216 | break; |
@@ -214,7 +221,7 @@ private: | |||
214 | 221 | ||
215 | void nonTerminal() | 222 | void nonTerminal() |
216 | { | 223 | { |
217 | Bu::FString sNtName = pCur->vExtra.get<Bu::FString>(); | 224 | Bu::String sNtName = pCur->vExtra.get<Bu::String>(); |
218 | Parser::NonTerminal nt; | 225 | Parser::NonTerminal nt; |
219 | p.addNonTerminal( sNtName ); | 226 | p.addNonTerminal( sNtName ); |
220 | sio.incIndent(); | 227 | sio.incIndent(); |
@@ -258,8 +265,8 @@ private: | |||
258 | { | 265 | { |
259 | case tokIdentifier: | 266 | case tokIdentifier: |
260 | { | 267 | { |
261 | const Bu::FString &sName = | 268 | const Bu::String &sName = |
262 | pCur->vExtra.get<Bu::FString>(); | 269 | pCur->vExtra.get<Bu::String>(); |
263 | if( hTokens.has( sName ) ) | 270 | if( hTokens.has( sName ) ) |
264 | { | 271 | { |
265 | pr.append( | 272 | pr.append( |
@@ -292,8 +299,8 @@ private: | |||
292 | next(); | 299 | next(); |
293 | if( pCur->iToken != tokIdentifier ) | 300 | if( pCur->iToken != tokIdentifier ) |
294 | tokenError("tokIdentifier"); | 301 | tokenError("tokIdentifier"); |
295 | Bu::FString sName = | 302 | Bu::String sName = |
296 | pCur->vExtra.get<Bu::FString>(); | 303 | pCur->vExtra.get<Bu::String>(); |
297 | next(); | 304 | next(); |
298 | if( pCur->iToken != tokCloseSquare ) | 305 | if( pCur->iToken != tokCloseSquare ) |
299 | tokenError("tokCloseSquare"); | 306 | tokenError("tokCloseSquare"); |
@@ -317,8 +324,8 @@ private: | |||
317 | next(); | 324 | next(); |
318 | if( pCur->iToken != tokIdentifier ) | 325 | if( pCur->iToken != tokIdentifier ) |
319 | tokenError("tokIdentifier"); | 326 | tokenError("tokIdentifier"); |
320 | Bu::FString sName = | 327 | Bu::String sName = |
321 | pCur->vExtra.get<Bu::FString>(); | 328 | pCur->vExtra.get<Bu::String>(); |
322 | next(); | 329 | next(); |
323 | if( pCur->iToken != tokCloseCurly ) | 330 | if( pCur->iToken != tokCloseCurly ) |
324 | tokenError("tokCloseCurly"); | 331 | tokenError("tokCloseCurly"); |
@@ -366,14 +373,14 @@ private: | |||
366 | pCur = l.nextToken(); | 373 | pCur = l.nextToken(); |
367 | } | 374 | } |
368 | 375 | ||
369 | void tokenError( const FString &s ) | 376 | void tokenError( const String &s ) |
370 | { | 377 | { |
371 | throw ExceptionBase( ("Expected " + s + " but found " | 378 | throw ExceptionBase( ("Expected " + s + " but found " |
372 | + l.tokenToString( *pCur ) + ".").getStr() ); | 379 | + l.tokenToString( *pCur ) + ".").getStr() ); |
373 | } | 380 | } |
374 | 381 | ||
375 | private: | 382 | private: |
376 | typedef Bu::Hash<Bu::FString, int> TokenHash; | 383 | typedef Bu::Hash<Bu::String, int> TokenHash; |
377 | TokenHash hTokens; | 384 | TokenHash hTokens; |
378 | BnfLexer &l; | 385 | BnfLexer &l; |
379 | BnfLexer::Token *pCur; | 386 | BnfLexer::Token *pCur; |
diff --git a/src/tools/mkunit.cpp b/src/tools/mkunit.cpp index 12ce65f..741a888 100644 --- a/src/tools/mkunit.cpp +++ b/src/tools/mkunit.cpp | |||
@@ -1,3 +1,10 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. | ||
3 | * | ||
4 | * This file is part of the libbu++ library and is released under the | ||
5 | * terms of the license contained in the file LICENSE. | ||
6 | */ | ||
7 | |||
1 | #include <bu/file.h> | 8 | #include <bu/file.h> |
2 | #include <bu/optparser.h> | 9 | #include <bu/optparser.h> |
3 | #include <bu/buffer.h> | 10 | #include <bu/buffer.h> |
@@ -15,7 +22,7 @@ public: | |||
15 | { | 22 | { |
16 | } | 23 | } |
17 | 24 | ||
18 | Bu::FString sName; | 25 | Bu::String sName; |
19 | bool bExpectPass; | 26 | bool bExpectPass; |
20 | }; | 27 | }; |
21 | typedef Bu::List<Test> TestList; | 28 | typedef Bu::List<Test> TestList; |
@@ -23,7 +30,7 @@ typedef Bu::List<Test> TestList; | |||
23 | class Suite | 30 | class Suite |
24 | { | 31 | { |
25 | public: | 32 | public: |
26 | Bu::FString sName; | 33 | Bu::String sName; |
27 | TestList lTest; | 34 | TestList lTest; |
28 | }; | 35 | }; |
29 | //typedef Bu::List<Suite> SuiteList; | 36 | //typedef Bu::List<Suite> SuiteList; |
@@ -66,7 +73,7 @@ Bu::Formatter &operator<<( Bu::Formatter &f, const Suite &s ) | |||
66 | class Parser | 73 | class Parser |
67 | { | 74 | { |
68 | public: | 75 | public: |
69 | Parser( const Bu::FString &sFile ) : | 76 | Parser( const Bu::String &sFile ) : |
70 | sIn( sFile ), | 77 | sIn( sFile ), |
71 | fIn( sFile, File::Read ), | 78 | fIn( sFile, File::Read ), |
72 | bIn( fIn ), | 79 | bIn( fIn ), |
@@ -99,10 +106,10 @@ public: | |||
99 | return cBuf; | 106 | return cBuf; |
100 | } | 107 | } |
101 | 108 | ||
102 | TokType nextToken( Variant &v, Bu::FString &sWsOut, int &iLineStart, | 109 | TokType nextToken( Variant &v, Bu::String &sWsOut, int &iLineStart, |
103 | int &iCharStart ) | 110 | int &iCharStart ) |
104 | { | 111 | { |
105 | Bu::FString sTok, sWs; | 112 | Bu::String sTok, sWs; |
106 | 113 | ||
107 | char buf; | 114 | char buf; |
108 | try | 115 | try |
@@ -307,7 +314,7 @@ public: | |||
307 | void firstPass() | 314 | void firstPass() |
308 | { | 315 | { |
309 | Variant v; | 316 | Variant v; |
310 | Bu::FString sWs; | 317 | Bu::String sWs; |
311 | int iL, iC; | 318 | int iL, iC; |
312 | for(;;) | 319 | for(;;) |
313 | { | 320 | { |
@@ -322,7 +329,7 @@ public: | |||
322 | if( nextToken( v, sWs, iL, iC ) != tokFluff ) | 329 | if( nextToken( v, sWs, iL, iC ) != tokFluff ) |
323 | throw Bu::ExceptionBase("%d:%d: Expected string " | 330 | throw Bu::ExceptionBase("%d:%d: Expected string " |
324 | "following suite.", iL, iC ); | 331 | "following suite.", iL, iC ); |
325 | s.sName = v.get<Bu::FString>(); | 332 | s.sName = v.get<Bu::String>(); |
326 | if( nextToken( v, sWs, iL, iC ) != tokChar || | 333 | if( nextToken( v, sWs, iL, iC ) != tokChar || |
327 | v.get<char>() != '{' ) | 334 | v.get<char>() != '{' ) |
328 | throw Bu::ExceptionBase("%d:%d: Expected {, got " | 335 | throw Bu::ExceptionBase("%d:%d: Expected {, got " |
@@ -346,7 +353,7 @@ public: | |||
346 | throw Bu::ExceptionBase("%d:%d: Expected " | 353 | throw Bu::ExceptionBase("%d:%d: Expected " |
347 | "string following test.", iL, iC ); | 354 | "string following test.", iL, iC ); |
348 | Test t; | 355 | Test t; |
349 | t.sName = v.get<Bu::FString>(); | 356 | t.sName = v.get<Bu::String>(); |
350 | if( nextToken( v, sWs, iL, iC ) != tokBlock ) | 357 | if( nextToken( v, sWs, iL, iC ) != tokBlock ) |
351 | throw Bu::ExceptionBase("%d:%d: Expected " | 358 | throw Bu::ExceptionBase("%d:%d: Expected " |
352 | "{...} block.", | 359 | "{...} block.", |
@@ -380,7 +387,7 @@ public: | |||
380 | } | 387 | } |
381 | } | 388 | } |
382 | 389 | ||
383 | void secondPass( const Bu::FString &sOut ) | 390 | void secondPass( const Bu::String &sOut ) |
384 | { | 391 | { |
385 | File fOut( sOut, File::WriteNew ); | 392 | File fOut( sOut, File::WriteNew ); |
386 | Formatter f( fOut ); | 393 | Formatter f( fOut ); |
@@ -393,7 +400,7 @@ public: | |||
393 | iChar = 0; | 400 | iChar = 0; |
394 | bool bHasIncluded = false; | 401 | bool bHasIncluded = false; |
395 | 402 | ||
396 | Bu::FString sWs; | 403 | Bu::String sWs; |
397 | Variant v; | 404 | Variant v; |
398 | int iL, iC; | 405 | int iL, iC; |
399 | for(;;) | 406 | for(;;) |
@@ -408,7 +415,7 @@ public: | |||
408 | if( nextToken( v, sWs, iL, iC ) != tokFluff ) | 415 | if( nextToken( v, sWs, iL, iC ) != tokFluff ) |
409 | throw Bu::ExceptionBase("%d:%d: Expected string " | 416 | throw Bu::ExceptionBase("%d:%d: Expected string " |
410 | "following suite.", iL, iC ); | 417 | "following suite.", iL, iC ); |
411 | s.sName = v.get<Bu::FString>(); | 418 | s.sName = v.get<Bu::String>(); |
412 | if( nextToken( v, sWs, iL, iC ) != tokChar || | 419 | if( nextToken( v, sWs, iL, iC ) != tokChar || |
413 | v.get<char>() != '{' ) | 420 | v.get<char>() != '{' ) |
414 | throw Bu::ExceptionBase("%d:%d: Expected {", | 421 | throw Bu::ExceptionBase("%d:%d: Expected {", |
@@ -421,7 +428,7 @@ public: | |||
421 | bHasIncluded = true; | 428 | bHasIncluded = true; |
422 | } | 429 | } |
423 | 430 | ||
424 | Bu::FString sClass = "_UnitSuite_" + s.sName; | 431 | Bu::String sClass = "_UnitSuite_" + s.sName; |
425 | f << "class " << sClass | 432 | f << "class " << sClass |
426 | << " : public Bu::UnitSuite" << f.nl | 433 | << " : public Bu::UnitSuite" << f.nl |
427 | << "{" << f.nl << "public:" << f.nl | 434 | << "{" << f.nl << "public:" << f.nl |
@@ -441,7 +448,7 @@ public: | |||
441 | } | 448 | } |
442 | else if( t == tokEof ) | 449 | else if( t == tokEof ) |
443 | { | 450 | { |
444 | Bu::FString sClass = "_UnitSuite_" + s.sName; | 451 | Bu::String sClass = "_UnitSuite_" + s.sName; |
445 | f << sWs << f.nl << "int main( int argc, char *argv[] )" | 452 | f << sWs << f.nl << "int main( int argc, char *argv[] )" |
446 | << f.nl << "{" << f.nl << "\treturn " << sClass | 453 | << f.nl << "{" << f.nl << "\treturn " << sClass |
447 | << "().run( argc, argv );" << f.nl << "}" << f.nl; | 454 | << "().run( argc, argv );" << f.nl << "}" << f.nl; |
@@ -458,7 +465,7 @@ public: | |||
458 | { | 465 | { |
459 | case tokFluff: | 466 | case tokFluff: |
460 | fOut.write( sWs ); | 467 | fOut.write( sWs ); |
461 | fOut.write( v.get<Bu::FString>() ); | 468 | fOut.write( v.get<Bu::String>() ); |
462 | break; | 469 | break; |
463 | 470 | ||
464 | case tokTest: | 471 | case tokTest: |
@@ -468,7 +475,7 @@ public: | |||
468 | throw Bu::ExceptionBase("%d:%d: Expected " | 475 | throw Bu::ExceptionBase("%d:%d: Expected " |
469 | "string following test.", iL, iC ); | 476 | "string following test.", iL, iC ); |
470 | Test t; | 477 | Test t; |
471 | t.sName = v.get<Bu::FString>(); | 478 | t.sName = v.get<Bu::String>(); |
472 | if( nextToken( v, sWs, iL, iC ) != tokBlock ) | 479 | if( nextToken( v, sWs, iL, iC ) != tokBlock ) |
473 | throw Bu::ExceptionBase("%d:%d: Expected " | 480 | throw Bu::ExceptionBase("%d:%d: Expected " |
474 | "{...} block.", | 481 | "{...} block.", |
@@ -499,7 +506,7 @@ public: | |||
499 | fOut.write( sWs ); | 506 | fOut.write( sWs ); |
500 | f << f.nl << "#line " << iL << " \"" << sIn | 507 | f << f.nl << "#line " << iL << " \"" << sIn |
501 | << "\"" << f.nl; | 508 | << "\"" << f.nl; |
502 | fOut.write( v.get<Bu::FString>() ); | 509 | fOut.write( v.get<Bu::String>() ); |
503 | 510 | ||
504 | break; | 511 | break; |
505 | 512 | ||
@@ -521,7 +528,7 @@ public: | |||
521 | } | 528 | } |
522 | 529 | ||
523 | private: | 530 | private: |
524 | Bu::FString sIn; | 531 | Bu::String sIn; |
525 | File fIn; | 532 | File fIn; |
526 | Buffer bIn; | 533 | Buffer bIn; |
527 | char cBuf; | 534 | char cBuf; |
diff --git a/src/tools/myriad.cpp b/src/tools/myriad.cpp index b6e435d..7d4df75 100644 --- a/src/tools/myriad.cpp +++ b/src/tools/myriad.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -75,9 +75,9 @@ public: | |||
75 | int iBlockSize; | 75 | int iBlockSize; |
76 | int iPreallocate; | 76 | int iPreallocate; |
77 | int iStream; | 77 | int iStream; |
78 | Bu::FString sFile; | 78 | Bu::String sFile; |
79 | Bu::FString sSrc; | 79 | Bu::String sSrc; |
80 | Bu::FString sDst; | 80 | Bu::String sDst; |
81 | }; | 81 | }; |
82 | 82 | ||
83 | Bu::Formatter &operator>>( Bu::Formatter &f, Mode &e ) | 83 | Bu::Formatter &operator>>( Bu::Formatter &f, Mode &e ) |
diff --git a/src/tools/myriadfs.cpp b/src/tools/myriadfs.cpp index 66955a5..88db0c0 100644 --- a/src/tools/myriadfs.cpp +++ b/src/tools/myriadfs.cpp | |||
@@ -1,3 +1,10 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. | ||
3 | * | ||
4 | * This file is part of the libbu++ library and is released under the | ||
5 | * terms of the license contained in the file LICENSE. | ||
6 | */ | ||
7 | |||
1 | #define FUSE_USE_VERSION 26 | 8 | #define FUSE_USE_VERSION 26 |
2 | 9 | ||
3 | #include <fuse.h> | 10 | #include <fuse.h> |
diff --git a/src/tools/parser.cpp b/src/tools/parser.cpp index 7933f31..aa9e3e4 100644 --- a/src/tools/parser.cpp +++ b/src/tools/parser.cpp | |||
@@ -1,3 +1,10 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. | ||
3 | * | ||
4 | * This file is part of the libbu++ library and is released under the | ||
5 | * terms of the license contained in the file LICENSE. | ||
6 | */ | ||
7 | |||
1 | #include <bu/parser.h> | 8 | #include <bu/parser.h> |
2 | #include <bu/lexer.h> | 9 | #include <bu/lexer.h> |
3 | #include <bu/file.h> | 10 | #include <bu/file.h> |
@@ -118,7 +125,7 @@ public: | |||
118 | case '8': | 125 | case '8': |
119 | case '9': | 126 | case '9': |
120 | { | 127 | { |
121 | Bu::FString sTmp; | 128 | Bu::String sTmp; |
122 | sTmp += b; | 129 | sTmp += b; |
123 | qbIn.seek( 1 ); | 130 | qbIn.seek( 1 ); |
124 | for(;;) | 131 | for(;;) |
diff --git a/src/tools/viewcsv.cpp b/src/tools/viewcsv.cpp index d81525e..6997b9b 100644 --- a/src/tools/viewcsv.cpp +++ b/src/tools/viewcsv.cpp | |||
@@ -1,3 +1,10 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. | ||
3 | * | ||
4 | * This file is part of the libbu++ library and is released under the | ||
5 | * terms of the license contained in the file LICENSE. | ||
6 | */ | ||
7 | |||
1 | #include <bu/sio.h> | 8 | #include <bu/sio.h> |
2 | #include <bu/optparser.h> | 9 | #include <bu/optparser.h> |
3 | #include <bu/csvreader.h> | 10 | #include <bu/csvreader.h> |
@@ -38,7 +45,7 @@ public: | |||
38 | return 0; | 45 | return 0; |
39 | } | 46 | } |
40 | 47 | ||
41 | Bu::FString sFileIn; | 48 | Bu::String sFileIn; |
42 | bool bHeader; | 49 | bool bHeader; |
43 | }; | 50 | }; |
44 | 51 | ||
@@ -245,10 +252,10 @@ public: | |||
245 | setHeaderRow( !bHeaderRow ); | 252 | setHeaderRow( !bHeaderRow ); |
246 | } | 253 | } |
247 | 254 | ||
248 | Bu::FString prompt( const Bu::FString &sPrompt ) | 255 | Bu::String prompt( const Bu::String &sPrompt ) |
249 | { | 256 | { |
250 | int maxx, maxy; | 257 | int maxx, maxy; |
251 | Bu::FString sStr; | 258 | Bu::String sStr; |
252 | 259 | ||
253 | RegEx re( sPrompt ); | 260 | RegEx re( sPrompt ); |
254 | 261 | ||
@@ -292,7 +299,7 @@ public: | |||
292 | sysCaret.reset(); | 299 | sysCaret.reset(); |
293 | } | 300 | } |
294 | 301 | ||
295 | void findNext( const Bu::FString &sTerm ) | 302 | void findNext( const Bu::String &sTerm ) |
296 | { | 303 | { |
297 | RegEx re( sTerm ); | 304 | RegEx re( sTerm ); |
298 | 305 | ||
@@ -398,7 +405,7 @@ int main( int argc, char *argv[] ) | |||
398 | CsvView view( doc ); | 405 | CsvView view( doc ); |
399 | view.setHeaderRow( opt.bHeader ); | 406 | view.setHeaderRow( opt.bHeader ); |
400 | 407 | ||
401 | Bu::FString sSearchTerm; | 408 | Bu::String sSearchTerm; |
402 | 409 | ||
403 | bool bRun = true; | 410 | bool bRun = true; |
404 | do | 411 | do |
diff --git a/src/trace.cpp b/src/trace.cpp index bd06683..906ce54 100644 --- a/src/trace.cpp +++ b/src/trace.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/trace.h b/src/trace.h index 9d5ac80..0ebd831 100644 --- a/src/trace.h +++ b/src/trace.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/udpsocket.cpp b/src/udpsocket.cpp index da57b8d..91e04c1 100644 --- a/src/udpsocket.cpp +++ b/src/udpsocket.cpp | |||
@@ -1,3 +1,10 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. | ||
3 | * | ||
4 | * This file is part of the libbu++ library and is released under the | ||
5 | * terms of the license contained in the file LICENSE. | ||
6 | */ | ||
7 | |||
1 | #include "bu/udpsocket.h" | 8 | #include "bu/udpsocket.h" |
2 | 9 | ||
3 | #include "bu/sio.h" | 10 | #include "bu/sio.h" |
@@ -21,7 +28,7 @@ Bu::UdpSocket::UdpSocket( int iUdpSocket ) : | |||
21 | { | 28 | { |
22 | } | 29 | } |
23 | 30 | ||
24 | Bu::UdpSocket::UdpSocket( const Bu::FString &sAddr, int iPort, int iFlags ) : | 31 | Bu::UdpSocket::UdpSocket( const Bu::String &sAddr, int iPort, int iFlags ) : |
25 | iUdpSocket( 0 ), | 32 | iUdpSocket( 0 ), |
26 | paTarget( NULL ), | 33 | paTarget( NULL ), |
27 | bBound( false ) | 34 | bBound( false ) |
@@ -72,9 +79,9 @@ Bu::UdpSocket::~UdpSocket() | |||
72 | paTarget = NULL; | 79 | paTarget = NULL; |
73 | } | 80 | } |
74 | 81 | ||
75 | Bu::FString Bu::UdpSocket::addrToStr( const addr &a ) | 82 | Bu::String Bu::UdpSocket::addrToStr( const addr &a ) |
76 | { | 83 | { |
77 | Bu::FString sOut; | 84 | Bu::String sOut; |
78 | sOut.format("%d.%d.%d.%d", | 85 | sOut.format("%d.%d.%d.%d", |
79 | (a&0xff), | 86 | (a&0xff), |
80 | (a&0xff00)>>8, | 87 | (a&0xff00)>>8, |
@@ -90,24 +97,24 @@ void Bu::UdpSocket::close() | |||
90 | ::close( iUdpSocket ); | 97 | ::close( iUdpSocket ); |
91 | } | 98 | } |
92 | 99 | ||
93 | size_t Bu::UdpSocket::read( void *pBuf, size_t nBytes ) | 100 | Bu::size Bu::UdpSocket::read( void *pBuf, Bu::size nBytes ) |
94 | { | 101 | { |
95 | return recv( iUdpSocket, pBuf, nBytes, 0 ); | 102 | return recv( iUdpSocket, pBuf, nBytes, 0 ); |
96 | } | 103 | } |
97 | 104 | ||
98 | size_t Bu::UdpSocket::read( void *pBuf, size_t nBytes, | 105 | Bu::size Bu::UdpSocket::read( void *pBuf, Bu::size nBytes, |
99 | Bu::UdpSocket::addr &aHost, int &iPort ) | 106 | Bu::UdpSocket::addr &aHost, int &iPort ) |
100 | { | 107 | { |
101 | sockaddr_in name; | 108 | sockaddr_in name; |
102 | size_t size = sizeof(name); | 109 | size_t size = sizeof(name); |
103 | size_t ret = recvfrom( iUdpSocket, pBuf, nBytes, 0, | 110 | Bu::size ret = recvfrom( iUdpSocket, pBuf, nBytes, 0, |
104 | (struct sockaddr *)&name, &size ); | 111 | (struct sockaddr *)&name, &size ); |
105 | aHost = name.sin_addr.s_addr; | 112 | aHost = name.sin_addr.s_addr; |
106 | iPort = ntohs(name.sin_port); | 113 | iPort = ntohs(name.sin_port); |
107 | return ret; | 114 | return ret; |
108 | } | 115 | } |
109 | 116 | ||
110 | size_t Bu::UdpSocket::write( const void *pBuf, size_t nBytes ) | 117 | Bu::size Bu::UdpSocket::write( const void *pBuf, Bu::size nBytes ) |
111 | { | 118 | { |
112 | if( bBound ) | 119 | if( bBound ) |
113 | { | 120 | { |
@@ -120,22 +127,22 @@ size_t Bu::UdpSocket::write( const void *pBuf, size_t nBytes ) | |||
120 | } | 127 | } |
121 | } | 128 | } |
122 | 129 | ||
123 | long Bu::UdpSocket::tell() | 130 | Bu::size Bu::UdpSocket::tell() |
124 | { | 131 | { |
125 | throw Bu::UnsupportedException(); | 132 | throw Bu::UnsupportedException(); |
126 | } | 133 | } |
127 | 134 | ||
128 | void Bu::UdpSocket::seek( long ) | 135 | void Bu::UdpSocket::seek( Bu::size ) |
129 | { | 136 | { |
130 | throw Bu::UnsupportedException(); | 137 | throw Bu::UnsupportedException(); |
131 | } | 138 | } |
132 | 139 | ||
133 | void Bu::UdpSocket::setPos( long ) | 140 | void Bu::UdpSocket::setPos( Bu::size ) |
134 | { | 141 | { |
135 | throw Bu::UnsupportedException(); | 142 | throw Bu::UnsupportedException(); |
136 | } | 143 | } |
137 | 144 | ||
138 | void Bu::UdpSocket::setPosEnd( long ) | 145 | void Bu::UdpSocket::setPosEnd( Bu::size ) |
139 | { | 146 | { |
140 | throw Bu::UnsupportedException(); | 147 | throw Bu::UnsupportedException(); |
141 | } | 148 | } |
@@ -211,7 +218,22 @@ void Bu::UdpSocket::setBlocking( bool bBlocking ) | |||
211 | #endif | 218 | #endif |
212 | } | 219 | } |
213 | 220 | ||
214 | void Bu::UdpSocket::setSize( long ) | 221 | void Bu::UdpSocket::setSize( Bu::size ) |
222 | { | ||
223 | throw Bu::UnsupportedException(); | ||
224 | } | ||
225 | |||
226 | Bu::size Bu::UdpSocket::getSize() const | ||
227 | { | ||
228 | throw Bu::UnsupportedException(); | ||
229 | } | ||
230 | |||
231 | Bu::size Bu::UdpSocket::getBlockSize() const | ||
232 | { | ||
233 | return 1500; | ||
234 | } | ||
235 | |||
236 | Bu::String Bu::UdpSocket::getLocation() const | ||
215 | { | 237 | { |
216 | throw Bu::UnsupportedException(); | 238 | throw Bu::UnsupportedException(); |
217 | } | 239 | } |
diff --git a/src/udpsocket.h b/src/udpsocket.h index 253839a..8fe114d 100644 --- a/src/udpsocket.h +++ b/src/udpsocket.h | |||
@@ -1,3 +1,10 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. | ||
3 | * | ||
4 | * This file is part of the libbu++ library and is released under the | ||
5 | * terms of the license contained in the file LICENSE. | ||
6 | */ | ||
7 | |||
1 | #ifndef BU_UDP_SOCKET_H | 8 | #ifndef BU_UDP_SOCKET_H |
2 | #define BU_UDP_SOCKET_H | 9 | #define BU_UDP_SOCKET_H |
3 | 10 | ||
@@ -13,24 +20,24 @@ namespace Bu | |||
13 | { | 20 | { |
14 | public: | 21 | public: |
15 | UdpSocket( int iUdpSocket ); | 22 | UdpSocket( int iUdpSocket ); |
16 | UdpSocket( const Bu::FString &sAddr, int iPort, int iFlags ); | 23 | UdpSocket( const Bu::String &sAddr, int iPort, int iFlags ); |
17 | virtual ~UdpSocket(); | 24 | virtual ~UdpSocket(); |
18 | 25 | ||
19 | typedef uint32_t addr; | 26 | typedef uint32_t addr; |
20 | 27 | ||
21 | static Bu::FString addrToStr( const addr &a ); | 28 | static Bu::String addrToStr( const addr &a ); |
22 | 29 | ||
23 | virtual void close(); | 30 | virtual void close(); |
24 | virtual size_t read( void *pBuf, size_t nBytes ); | 31 | virtual Bu::size read( void *pBuf, Bu::size nBytes ); |
25 | virtual size_t read( void *pBuf, size_t nBytes, | 32 | virtual Bu::size read( void *pBuf, Bu::size nBytes, |
26 | addr &sHost, int &iPort ); | 33 | addr &sHost, int &iPort ); |
27 | virtual size_t write( const void *pBuf, size_t nBytes ); | 34 | virtual Bu::size write( const void *pBuf, Bu::size nBytes ); |
28 | using Stream::write; | 35 | using Stream::write; |
29 | 36 | ||
30 | virtual long tell(); | 37 | virtual Bu::size tell(); |
31 | virtual void seek( long offset ); | 38 | virtual void seek( Bu::size offset ); |
32 | virtual void setPos( long pos ); | 39 | virtual void setPos( Bu::size pos ); |
33 | virtual void setPosEnd( long pos ); | 40 | virtual void setPosEnd( Bu::size pos ); |
34 | virtual bool isEos(); | 41 | virtual bool isEos(); |
35 | virtual bool isOpen(); | 42 | virtual bool isOpen(); |
36 | 43 | ||
@@ -46,7 +53,7 @@ namespace Bu | |||
46 | virtual bool isBlocking(); | 53 | virtual bool isBlocking(); |
47 | virtual void setBlocking( bool bBlocking=true ); | 54 | virtual void setBlocking( bool bBlocking=true ); |
48 | 55 | ||
49 | virtual void setSize( long iSize ); | 56 | virtual void setSize( Bu::size iSize ); |
50 | 57 | ||
51 | enum { | 58 | enum { |
52 | // Flags | 59 | // Flags |
@@ -56,6 +63,9 @@ namespace Bu | |||
56 | Broadcast = 0x04, ///< Open for broadcast | 63 | Broadcast = 0x04, ///< Open for broadcast |
57 | }; | 64 | }; |
58 | 65 | ||
66 | virtual size getSize() const; | ||
67 | virtual size getBlockSize() const; | ||
68 | virtual Bu::String getLocation() const; | ||
59 | 69 | ||
60 | private: | 70 | private: |
61 | #ifdef WIN32 | 71 | #ifdef WIN32 |
diff --git a/src/unit/archive.unit b/src/unit/archive.unit index a7f2640..89fde0c 100644 --- a/src/unit/archive.unit +++ b/src/unit/archive.unit | |||
@@ -1,6 +1,6 @@ | |||
1 | // vim: syntax=cpp | 1 | // vim: syntax=cpp |
2 | /* | 2 | /* |
3 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 3 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
4 | * | 4 | * |
5 | * This file is part of the libbu++ library and is released under the | 5 | * This file is part of the libbu++ library and is released under the |
6 | * terms of the license contained in the file LICENSE. | 6 | * terms of the license contained in the file LICENSE. |
@@ -105,7 +105,7 @@ suite Archive | |||
105 | MemBuf mb; | 105 | MemBuf mb; |
106 | { | 106 | { |
107 | Archive ar( mb, Archive::save ); | 107 | Archive ar( mb, Archive::save ); |
108 | FString sStr("This is a test string."); | 108 | String sStr("This is a test string."); |
109 | List<int> lList; | 109 | List<int> lList; |
110 | lList.append( 10 ); | 110 | lList.append( 10 ); |
111 | lList.append( 20 ); | 111 | lList.append( 20 ); |
@@ -118,7 +118,7 @@ suite Archive | |||
118 | mb.setPos( 0 ); | 118 | mb.setPos( 0 ); |
119 | { | 119 | { |
120 | Archive ar( mb, Archive::load ); | 120 | Archive ar( mb, Archive::load ); |
121 | FString sStr; | 121 | String sStr; |
122 | List<int> lList; | 122 | List<int> lList; |
123 | ar >> sStr; | 123 | ar >> sStr; |
124 | ar >> lList; | 124 | ar >> lList; |
@@ -138,7 +138,7 @@ suite Archive | |||
138 | MemBuf mb; | 138 | MemBuf mb; |
139 | { | 139 | { |
140 | Archive ar( mb, Archive::save ); | 140 | Archive ar( mb, Archive::save ); |
141 | FString sStr("This is a test string."); | 141 | String sStr("This is a test string."); |
142 | Array<int> lArray; | 142 | Array<int> lArray; |
143 | lArray.append( 10 ); | 143 | lArray.append( 10 ); |
144 | lArray.append( 20 ); | 144 | lArray.append( 20 ); |
@@ -151,7 +151,7 @@ suite Archive | |||
151 | mb.setPos( 0 ); | 151 | mb.setPos( 0 ); |
152 | { | 152 | { |
153 | Archive ar( mb, Archive::load ); | 153 | Archive ar( mb, Archive::load ); |
154 | FString sStr; | 154 | String sStr; |
155 | Array<int> lArray; | 155 | Array<int> lArray; |
156 | ar >> sStr; | 156 | ar >> sStr; |
157 | ar >> lArray; | 157 | ar >> lArray; |
@@ -171,7 +171,7 @@ suite Archive | |||
171 | MemBuf mb; | 171 | MemBuf mb; |
172 | { | 172 | { |
173 | Archive ar( mb, Archive::save ); | 173 | Archive ar( mb, Archive::save ); |
174 | Array<FString> lArray; | 174 | Array<String> lArray; |
175 | lArray.append( "10" ); | 175 | lArray.append( "10" ); |
176 | lArray.append( "20" ); | 176 | lArray.append( "20" ); |
177 | lArray.append( "30" ); | 177 | lArray.append( "30" ); |
@@ -182,10 +182,10 @@ suite Archive | |||
182 | mb.setPos( 0 ); | 182 | mb.setPos( 0 ); |
183 | { | 183 | { |
184 | Archive ar( mb, Archive::load ); | 184 | Archive ar( mb, Archive::load ); |
185 | Array<FString> lArray; | 185 | Array<String> lArray; |
186 | ar >> lArray; | 186 | ar >> lArray; |
187 | unitTest( lArray.getSize() == 4 ); | 187 | unitTest( lArray.getSize() == 4 ); |
188 | Array<FString>::iterator i = lArray.begin(); | 188 | Array<String>::iterator i = lArray.begin(); |
189 | unitTest( *i == "10" ); i++; | 189 | unitTest( *i == "10" ); i++; |
190 | unitTest( *i == "20" ); i++; | 190 | unitTest( *i == "20" ); i++; |
191 | unitTest( *i == "30" ); i++; | 191 | unitTest( *i == "30" ); i++; |
diff --git a/src/unit/array.unit b/src/unit/array.unit index f3fdeda..f6e6718 100644 --- a/src/unit/array.unit +++ b/src/unit/array.unit | |||
@@ -1,6 +1,6 @@ | |||
1 | // vim: syntax=cpp | 1 | // vim: syntax=cpp |
2 | /* | 2 | /* |
3 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 3 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
4 | * | 4 | * |
5 | * This file is part of the libbu++ library and is released under the | 5 | * This file is part of the libbu++ library and is released under the |
6 | * terms of the license contained in the file LICENSE. | 6 | * terms of the license contained in the file LICENSE. |
@@ -55,7 +55,7 @@ suite Array | |||
55 | 55 | ||
56 | test copy | 56 | test copy |
57 | { | 57 | { |
58 | typedef Bu::Hash<Bu::FString, Bu::FString> StrHash; | 58 | typedef Bu::Hash<Bu::String, Bu::String> StrHash; |
59 | typedef Bu::Array<StrHash> StrHashArray; | 59 | typedef Bu::Array<StrHash> StrHashArray; |
60 | 60 | ||
61 | StrHash h1; | 61 | StrHash h1; |
diff --git a/src/unit/buffer.unit b/src/unit/buffer.unit index 8ed1ec5..8106e4e 100644 --- a/src/unit/buffer.unit +++ b/src/unit/buffer.unit | |||
@@ -1,6 +1,6 @@ | |||
1 | // vim: syntax=cpp | 1 | // vim: syntax=cpp |
2 | /* | 2 | /* |
3 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 3 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
4 | * | 4 | * |
5 | * This file is part of the libbu++ library and is released under the | 5 | * This file is part of the libbu++ library and is released under the |
6 | * terms of the license contained in the file LICENSE. | 6 | * terms of the license contained in the file LICENSE. |
@@ -14,12 +14,12 @@ suite Buffer | |||
14 | { | 14 | { |
15 | test emptyFile | 15 | test emptyFile |
16 | { | 16 | { |
17 | Bu::FString sTmp("empty-XXXXXX"); | 17 | Bu::String sTmp("empty-XXXXXX"); |
18 | Bu::File fEmpty = tempFile(sTmp); | 18 | Bu::File fEmpty = tempFile(sTmp); |
19 | Bu::Buffer buf( fEmpty ); | 19 | Bu::Buffer buf( fEmpty ); |
20 | 20 | ||
21 | unitTest( buf.isEos() == false ); | 21 | unitTest( buf.isEos() == false ); |
22 | Bu::FString sLine = buf.readLine(); | 22 | Bu::String sLine = buf.readLine(); |
23 | unitTest( sLine == "" ); | 23 | unitTest( sLine == "" ); |
24 | unitTest( fEmpty.isEos() == true ); | 24 | unitTest( fEmpty.isEos() == true ); |
25 | unitTest( buf.isEos() == true ); | 25 | unitTest( buf.isEos() == true ); |
diff --git a/src/unit/entities/unit b/src/unit/entities/unit index 6876c54..4c5a835 100644 --- a/src/unit/entities/unit +++ b/src/unit/entities/unit | |||
@@ -5,7 +5,7 @@ | |||
5 | name="source" | 5 | name="source" |
6 | filename="{=name:%tolower}.cpp" | 6 | filename="{=name:%tolower}.cpp" |
7 | >/* | 7 | >/* |
8 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 8 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
9 | * | 9 | * |
10 | * This file is part of the libbu++ library and is released under the | 10 | * This file is part of the libbu++ library and is released under the |
11 | * terms of the license contained in the file LICENSE. | 11 | * terms of the license contained in the file LICENSE. |
diff --git a/src/unit/file.unit b/src/unit/file.unit index f8cf7c1..fb04e57 100644 --- a/src/unit/file.unit +++ b/src/unit/file.unit | |||
@@ -1,6 +1,6 @@ | |||
1 | // vim: syntax=cpp | 1 | // vim: syntax=cpp |
2 | /* | 2 | /* |
3 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 3 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
4 | * | 4 | * |
5 | * This file is part of the libbu++ library and is released under the | 5 | * This file is part of the libbu++ library and is released under the |
6 | * terms of the license contained in the file LICENSE. | 6 | * terms of the license contained in the file LICENSE. |
diff --git a/src/unit/hash.unit b/src/unit/hash.unit index 124b074..64e70b6 100644 --- a/src/unit/hash.unit +++ b/src/unit/hash.unit | |||
@@ -1,19 +1,19 @@ | |||
1 | // vim: syntax=cpp | 1 | // vim: syntax=cpp |
2 | /* | 2 | /* |
3 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 3 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
4 | * | 4 | * |
5 | * This file is part of the libbu++ library and is released under the | 5 | * This file is part of the libbu++ library and is released under the |
6 | * terms of the license contained in the file LICENSE. | 6 | * terms of the license contained in the file LICENSE. |
7 | */ | 7 | */ |
8 | 8 | ||
9 | #include "bu/fstring.h" | 9 | #include "bu/string.h" |
10 | #include "bu/hash.h" | 10 | #include "bu/hash.h" |
11 | 11 | ||
12 | #include <stdio.h> | 12 | #include <stdio.h> |
13 | 13 | ||
14 | typedef Bu::Hash<Bu::FString, int> StrIntHash; | 14 | typedef Bu::Hash<Bu::String, int> StrIntHash; |
15 | typedef Bu::Hash<Bu::FString, Bu::FString> StrStrHash; | 15 | typedef Bu::Hash<Bu::String, Bu::String> StrStrHash; |
16 | typedef Bu::Hash<int, Bu::FString> IntStrHash; | 16 | typedef Bu::Hash<int, Bu::String> IntStrHash; |
17 | 17 | ||
18 | suite Hash | 18 | suite Hash |
19 | { | 19 | { |
@@ -24,7 +24,7 @@ suite Hash | |||
24 | for(int i=1;i<10000;i++) | 24 | for(int i=1;i<10000;i++) |
25 | { | 25 | { |
26 | sprintf(buf,"%d",i); | 26 | sprintf(buf,"%d",i); |
27 | Bu::FString sTmp(buf); | 27 | Bu::String sTmp(buf); |
28 | h[sTmp] = i; | 28 | h[sTmp] = i; |
29 | unitTest( h.has(sTmp) ); | 29 | unitTest( h.has(sTmp) ); |
30 | } | 30 | } |
diff --git a/src/unit/list.unit b/src/unit/list.unit index 66e45b2..2b315dc 100644 --- a/src/unit/list.unit +++ b/src/unit/list.unit | |||
@@ -1,12 +1,12 @@ | |||
1 | // vim: syntax=cpp | 1 | // vim: syntax=cpp |
2 | /* | 2 | /* |
3 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 3 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
4 | * | 4 | * |
5 | * This file is part of the libbu++ library and is released under the | 5 | * This file is part of the libbu++ library and is released under the |
6 | * terms of the license contained in the file LICENSE. | 6 | * terms of the license contained in the file LICENSE. |
7 | */ | 7 | */ |
8 | 8 | ||
9 | #include "bu/fstring.h" | 9 | #include "bu/string.h" |
10 | #include "bu/list.h" | 10 | #include "bu/list.h" |
11 | 11 | ||
12 | typedef Bu::List<int> IntList; | 12 | typedef Bu::List<int> IntList; |
diff --git a/src/unit/membuf.unit b/src/unit/membuf.unit index 1da3b90..aefc2c1 100644 --- a/src/unit/membuf.unit +++ b/src/unit/membuf.unit | |||
@@ -1,6 +1,6 @@ | |||
1 | // vim: syntax=cpp | 1 | // vim: syntax=cpp |
2 | /* | 2 | /* |
3 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 3 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
4 | * | 4 | * |
5 | * This file is part of the libbu++ library and is released under the | 5 | * This file is part of the libbu++ library and is released under the |
6 | * terms of the license contained in the file LICENSE. | 6 | * terms of the license contained in the file LICENSE. |
diff --git a/src/unit/myriad.unit b/src/unit/myriad.unit index ad8fb5d..e0f7ef4 100644 --- a/src/unit/myriad.unit +++ b/src/unit/myriad.unit | |||
@@ -1,12 +1,12 @@ | |||
1 | // vim: syntax=cpp | 1 | // vim: syntax=cpp |
2 | /* | 2 | /* |
3 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 3 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
4 | * | 4 | * |
5 | * This file is part of the libbu++ library and is released under the | 5 | * This file is part of the libbu++ library and is released under the |
6 | * terms of the license contained in the file LICENSE. | 6 | * terms of the license contained in the file LICENSE. |
7 | */ | 7 | */ |
8 | 8 | ||
9 | #include "bu/fstring.h" | 9 | #include "bu/string.h" |
10 | #include "bu/file.h" | 10 | #include "bu/file.h" |
11 | #include "bu/myriad.h" | 11 | #include "bu/myriad.h" |
12 | #include "bu/myriadstream.h" | 12 | #include "bu/myriadstream.h" |
@@ -56,7 +56,7 @@ Bu::ArchiveBase &operator<<( Bu::ArchiveBase &ar, const VerifyObject &vo ) | |||
56 | { | 56 | { |
57 | int iRand = random()%128; | 57 | int iRand = random()%128; |
58 | // ar << iRand; | 58 | // ar << iRand; |
59 | Bu::FString sDat( iRand ); | 59 | Bu::String sDat( iRand ); |
60 | for( int j = 0; j < iRand; j++ ) | 60 | for( int j = 0; j < iRand; j++ ) |
61 | sDat[j] = (char)((uint8_t)(random()%256)); | 61 | sDat[j] = (char)((uint8_t)(random()%256)); |
62 | ar << sDat; | 62 | ar << sDat; |
@@ -64,7 +64,7 @@ Bu::ArchiveBase &operator<<( Bu::ArchiveBase &ar, const VerifyObject &vo ) | |||
64 | sum.addData( sDat.getStr(), iRand ); | 64 | sum.addData( sDat.getStr(), iRand ); |
65 | vo.iBytesWritten += 4 + iRand; | 65 | vo.iBytesWritten += 4 + iRand; |
66 | } | 66 | } |
67 | Bu::FString sRes = sum.getResult(); | 67 | Bu::String sRes = sum.getResult(); |
68 | ar << sRes; | 68 | ar << sRes; |
69 | vo.iBytesWritten += 4 + sRes.getSize(); | 69 | vo.iBytesWritten += 4 + sRes.getSize(); |
70 | return ar; | 70 | return ar; |
@@ -79,13 +79,13 @@ Bu::ArchiveBase &operator>>( Bu::ArchiveBase &ar, VerifyObject &vo ) | |||
79 | { | 79 | { |
80 | int iRand; | 80 | int iRand; |
81 | // ar >> iRand; | 81 | // ar >> iRand; |
82 | Bu::FString sStr; | 82 | Bu::String sStr; |
83 | ar >> sStr; | 83 | ar >> sStr; |
84 | iRand = sStr.getSize(); | 84 | iRand = sStr.getSize(); |
85 | sum.addData( &iRand, 4 ); | 85 | sum.addData( &iRand, 4 ); |
86 | sum.addData( sStr.getStr(), iRand ); | 86 | sum.addData( sStr.getStr(), iRand ); |
87 | } | 87 | } |
88 | Bu::FString sSum; | 88 | Bu::String sSum; |
89 | ar >> sSum; | 89 | ar >> sSum; |
90 | unitTest( sSum == sum.getResult() ); | 90 | unitTest( sSum == sum.getResult() ); |
91 | int iTooMuch; | 91 | int iTooMuch; |
@@ -104,7 +104,7 @@ suite Myriad | |||
104 | { | 104 | { |
105 | test setSize | 105 | test setSize |
106 | { | 106 | { |
107 | FString sFileName("myriad-XXXXXXX"); | 107 | String sFileName("myriad-XXXXXXX"); |
108 | 108 | ||
109 | File fMyriad = tempFile( sFileName ); | 109 | File fMyriad = tempFile( sFileName ); |
110 | Myriad m( fMyriad, 32 ); | 110 | Myriad m( fMyriad, 32 ); |
@@ -194,7 +194,7 @@ suite Myriad | |||
194 | 194 | ||
195 | test stressGrow | 195 | test stressGrow |
196 | { | 196 | { |
197 | FString sFileName("myriad-XXXXXXX"); | 197 | String sFileName("myriad-XXXXXXX"); |
198 | 198 | ||
199 | File fMyriad = tempFile( sFileName ); | 199 | File fMyriad = tempFile( sFileName ); |
200 | Myriad m( fMyriad ); | 200 | Myriad m( fMyriad ); |
@@ -256,7 +256,7 @@ suite Myriad | |||
256 | 256 | ||
257 | test stressTruncate | 257 | test stressTruncate |
258 | { | 258 | { |
259 | FString sFileName("myriad-XXXXXXX"); | 259 | String sFileName("myriad-XXXXXXX"); |
260 | 260 | ||
261 | File fMyriad = tempFile( sFileName ); | 261 | File fMyriad = tempFile( sFileName ); |
262 | Myriad m( fMyriad ); | 262 | Myriad m( fMyriad ); |
@@ -289,7 +289,7 @@ suite Myriad | |||
289 | 289 | ||
290 | test stressTruncate2 | 290 | test stressTruncate2 |
291 | { | 291 | { |
292 | FString sFileName("myriad-XXXXXXX"); | 292 | String sFileName("myriad-XXXXXXX"); |
293 | 293 | ||
294 | Array<int> aStream; | 294 | Array<int> aStream; |
295 | 295 | ||
@@ -329,7 +329,7 @@ suite Myriad | |||
329 | 329 | ||
330 | test stressArchive | 330 | test stressArchive |
331 | { | 331 | { |
332 | FString sFileName("myriad-XXXXXX"); | 332 | String sFileName("myriad-XXXXXX"); |
333 | Array<int> aStream; | 333 | Array<int> aStream; |
334 | 334 | ||
335 | srandom( 2096 ); | 335 | srandom( 2096 ); |
diff --git a/src/unit/queuebuf.unit b/src/unit/queuebuf.unit index 29ba858..605490e 100644 --- a/src/unit/queuebuf.unit +++ b/src/unit/queuebuf.unit | |||
@@ -1,6 +1,6 @@ | |||
1 | // vim: syntax=cpp | 1 | // vim: syntax=cpp |
2 | /* | 2 | /* |
3 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 3 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
4 | * | 4 | * |
5 | * This file is part of the libbu++ library and is released under the | 5 | * This file is part of the libbu++ library and is released under the |
6 | * terms of the license contained in the file LICENSE. | 6 | * terms of the license contained in the file LICENSE. |
@@ -30,7 +30,7 @@ suite QueueBuf | |||
30 | unitTest( qb.read( buf, 7 ) == 0 ); | 30 | unitTest( qb.read( buf, 7 ) == 0 ); |
31 | } | 31 | } |
32 | 32 | ||
33 | void QBUF_RANDSTR( Bu::FString &fill, unsigned int iSize ) | 33 | void QBUF_RANDSTR( Bu::String &fill, unsigned int iSize ) |
34 | { | 34 | { |
35 | char c; | 35 | char c; |
36 | for( unsigned int i=0; i<iSize; ++i ) | 36 | for( unsigned int i=0; i<iSize; ++i ) |
@@ -44,7 +44,7 @@ suite QueueBuf | |||
44 | { | 44 | { |
45 | srandom(time(NULL)); | 45 | srandom(time(NULL)); |
46 | Bu::QueueBuf qb; | 46 | Bu::QueueBuf qb; |
47 | Bu::FString sTmp; | 47 | Bu::String sTmp; |
48 | char buf[4096]; | 48 | char buf[4096]; |
49 | 49 | ||
50 | for( int i=0; i<200; ++i ) | 50 | for( int i=0; i<200; ++i ) |
@@ -65,12 +65,12 @@ suite QueueBuf | |||
65 | printf("%02x",(int)(uint8_t)s[i]); | 65 | printf("%02x",(int)(uint8_t)s[i]); |
66 | } | 66 | } |
67 | 67 | ||
68 | void QBUF_HASH( Bu::FString &fill, const char *s, int iSize ) | 68 | void QBUF_HASH( Bu::String &fill, const char *s, int iSize ) |
69 | { | 69 | { |
70 | Bu::Md5 hash; | 70 | Bu::Md5 hash; |
71 | hash.reset(); | 71 | hash.reset(); |
72 | hash.addData( s, iSize ); | 72 | hash.addData( s, iSize ); |
73 | const Bu::FString &sTmp = hash.getResult(); | 73 | const Bu::String &sTmp = hash.getResult(); |
74 | fill.append( sTmp.getStr(), 16 ); | 74 | fill.append( sTmp.getStr(), 16 ); |
75 | } | 75 | } |
76 | 76 | ||
@@ -78,8 +78,8 @@ suite QueueBuf | |||
78 | { | 78 | { |
79 | srandom(time(NULL)); | 79 | srandom(time(NULL)); |
80 | Bu::QueueBuf qb; | 80 | Bu::QueueBuf qb; |
81 | Bu::FString sTmp; | 81 | Bu::String sTmp; |
82 | Bu::FString sTmp2; | 82 | Bu::String sTmp2; |
83 | char buf[4096]; | 83 | char buf[4096]; |
84 | 84 | ||
85 | for( int i=0; i<200; ++i ) | 85 | for( int i=0; i<200; ++i ) |
diff --git a/src/unit/fstring.unit b/src/unit/string.unit index c6d7414..f51e4de 100644 --- a/src/unit/fstring.unit +++ b/src/unit/string.unit | |||
@@ -1,34 +1,34 @@ | |||
1 | // vim: syntax=cpp | 1 | // vim: syntax=cpp |
2 | /* | 2 | /* |
3 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 3 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
4 | * | 4 | * |
5 | * This file is part of the libbu++ library and is released under the | 5 | * This file is part of the libbu++ library and is released under the |
6 | * terms of the license contained in the file LICENSE. | 6 | * terms of the license contained in the file LICENSE. |
7 | */ | 7 | */ |
8 | 8 | ||
9 | #include "bu/fstring.h" | 9 | #include "bu/string.h" |
10 | 10 | ||
11 | #include <dirent.h> | 11 | #include <dirent.h> |
12 | 12 | ||
13 | suite FString | 13 | suite String |
14 | { | 14 | { |
15 | test compare1 | 15 | test compare1 |
16 | { | 16 | { |
17 | Bu::FString b("Bob"); | 17 | Bu::String b("Bob"); |
18 | unitTest( !(b == "Bobo") ); | 18 | unitTest( !(b == "Bobo") ); |
19 | unitTest( b == "Bob" ); | 19 | unitTest( b == "Bob" ); |
20 | } | 20 | } |
21 | 21 | ||
22 | test compare2 | 22 | test compare2 |
23 | { | 23 | { |
24 | Bu::FString b("Bobo"); | 24 | Bu::String b("Bobo"); |
25 | unitTest( !(b == "Bob") ); | 25 | unitTest( !(b == "Bob") ); |
26 | unitTest( b == "Bobo" ); | 26 | unitTest( b == "Bobo" ); |
27 | } | 27 | } |
28 | 28 | ||
29 | test appendSingle | 29 | test appendSingle |
30 | { | 30 | { |
31 | Bu::FString b; | 31 | Bu::String b; |
32 | for( char l = 'a'; l < 'g'; l++ ) | 32 | for( char l = 'a'; l < 'g'; l++ ) |
33 | b += l; | 33 | b += l; |
34 | unitTest( b == "abcdef" ); | 34 | unitTest( b == "abcdef" ); |
@@ -37,8 +37,8 @@ suite FString | |||
37 | 37 | ||
38 | test shared1 | 38 | test shared1 |
39 | { | 39 | { |
40 | Bu::FString a("Hey there"); | 40 | Bu::String a("Hey there"); |
41 | Bu::FString b( a ); | 41 | Bu::String b( a ); |
42 | unitTest( a.getConstStr() == b.getConstStr() ); | 42 | unitTest( a.getConstStr() == b.getConstStr() ); |
43 | b += " guy"; | 43 | b += " guy"; |
44 | unitTest( a.getConstStr() != b.getConstStr() ); | 44 | unitTest( a.getConstStr() != b.getConstStr() ); |
@@ -48,7 +48,7 @@ suite FString | |||
48 | 48 | ||
49 | test insert | 49 | test insert |
50 | { | 50 | { |
51 | Bu::FString a("abcd"); | 51 | Bu::String a("abcd"); |
52 | a.insert( 2, "-!-", 3 ); | 52 | a.insert( 2, "-!-", 3 ); |
53 | unitTest( a == "ab-!-cd" ); | 53 | unitTest( a == "ab-!-cd" ); |
54 | 54 | ||
@@ -67,7 +67,7 @@ suite FString | |||
67 | 67 | ||
68 | test remove | 68 | test remove |
69 | { | 69 | { |
70 | Bu::FString a("abHEYcd"); | 70 | Bu::String a("abHEYcd"); |
71 | a.remove( 2, 3 ); | 71 | a.remove( 2, 3 ); |
72 | unitTest( a == "abcd" ); | 72 | unitTest( a == "abcd" ); |
73 | a.remove( 2, 5 ); | 73 | a.remove( 2, 5 ); |
@@ -79,42 +79,42 @@ suite FString | |||
79 | 79 | ||
80 | test add1 | 80 | test add1 |
81 | { | 81 | { |
82 | Bu::FString a("hi there"); | 82 | Bu::String a("hi there"); |
83 | Bu::FString b(", yeah!"); | 83 | Bu::String b(", yeah!"); |
84 | Bu::FString c = a + b; | 84 | Bu::String c = a + b; |
85 | 85 | ||
86 | unitTest( c == "hi there, yeah!" ); | 86 | unitTest( c == "hi there, yeah!" ); |
87 | } | 87 | } |
88 | 88 | ||
89 | test add2 | 89 | test add2 |
90 | { | 90 | { |
91 | Bu::FString a("hi there"); | 91 | Bu::String a("hi there"); |
92 | Bu::FString c = a + ", yeah!"; | 92 | Bu::String c = a + ", yeah!"; |
93 | 93 | ||
94 | unitTest( c == "hi there, yeah!" ); | 94 | unitTest( c == "hi there, yeah!" ); |
95 | } | 95 | } |
96 | 96 | ||
97 | test add3 | 97 | test add3 |
98 | { | 98 | { |
99 | Bu::FString a("hi there"); | 99 | Bu::String a("hi there"); |
100 | Bu::FString b(", yeah!"); | 100 | Bu::String b(", yeah!"); |
101 | Bu::FString c = a + ", Mr. Man" + b; | 101 | Bu::String c = a + ", Mr. Man" + b; |
102 | 102 | ||
103 | unitTest( c == "hi there, Mr. Man, yeah!" ); | 103 | unitTest( c == "hi there, Mr. Man, yeah!" ); |
104 | } | 104 | } |
105 | 105 | ||
106 | test add4 | 106 | test add4 |
107 | { | 107 | { |
108 | Bu::FString b(", yeah!"); | 108 | Bu::String b(", yeah!"); |
109 | Bu::FString c = "hi there" + b; | 109 | Bu::String c = "hi there" + b; |
110 | 110 | ||
111 | unitTest( c == "hi there, yeah!" ); | 111 | unitTest( c == "hi there, yeah!" ); |
112 | } | 112 | } |
113 | 113 | ||
114 | test add5 | 114 | test add5 |
115 | { | 115 | { |
116 | Bu::FString b; | 116 | Bu::String b; |
117 | Bu::FString c = "sup?"; | 117 | Bu::String c = "sup?"; |
118 | b += "hey, " + c; | 118 | b += "hey, " + c; |
119 | 119 | ||
120 | unitTest( b == "hey, sup?" ); | 120 | unitTest( b == "hey, sup?" ); |
@@ -122,17 +122,17 @@ suite FString | |||
122 | 122 | ||
123 | test add6 | 123 | test add6 |
124 | { | 124 | { |
125 | Bu::FString a("Hello"); | 125 | Bu::String a("Hello"); |
126 | char b[256] = {"Dude"}; | 126 | char b[256] = {"Dude"}; |
127 | Bu::FString c = a + "/" + b; | 127 | Bu::String c = a + "/" + b; |
128 | 128 | ||
129 | unitTest( c == "Hello/Dude" ); | 129 | unitTest( c == "Hello/Dude" ); |
130 | } | 130 | } |
131 | 131 | ||
132 | test add7 | 132 | test add7 |
133 | { | 133 | { |
134 | const Bu::FString a("hello "); | 134 | const Bu::String a("hello "); |
135 | Bu::FString b(" how "); | 135 | Bu::String b(" how "); |
136 | unitTest( a == "hello " ); | 136 | unitTest( a == "hello " ); |
137 | unitTest( a + "dude" == "hello dude" ); | 137 | unitTest( a + "dude" == "hello dude" ); |
138 | unitTest( a + "dude" + b + "are you?" == "hello dude how are you?" ); | 138 | unitTest( a + "dude" + b + "are you?" == "hello dude how are you?" ); |
@@ -140,16 +140,16 @@ suite FString | |||
140 | 140 | ||
141 | test subStr1 | 141 | test subStr1 |
142 | { | 142 | { |
143 | Bu::FString a("abcdefghijklmnop"); | 143 | Bu::String a("abcdefghijklmnop"); |
144 | Bu::FString::iterator i = a.find('f'); | 144 | Bu::String::iterator i = a.find('f'); |
145 | unitTest( a.getSubStr( i, Bu::FString::iterator() ) == "fghijklmnop" ); | 145 | unitTest( a.getSubStr( i, Bu::String::iterator() ) == "fghijklmnop" ); |
146 | Bu::FString::iterator j = i.find('l'); | 146 | Bu::String::iterator j = i.find('l'); |
147 | unitTest( a.getSubStr( i, j ) == "fghijk" ); | 147 | unitTest( a.getSubStr( i, j ) == "fghijk" ); |
148 | } | 148 | } |
149 | 149 | ||
150 | test compareSub1 | 150 | test compareSub1 |
151 | { | 151 | { |
152 | Bu::FString a("just a string."); | 152 | Bu::String a("just a string."); |
153 | unitTest( a.compareSub("a ", 5, 2) == true ); | 153 | unitTest( a.compareSub("a ", 5, 2) == true ); |
154 | unitTest( a.compareSub("string.aoeu", 7, 11 ) == false ); | 154 | unitTest( a.compareSub("string.aoeu", 7, 11 ) == false ); |
155 | unitTest( a.compareSub("string.aoeu", 7, 3 ) == true ); | 155 | unitTest( a.compareSub("string.aoeu", 7, 3 ) == true ); |
@@ -157,17 +157,17 @@ suite FString | |||
157 | 157 | ||
158 | test compareSub2 | 158 | test compareSub2 |
159 | { | 159 | { |
160 | Bu::FString a("just a string."); | 160 | Bu::String a("just a string."); |
161 | unitTest( a.compareSub(Bu::FString("a "), 5, 2) == true ); | 161 | unitTest( a.compareSub(Bu::String("a "), 5, 2) == true ); |
162 | unitTest( a.compareSub(Bu::FString("string.aoeu"), 7, 11 ) == false ); | 162 | unitTest( a.compareSub(Bu::String("string.aoeu"), 7, 11 ) == false ); |
163 | unitTest( a.compareSub(Bu::FString("string.aoeu"), 7, 3 ) == true ); | 163 | unitTest( a.compareSub(Bu::String("string.aoeu"), 7, 3 ) == true ); |
164 | } | 164 | } |
165 | 165 | ||
166 | test iterator1 | 166 | test iterator1 |
167 | { | 167 | { |
168 | Bu::FString a("This is a test."); | 168 | Bu::String a("This is a test."); |
169 | Bu::FString b; | 169 | Bu::String b; |
170 | for( Bu::FString::iterator i = a.begin(); i; i++ ) | 170 | for( Bu::String::iterator i = a.begin(); i; i++ ) |
171 | { | 171 | { |
172 | b += *i; | 172 | b += *i; |
173 | } | 173 | } |
@@ -176,10 +176,10 @@ suite FString | |||
176 | 176 | ||
177 | test iterator2 | 177 | test iterator2 |
178 | { | 178 | { |
179 | Bu::FString a("This is a test."); | 179 | Bu::String a("This is a test."); |
180 | Bu::FString b("--This is a test."); | 180 | Bu::String b("--This is a test."); |
181 | Bu::FString::iterator ai = a.begin(); | 181 | Bu::String::iterator ai = a.begin(); |
182 | Bu::FString::iterator bi = b.begin(); | 182 | Bu::String::iterator bi = b.begin(); |
183 | unitTest( ai.compare( bi ) == false ); | 183 | unitTest( ai.compare( bi ) == false ); |
184 | unitTest( bi.compare( ai ) == false ); | 184 | unitTest( bi.compare( ai ) == false ); |
185 | bi++; bi++; | 185 | bi++; bi++; |
@@ -189,10 +189,10 @@ suite FString | |||
189 | 189 | ||
190 | test iterator3 | 190 | test iterator3 |
191 | { | 191 | { |
192 | Bu::FString a("1234honour"); | 192 | Bu::String a("1234honour"); |
193 | Bu::FString b("--1234ueje"); | 193 | Bu::String b("--1234ueje"); |
194 | Bu::FString::iterator ai = a.begin(); | 194 | Bu::String::iterator ai = a.begin(); |
195 | Bu::FString::iterator bi = b.begin(); | 195 | Bu::String::iterator bi = b.begin(); |
196 | unitTest( ai.compare( bi, 4 ) == false ); | 196 | unitTest( ai.compare( bi, 4 ) == false ); |
197 | unitTest( bi.compare( ai, 4 ) == false ); | 197 | unitTest( bi.compare( ai, 4 ) == false ); |
198 | bi++; bi++; | 198 | bi++; bi++; |
@@ -205,8 +205,8 @@ suite FString | |||
205 | 205 | ||
206 | test iterator4 | 206 | test iterator4 |
207 | { | 207 | { |
208 | Bu::FString a("1234aoeu"); | 208 | Bu::String a("1234aoeu"); |
209 | Bu::FString::iterator ai = a.begin(); | 209 | Bu::String::iterator ai = a.begin(); |
210 | unitTest( ai.compare("1234") == false ); | 210 | unitTest( ai.compare("1234") == false ); |
211 | unitTest( ai.compare("1234aoeu") == true ); | 211 | unitTest( ai.compare("1234aoeu") == true ); |
212 | unitTest( ai.compare("1234aoeuee") == false ); | 212 | unitTest( ai.compare("1234aoeuee") == false ); |
@@ -214,8 +214,8 @@ suite FString | |||
214 | 214 | ||
215 | test iterator5 | 215 | test iterator5 |
216 | { | 216 | { |
217 | Bu::FString a("1234aoeu"); | 217 | Bu::String a("1234aoeu"); |
218 | Bu::FString::iterator ai = a.begin(); | 218 | Bu::String::iterator ai = a.begin(); |
219 | unitTest( ai.compare("1234", 4) == true ); | 219 | unitTest( ai.compare("1234", 4) == true ); |
220 | unitTest( ai.compare("1234aoeu", 8) == true ); | 220 | unitTest( ai.compare("1234aoeu", 8) == true ); |
221 | unitTest( ai.compare("1234aoeuee", 10) == false ); | 221 | unitTest( ai.compare("1234aoeuee", 10) == false ); |
@@ -223,9 +223,9 @@ suite FString | |||
223 | 223 | ||
224 | test iterator6 | 224 | test iterator6 |
225 | { | 225 | { |
226 | Bu::FString a("just ->this part"); | 226 | Bu::String a("just ->this part"); |
227 | Bu::FString b; | 227 | Bu::String b; |
228 | Bu::FString::iterator s = a.begin(); | 228 | Bu::String::iterator s = a.begin(); |
229 | for(; s; s++ ) | 229 | for(; s; s++ ) |
230 | { | 230 | { |
231 | if( *s == '>' ) | 231 | if( *s == '>' ) |
@@ -239,7 +239,7 @@ suite FString | |||
239 | 239 | ||
240 | b.append( s ); | 240 | b.append( s ); |
241 | 241 | ||
242 | Bu::FString c; | 242 | Bu::String c; |
243 | c.set( b.begin() ); | 243 | c.set( b.begin() ); |
244 | 244 | ||
245 | // This is here because the comparison operator used to cause flattening. | 245 | // This is here because the comparison operator used to cause flattening. |
@@ -249,9 +249,9 @@ suite FString | |||
249 | 249 | ||
250 | test iterator7 | 250 | test iterator7 |
251 | { | 251 | { |
252 | Bu::FString a("just [this] part"); | 252 | Bu::String a("just [this] part"); |
253 | Bu::FString b; | 253 | Bu::String b; |
254 | Bu::FString::iterator s = a.begin(); | 254 | Bu::String::iterator s = a.begin(); |
255 | for(; s; s++ ) | 255 | for(; s; s++ ) |
256 | { | 256 | { |
257 | if( *s == '[' ) | 257 | if( *s == '[' ) |
@@ -260,7 +260,7 @@ suite FString | |||
260 | break; | 260 | break; |
261 | } | 261 | } |
262 | } | 262 | } |
263 | Bu::FString::iterator e = s; | 263 | Bu::String::iterator e = s; |
264 | for(; e; e++ ) | 264 | for(; e; e++ ) |
265 | { | 265 | { |
266 | if( *e == ']' ) | 266 | if( *e == ']' ) |
@@ -273,9 +273,9 @@ suite FString | |||
273 | 273 | ||
274 | b.append( s, e ); | 274 | b.append( s, e ); |
275 | 275 | ||
276 | for( Bu::FString::iterator i = b.begin(); i;) | 276 | for( Bu::String::iterator i = b.begin(); i;) |
277 | { | 277 | { |
278 | Bu::FString::iterator k = i; | 278 | Bu::String::iterator k = i; |
279 | k++; | 279 | k++; |
280 | if( !k ) | 280 | if( !k ) |
281 | { | 281 | { |
@@ -284,12 +284,12 @@ suite FString | |||
284 | } | 284 | } |
285 | i = k; | 285 | i = k; |
286 | } | 286 | } |
287 | Bu::FString l; | 287 | Bu::String l; |
288 | l.set( b.begin() ); | 288 | l.set( b.begin() ); |
289 | unitTest( l == "thisthisthisthi" ); | 289 | unitTest( l == "thisthisthisthi" ); |
290 | for( Bu::FString::iterator i = b.begin(); i;) | 290 | for( Bu::String::iterator i = b.begin(); i;) |
291 | { | 291 | { |
292 | Bu::FString::iterator k = i; | 292 | Bu::String::iterator k = i; |
293 | k++; | 293 | k++; |
294 | if( !k ) | 294 | if( !k ) |
295 | { | 295 | { |
@@ -304,7 +304,7 @@ suite FString | |||
304 | 304 | ||
305 | test isSet1 | 305 | test isSet1 |
306 | { | 306 | { |
307 | Bu::FString bob; | 307 | Bu::String bob; |
308 | 308 | ||
309 | unitTest( bob.isSet() == false ); | 309 | unitTest( bob.isSet() == false ); |
310 | bob = "something"; | 310 | bob = "something"; |
@@ -315,7 +315,7 @@ suite FString | |||
315 | 315 | ||
316 | test swap1 | 316 | test swap1 |
317 | { | 317 | { |
318 | Bu::FString a, b; | 318 | Bu::String a, b; |
319 | a = "Goodbye"; | 319 | a = "Goodbye"; |
320 | b = "Hello"; | 320 | b = "Hello"; |
321 | Bu::swap( a, b ); | 321 | Bu::swap( a, b ); |
@@ -325,7 +325,7 @@ suite FString | |||
325 | 325 | ||
326 | test swap2 | 326 | test swap2 |
327 | { | 327 | { |
328 | Bu::FString a, b; | 328 | Bu::String a, b; |
329 | a = "Goodbye"; | 329 | a = "Goodbye"; |
330 | b = "Hello"; | 330 | b = "Hello"; |
331 | std::swap( a, b ); | 331 | std::swap( a, b ); |
@@ -335,14 +335,14 @@ suite FString | |||
335 | 335 | ||
336 | test replace1 | 336 | test replace1 |
337 | { | 337 | { |
338 | Bu::FString a; | 338 | Bu::String a; |
339 | a = "This is a test."; | 339 | a = "This is a test."; |
340 | unitTest( a.replace("i", "ooo") == "Thooos ooos a test." ); | 340 | unitTest( a.replace("i", "ooo") == "Thooos ooos a test." ); |
341 | } | 341 | } |
342 | 342 | ||
343 | test coreDerefBug1 | 343 | test coreDerefBug1 |
344 | { | 344 | { |
345 | Bu::FString a, b; | 345 | Bu::String a, b; |
346 | a = "bob"; | 346 | a = "bob"; |
347 | a.setSize( 0 ); | 347 | a.setSize( 0 ); |
348 | b = a; | 348 | b = a; |
diff --git a/src/unit/substream.unit b/src/unit/substream.unit index 49817b0..456e69a 100644 --- a/src/unit/substream.unit +++ b/src/unit/substream.unit | |||
@@ -1,6 +1,6 @@ | |||
1 | // vim: syntax=cpp | 1 | // vim: syntax=cpp |
2 | /* | 2 | /* |
3 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 3 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
4 | * | 4 | * |
5 | * This file is part of the libbu++ library and is released under the | 5 | * This file is part of the libbu++ library and is released under the |
6 | * terms of the license contained in the file LICENSE. | 6 | * terms of the license contained in the file LICENSE. |
diff --git a/src/unit/taf.unit b/src/unit/taf.unit index cab04d2..5fedcec 100644 --- a/src/unit/taf.unit +++ b/src/unit/taf.unit | |||
@@ -1,6 +1,6 @@ | |||
1 | // vim: syntax=cpp | 1 | // vim: syntax=cpp |
2 | /* | 2 | /* |
3 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 3 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
4 | * | 4 | * |
5 | * This file is part of the libbu++ library and is released under the | 5 | * This file is part of the libbu++ library and is released under the |
6 | * terms of the license contained in the file LICENSE. | 6 | * terms of the license contained in the file LICENSE. |
@@ -18,7 +18,7 @@ suite Taf | |||
18 | test read1 | 18 | test read1 |
19 | { | 19 | { |
20 | #define FN_TMP ("/tmp/tmpXXXXXXXX") | 20 | #define FN_TMP ("/tmp/tmpXXXXXXXX") |
21 | Bu::FString sFnTmp(FN_TMP); | 21 | Bu::String sFnTmp(FN_TMP); |
22 | Bu::File fOut = Bu::File::tempFile( sFnTmp ); | 22 | Bu::File fOut = Bu::File::tempFile( sFnTmp ); |
23 | const char *data = | 23 | const char *data = |
24 | "{test: name=\"Bob\"}" | 24 | "{test: name=\"Bob\"}" |
@@ -43,7 +43,7 @@ suite Taf | |||
43 | Bu::TafWriter tw( mb ); | 43 | Bu::TafWriter tw( mb ); |
44 | 44 | ||
45 | Bu::TafGroup g("Test data"); | 45 | Bu::TafGroup g("Test data"); |
46 | Bu::FString sData( 256 ); | 46 | Bu::String sData( 256 ); |
47 | for( int j = 0; j < 256; j++ ) | 47 | for( int j = 0; j < 256; j++ ) |
48 | sData[j] = (unsigned char)j; | 48 | sData[j] = (unsigned char)j; |
49 | g.addChild( new Bu::TafProperty("Encoded", sData) ); | 49 | g.addChild( new Bu::TafProperty("Encoded", sData) ); |
@@ -87,7 +87,7 @@ suite Taf | |||
87 | Bu::TafWriter tw( mb ); | 87 | Bu::TafWriter tw( mb ); |
88 | 88 | ||
89 | Bu::TafGroup g("Test Group"); | 89 | Bu::TafGroup g("Test Group"); |
90 | Bu::FString sVal; | 90 | Bu::String sVal; |
91 | g.addChild( new Bu::TafProperty("Lame", sVal) ); | 91 | g.addChild( new Bu::TafProperty("Lame", sVal) ); |
92 | tw.writeGroup( &g ); | 92 | tw.writeGroup( &g ); |
93 | 93 | ||
diff --git a/src/unit/variant.unit b/src/unit/variant.unit index ecfa5c3..ca977ee 100644 --- a/src/unit/variant.unit +++ b/src/unit/variant.unit | |||
@@ -1,6 +1,6 @@ | |||
1 | // vim: syntax=cpp | 1 | // vim: syntax=cpp |
2 | /* | 2 | /* |
3 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 3 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
4 | * | 4 | * |
5 | * This file is part of the libbu++ library and is released under the | 5 | * This file is part of the libbu++ library and is released under the |
6 | * terms of the license contained in the file LICENSE. | 6 | * terms of the license contained in the file LICENSE. |
diff --git a/src/unit/xml.unit b/src/unit/xml.unit index 67216f0..ab339c2 100644 --- a/src/unit/xml.unit +++ b/src/unit/xml.unit | |||
@@ -1,12 +1,12 @@ | |||
1 | // vim: syntax=cpp | 1 | // vim: syntax=cpp |
2 | /* | 2 | /* |
3 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 3 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
4 | * | 4 | * |
5 | * This file is part of the libbu++ library and is released under the | 5 | * This file is part of the libbu++ library and is released under the |
6 | * terms of the license contained in the file LICENSE. | 6 | * terms of the license contained in the file LICENSE. |
7 | */ | 7 | */ |
8 | 8 | ||
9 | #include "bu/fstring.h" | 9 | #include "bu/string.h" |
10 | #include "bu/xmlreader.h" | 10 | #include "bu/xmlreader.h" |
11 | #include "bu/membuf.h" | 11 | #include "bu/membuf.h" |
12 | 12 | ||
@@ -14,7 +14,7 @@ suite Xml | |||
14 | { | 14 | { |
15 | test declaration | 15 | test declaration |
16 | { | 16 | { |
17 | Bu::FString sXml("<?xml ?> <hi />"); | 17 | Bu::String sXml("<?xml ?> <hi />"); |
18 | Bu::MemBuf buf( sXml ); | 18 | Bu::MemBuf buf( sXml ); |
19 | Bu::XmlReader xr( buf ); | 19 | Bu::XmlReader xr( buf ); |
20 | } | 20 | } |
diff --git a/src/unitsuite.cpp b/src/unitsuite.cpp index ce6d037..db930a4 100644 --- a/src/unitsuite.cpp +++ b/src/unitsuite.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -158,14 +158,14 @@ int Bu::UnitSuite::run( int argc, char *argv[] ) | |||
158 | return 0; | 158 | return 0; |
159 | } | 159 | } |
160 | 160 | ||
161 | Bu::File Bu::UnitSuite::tempFile( Bu::FString &sFileName ) | 161 | Bu::File Bu::UnitSuite::tempFile( Bu::String &sFileName ) |
162 | { | 162 | { |
163 | Bu::File f = Bu::File::tempFile( sFileName ); | 163 | Bu::File f = Bu::File::tempFile( sFileName ); |
164 | lFileCleanup.append( sFileName ); | 164 | lFileCleanup.append( sFileName ); |
165 | return f; | 165 | return f; |
166 | } | 166 | } |
167 | 167 | ||
168 | void Bu::UnitSuite::add( Test fTest, const Bu::FString &sName, Expect e ) | 168 | void Bu::UnitSuite::add( Test fTest, const Bu::String &sName, Expect e ) |
169 | { | 169 | { |
170 | TestInfo ti; | 170 | TestInfo ti; |
171 | ti.sName = sName; | 171 | ti.sName = sName; |
@@ -173,7 +173,7 @@ void Bu::UnitSuite::add( Test fTest, const Bu::FString &sName, Expect e ) | |||
173 | long index = ti.sName.rfindIdx("::"); | 173 | long index = ti.sName.rfindIdx("::"); |
174 | if( index != -1 ) | 174 | if( index != -1 ) |
175 | { | 175 | { |
176 | FString tmp = sSuiteName; | 176 | String tmp = sSuiteName; |
177 | tmp += ti.sName.getStr()+index; | 177 | tmp += ti.sName.getStr()+index; |
178 | ti.sName = tmp; | 178 | ti.sName = tmp; |
179 | } | 179 | } |
@@ -183,7 +183,7 @@ void Bu::UnitSuite::add( Test fTest, const Bu::FString &sName, Expect e ) | |||
183 | iNameWidth = ti.sName.getSize(); | 183 | iNameWidth = ti.sName.getSize(); |
184 | } | 184 | } |
185 | 185 | ||
186 | void Bu::UnitSuite::setName( const FString &sName ) | 186 | void Bu::UnitSuite::setName( const String &sName ) |
187 | { | 187 | { |
188 | sSuiteName = sName; | 188 | sSuiteName = sName; |
189 | } | 189 | } |
diff --git a/src/unitsuite.h b/src/unitsuite.h index 475ee48..2250a4d 100644 --- a/src/unitsuite.h +++ b/src/unitsuite.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -10,7 +10,7 @@ | |||
10 | 10 | ||
11 | #include <stdint.h> | 11 | #include <stdint.h> |
12 | #include "bu/list.h" | 12 | #include "bu/list.h" |
13 | #include "bu/fstring.h" | 13 | #include "bu/string.h" |
14 | #include "bu/file.h" | 14 | #include "bu/file.h" |
15 | #include "bu/array.h" | 15 | #include "bu/array.h" |
16 | 16 | ||
@@ -63,7 +63,7 @@ namespace Bu | |||
63 | 63 | ||
64 | int run( int argc=0, char *argv[]=NULL ); | 64 | int run( int argc=0, char *argv[]=NULL ); |
65 | 65 | ||
66 | Bu::File tempFile( Bu::FString &sFileName ); | 66 | Bu::File tempFile( Bu::String &sFileName ); |
67 | 67 | ||
68 | typedef void (UnitSuite::*Test)(); | 68 | typedef void (UnitSuite::*Test)(); |
69 | 69 | ||
@@ -71,12 +71,12 @@ namespace Bu | |||
71 | { | 71 | { |
72 | public: | 72 | public: |
73 | Failed() : str(""), bFile( false ) { } | 73 | Failed() : str(""), bFile( false ) { } |
74 | Failed( const FString &s ) : str( s ), bFile( false ) { } | 74 | Failed( const String &s ) : str( s ), bFile( false ) { } |
75 | Failed( const FString &s, const FString &sFile, int nLine ) : | 75 | Failed( const String &s, const String &sFile, int nLine ) : |
76 | str( s ), sFile( sFile ), nLine( nLine ), bFile( true ) { } | 76 | str( s ), sFile( sFile ), nLine( nLine ), bFile( true ) { } |
77 | 77 | ||
78 | FString str; | 78 | String str; |
79 | FString sFile; | 79 | String sFile; |
80 | int nLine; | 80 | int nLine; |
81 | bool bFile; | 81 | bool bFile; |
82 | }; | 82 | }; |
@@ -93,8 +93,8 @@ namespace Bu | |||
93 | }; | 93 | }; |
94 | 94 | ||
95 | protected: | 95 | protected: |
96 | void add( Test fTest, const Bu::FString &sName, Expect e=expectPass ); | 96 | void add( Test fTest, const Bu::String &sName, Expect e=expectPass ); |
97 | void setName( const FString &sName ); | 97 | void setName( const String &sName ); |
98 | 98 | ||
99 | void dispProgress(); | 99 | void dispProgress(); |
100 | void setStepCount( int iSteps ); | 100 | void setStepCount( int iSteps ); |
@@ -102,23 +102,23 @@ namespace Bu | |||
102 | void setProgress( int iAmnt ); | 102 | void setProgress( int iAmnt ); |
103 | 103 | ||
104 | private: | 104 | private: |
105 | int onListCases( Bu::Array<Bu::FString> aParam ); | 105 | int onListCases( Bu::Array<Bu::String> aParam ); |
106 | 106 | ||
107 | private: | 107 | private: |
108 | typedef struct TestInfo | 108 | typedef struct TestInfo |
109 | { | 109 | { |
110 | FString sName; | 110 | String sName; |
111 | Test fTest; | 111 | Test fTest; |
112 | Expect eExpect; | 112 | Expect eExpect; |
113 | } TestInfo; | 113 | } TestInfo; |
114 | 114 | ||
115 | typedef Bu::List<TestInfo> TestList; | 115 | typedef Bu::List<TestInfo> TestList; |
116 | TestList lTests; | 116 | TestList lTests; |
117 | FString sSuiteName; | 117 | String sSuiteName; |
118 | 118 | ||
119 | int iOptions; | 119 | int iOptions; |
120 | 120 | ||
121 | typedef Bu::List<Bu::FString> StrList; | 121 | typedef Bu::List<Bu::String> StrList; |
122 | StrList lFileCleanup; | 122 | StrList lFileCleanup; |
123 | int iNameWidth; | 123 | int iNameWidth; |
124 | int iStepCount; | 124 | int iStepCount; |
diff --git a/src/url.cpp b/src/url.cpp index 1f9f563..7b4a48e 100644 --- a/src/url.cpp +++ b/src/url.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -21,7 +21,7 @@ Bu::Url::Url() | |||
21 | { | 21 | { |
22 | } | 22 | } |
23 | 23 | ||
24 | Bu::Url::Url( const Bu::FString &sUrl ) | 24 | Bu::Url::Url( const Bu::String &sUrl ) |
25 | { | 25 | { |
26 | parseUrl( sUrl ); | 26 | parseUrl( sUrl ); |
27 | } | 27 | } |
@@ -30,22 +30,22 @@ Bu::Url::~Url() | |||
30 | { | 30 | { |
31 | } | 31 | } |
32 | 32 | ||
33 | void Bu::Url::parseUrl( const Bu::FString &sUrl ) | 33 | void Bu::Url::parseUrl( const Bu::String &sUrl ) |
34 | { | 34 | { |
35 | clear(); | 35 | clear(); |
36 | 36 | ||
37 | Bu::FString::const_iterator i = sUrl.begin(); | 37 | Bu::String::const_iterator i = sUrl.begin(); |
38 | parseProtocol( i ); | 38 | parseProtocol( i ); |
39 | parseUserPass( i ); | 39 | parseUserPass( i ); |
40 | parseHost( i ); | 40 | parseHost( i ); |
41 | parsePath( i ); | 41 | parsePath( i ); |
42 | } | 42 | } |
43 | 43 | ||
44 | Bu::FString Bu::Url::decode( const Bu::FString &sStr ) | 44 | Bu::String Bu::Url::decode( const Bu::String &sStr ) |
45 | { | 45 | { |
46 | Bu::FString sRet; | 46 | Bu::String sRet; |
47 | char buf[3] = {0, 0, 0}; | 47 | char buf[3] = {0, 0, 0}; |
48 | for( Bu::FString::const_iterator i = sStr.begin(); i; i++ ) | 48 | for( Bu::String::const_iterator i = sStr.begin(); i; i++ ) |
49 | { | 49 | { |
50 | if( *i == '+' ) | 50 | if( *i == '+' ) |
51 | { | 51 | { |
@@ -67,10 +67,10 @@ Bu::FString Bu::Url::decode( const Bu::FString &sStr ) | |||
67 | return sRet; | 67 | return sRet; |
68 | } | 68 | } |
69 | 69 | ||
70 | Bu::FString Bu::Url::encode( const Bu::FString &sStr ) | 70 | Bu::String Bu::Url::encode( const Bu::String &sStr ) |
71 | { | 71 | { |
72 | Bu::FString sRet; | 72 | Bu::String sRet; |
73 | for( Bu::FString::const_iterator i = sStr.begin(); i; i++ ) | 73 | for( Bu::String::const_iterator i = sStr.begin(); i; i++ ) |
74 | { | 74 | { |
75 | if( *i == ' ' ) | 75 | if( *i == ' ' ) |
76 | { | 76 | { |
@@ -96,17 +96,17 @@ Bu::FString Bu::Url::encode( const Bu::FString &sStr ) | |||
96 | return sRet; | 96 | return sRet; |
97 | } | 97 | } |
98 | 98 | ||
99 | void Bu::Url::parseProtocol( Bu::FString::const_iterator &i ) | 99 | void Bu::Url::parseProtocol( Bu::String::const_iterator &i ) |
100 | { | 100 | { |
101 | Bu::FString::const_iterator s = i.find("://", 3); | 101 | Bu::String::const_iterator s = i.find("://", 3); |
102 | if( !s ) | 102 | if( !s ) |
103 | throw Bu::ExceptionBase("No :// in url"); | 103 | throw Bu::ExceptionBase("No :// in url"); |
104 | Bu::FString sTmp( i, s ); | 104 | Bu::String sTmp( i, s ); |
105 | setProtocol( sTmp ); | 105 | setProtocol( sTmp ); |
106 | i = s + 3; | 106 | i = s + 3; |
107 | } | 107 | } |
108 | 108 | ||
109 | void Bu::Url::setProtocol( const Bu::FString &sNewProto, bool bAutoSetPort ) | 109 | void Bu::Url::setProtocol( const Bu::String &sNewProto, bool bAutoSetPort ) |
110 | { | 110 | { |
111 | sProtocol = sNewProto; | 111 | sProtocol = sNewProto; |
112 | #ifndef WIN32 | 112 | #ifndef WIN32 |
@@ -121,13 +121,13 @@ void Bu::Url::setProtocol( const Bu::FString &sNewProto, bool bAutoSetPort ) | |||
121 | #endif | 121 | #endif |
122 | } | 122 | } |
123 | 123 | ||
124 | void Bu::Url::parseUserPass( Bu::FString::const_iterator &i ) | 124 | void Bu::Url::parseUserPass( Bu::String::const_iterator &i ) |
125 | { | 125 | { |
126 | Bu::FString::const_iterator s = i.find('@'); | 126 | Bu::String::const_iterator s = i.find('@'); |
127 | if( !s ) | 127 | if( !s ) |
128 | return; | 128 | return; |
129 | 129 | ||
130 | Bu::FString::const_iterator p = i.find(':'); | 130 | Bu::String::const_iterator p = i.find(':'); |
131 | if( p ) | 131 | if( p ) |
132 | { | 132 | { |
133 | sUser.set( i, p ); | 133 | sUser.set( i, p ); |
@@ -141,9 +141,9 @@ void Bu::Url::parseUserPass( Bu::FString::const_iterator &i ) | |||
141 | i = s + 1; | 141 | i = s + 1; |
142 | } | 142 | } |
143 | 143 | ||
144 | void Bu::Url::parseHost( Bu::FString::const_iterator &i ) | 144 | void Bu::Url::parseHost( Bu::String::const_iterator &i ) |
145 | { | 145 | { |
146 | Bu::FString::const_iterator s = i; | 146 | Bu::String::const_iterator s = i; |
147 | for( ; s && *s != '/'; s++ ) | 147 | for( ; s && *s != '/'; s++ ) |
148 | { | 148 | { |
149 | if( *s == ':' ) | 149 | if( *s == ':' ) |
@@ -151,7 +151,7 @@ void Bu::Url::parseHost( Bu::FString::const_iterator &i ) | |||
151 | sHost.set( i, s ); | 151 | sHost.set( i, s ); |
152 | i = s + 1; | 152 | i = s + 1; |
153 | s = i.find('/'); | 153 | s = i.find('/'); |
154 | Bu::FString sPort( i, s ); | 154 | Bu::String sPort( i, s ); |
155 | iPort = strtol( sPort.getStr(), NULL, 10 ); | 155 | iPort = strtol( sPort.getStr(), NULL, 10 ); |
156 | i = s; | 156 | i = s; |
157 | return; | 157 | return; |
@@ -161,17 +161,17 @@ void Bu::Url::parseHost( Bu::FString::const_iterator &i ) | |||
161 | i = s; | 161 | i = s; |
162 | } | 162 | } |
163 | 163 | ||
164 | void Bu::Url::parsePath( const Bu::FString &sPath ) | 164 | void Bu::Url::parsePath( const Bu::String &sPath ) |
165 | { | 165 | { |
166 | Bu::FString::const_iterator i = sPath.begin(); | 166 | Bu::String::const_iterator i = sPath.begin(); |
167 | parsePath( i ); | 167 | parsePath( i ); |
168 | } | 168 | } |
169 | 169 | ||
170 | void Bu::Url::parsePath( Bu::FString::const_iterator &i ) | 170 | void Bu::Url::parsePath( Bu::String::const_iterator &i ) |
171 | { | 171 | { |
172 | if( i ) | 172 | if( i ) |
173 | { | 173 | { |
174 | Bu::FString::const_iterator s = i.find('?'); | 174 | Bu::String::const_iterator s = i.find('?'); |
175 | sPath.set( i, s ); | 175 | sPath.set( i, s ); |
176 | i = s + 1; | 176 | i = s + 1; |
177 | if( s ) | 177 | if( s ) |
@@ -185,17 +185,17 @@ void Bu::Url::parsePath( Bu::FString::const_iterator &i ) | |||
185 | } | 185 | } |
186 | } | 186 | } |
187 | 187 | ||
188 | void Bu::Url::parseParams( const Bu::FString &sQuery ) | 188 | void Bu::Url::parseParams( const Bu::String &sQuery ) |
189 | { | 189 | { |
190 | Bu::FString::const_iterator i = sQuery.begin(); | 190 | Bu::String::const_iterator i = sQuery.begin(); |
191 | parseParams( i ); | 191 | parseParams( i ); |
192 | } | 192 | } |
193 | 193 | ||
194 | void Bu::Url::parseParams( Bu::FString::const_iterator &i ) | 194 | void Bu::Url::parseParams( Bu::String::const_iterator &i ) |
195 | { | 195 | { |
196 | bool bName = true; | 196 | bool bName = true; |
197 | Bu::FString sName, sValue; | 197 | Bu::String sName, sValue; |
198 | for( Bu::FString::const_iterator s = i; s; s++ ) | 198 | for( Bu::String::const_iterator s = i; s; s++ ) |
199 | { | 199 | { |
200 | if( bName ) | 200 | if( bName ) |
201 | { | 201 | { |
@@ -239,7 +239,7 @@ void Bu::Url::parseParams( Bu::FString::const_iterator &i ) | |||
239 | } | 239 | } |
240 | } | 240 | } |
241 | 241 | ||
242 | void Bu::Url::addParam( const Bu::FString &n, const Bu::FString &v ) | 242 | void Bu::Url::addParam( const Bu::String &n, const Bu::String &v ) |
243 | { | 243 | { |
244 | lParam.append( Param( n, v ) ); | 244 | lParam.append( Param( n, v ) ); |
245 | } | 245 | } |
@@ -254,9 +254,9 @@ void Bu::Url::clear() | |||
254 | iPort.clear(); | 254 | iPort.clear(); |
255 | } | 255 | } |
256 | 256 | ||
257 | Bu::FString Bu::Url::getFullPath() const | 257 | Bu::String Bu::Url::getFullPath() const |
258 | { | 258 | { |
259 | Bu::FString sBuf = sPath; | 259 | Bu::String sBuf = sPath; |
260 | if( !lParam.isEmpty() ) | 260 | if( !lParam.isEmpty() ) |
261 | { | 261 | { |
262 | for( ParamList::const_iterator i = lParam.begin(); i; i++ ) | 262 | for( ParamList::const_iterator i = lParam.begin(); i; i++ ) |
@@ -277,9 +277,9 @@ Bu::FString Bu::Url::getFullPath() const | |||
277 | return sBuf; | 277 | return sBuf; |
278 | } | 278 | } |
279 | 279 | ||
280 | Bu::FString Bu::Url::getUrl() const | 280 | Bu::String Bu::Url::getUrl() const |
281 | { | 281 | { |
282 | Bu::FString sBuf = sProtocol + "://" + sHost + getFullPath(); | 282 | Bu::String sBuf = sProtocol + "://" + sHost + getFullPath(); |
283 | return sBuf; | 283 | return sBuf; |
284 | } | 284 | } |
285 | 285 | ||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -8,7 +8,7 @@ | |||
8 | #ifndef BU_URL_H | 8 | #ifndef BU_URL_H |
9 | #define BU_URL_H | 9 | #define BU_URL_H |
10 | 10 | ||
11 | #include "bu/fstring.h" | 11 | #include "bu/string.h" |
12 | #include "bu/atom.h" | 12 | #include "bu/atom.h" |
13 | 13 | ||
14 | namespace Bu | 14 | namespace Bu |
@@ -20,61 +20,61 @@ namespace Bu | |||
20 | { | 20 | { |
21 | Param() { } | 21 | Param() { } |
22 | Param( const Param &r ) : sName( r.sName ), sValue( r.sValue ) { } | 22 | Param( const Param &r ) : sName( r.sName ), sValue( r.sValue ) { } |
23 | Param( const Bu::FString &n, const Bu::FString &v ) : | 23 | Param( const Bu::String &n, const Bu::String &v ) : |
24 | sName( n ), sValue( v ) { } | 24 | sName( n ), sValue( v ) { } |
25 | Bu::FString sName; | 25 | Bu::String sName; |
26 | Bu::FString sValue; | 26 | Bu::String sValue; |
27 | } Param; | 27 | } Param; |
28 | typedef Bu::List<Param> ParamList; | 28 | typedef Bu::List<Param> ParamList; |
29 | 29 | ||
30 | public: | 30 | public: |
31 | Url(); | 31 | Url(); |
32 | Url( const Bu::FString &sUrl ); | 32 | Url( const Bu::String &sUrl ); |
33 | virtual ~Url(); | 33 | virtual ~Url(); |
34 | 34 | ||
35 | void parseUrl( const Bu::FString &sUrl ); | 35 | void parseUrl( const Bu::String &sUrl ); |
36 | void parseParams( const Bu::FString &sQuery ); | 36 | void parseParams( const Bu::String &sQuery ); |
37 | void parseParams( Bu::FString::const_iterator &i ); | 37 | void parseParams( Bu::String::const_iterator &i ); |
38 | void parsePath( const Bu::FString &sPath ); | 38 | void parsePath( const Bu::String &sPath ); |
39 | void parsePath( Bu::FString::const_iterator &i ); | 39 | void parsePath( Bu::String::const_iterator &i ); |
40 | void clear(); | 40 | void clear(); |
41 | 41 | ||
42 | Bu::FString getUrl() const; | 42 | Bu::String getUrl() const; |
43 | Bu::FString getFullPath() const; | 43 | Bu::String getFullPath() const; |
44 | 44 | ||
45 | const Bu::FString &getProtocol() const { return sProtocol; } | 45 | const Bu::String &getProtocol() const { return sProtocol; } |
46 | const Bu::FString &getUser() const { return sUser; } | 46 | const Bu::String &getUser() const { return sUser; } |
47 | const Bu::FString &getPass() const { return sPass; } | 47 | const Bu::String &getPass() const { return sPass; } |
48 | const Bu::FString &getHost() const { return sHost; } | 48 | const Bu::String &getHost() const { return sHost; } |
49 | const Bu::FString &getPath() const { return sPath; } | 49 | const Bu::String &getPath() const { return sPath; } |
50 | int getPort() const { return iPort; } | 50 | int getPort() const { return iPort; } |
51 | ParamList::const_iterator getParamBegin() const | 51 | ParamList::const_iterator getParamBegin() const |
52 | { return lParam.begin(); } | 52 | { return lParam.begin(); } |
53 | 53 | ||
54 | void setProtocol( const Bu::FString &sNewHost, bool bAutoSetPort=true ); | 54 | void setProtocol( const Bu::String &sNewHost, bool bAutoSetPort=true ); |
55 | void setUser( const Bu::FString &s ) { sUser = s; } | 55 | void setUser( const Bu::String &s ) { sUser = s; } |
56 | void setPass( const Bu::FString &s ) { sPass = s; } | 56 | void setPass( const Bu::String &s ) { sPass = s; } |
57 | void setHost( const Bu::FString &s ) { sHost = s; } | 57 | void setHost( const Bu::String &s ) { sHost = s; } |
58 | void setPath( const Bu::FString &s ) { sPath = s; } | 58 | void setPath( const Bu::String &s ) { sPath = s; } |
59 | void setPort( int i ) { iPort = i; } | 59 | void setPort( int i ) { iPort = i; } |
60 | void addParam( const Bu::FString &n, const Bu::FString &v ); | 60 | void addParam( const Bu::String &n, const Bu::String &v ); |
61 | 61 | ||
62 | bool hasPort() const { return iPort.has(); } | 62 | bool hasPort() const { return iPort.has(); } |
63 | 63 | ||
64 | static Bu::FString decode( const Bu::FString &sStr ); | 64 | static Bu::String decode( const Bu::String &sStr ); |
65 | static Bu::FString encode( const Bu::FString &sStr ); | 65 | static Bu::String encode( const Bu::String &sStr ); |
66 | 66 | ||
67 | private: // Parsing code | 67 | private: // Parsing code |
68 | void parseProtocol( Bu::FString::const_iterator &i ); | 68 | void parseProtocol( Bu::String::const_iterator &i ); |
69 | void parseUserPass( Bu::FString::const_iterator &i ); | 69 | void parseUserPass( Bu::String::const_iterator &i ); |
70 | void parseHost( Bu::FString::const_iterator &i ); | 70 | void parseHost( Bu::String::const_iterator &i ); |
71 | 71 | ||
72 | private: | 72 | private: |
73 | Bu::FString sProtocol; | 73 | Bu::String sProtocol; |
74 | Bu::FString sUser; | 74 | Bu::String sUser; |
75 | Bu::FString sPass; | 75 | Bu::String sPass; |
76 | Bu::FString sHost; | 76 | Bu::String sHost; |
77 | Bu::FString sPath; | 77 | Bu::String sPath; |
78 | Bu::Atom<int> iPort; | 78 | Bu::Atom<int> iPort; |
79 | ParamList lParam; | 79 | ParamList lParam; |
80 | 80 | ||
diff --git a/src/urn.cpp b/src/urn.cpp index b798a1f..106fb64 100644 --- a/src/urn.cpp +++ b/src/urn.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/utfstring.cpp b/src/utfstring.cpp index ae5efaf..eb23713 100644 --- a/src/utfstring.cpp +++ b/src/utfstring.cpp | |||
@@ -1,29 +1,17 @@ | |||
1 | #include "bu/utfstring.h" | 1 | /* |
2 | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. | |
3 | template class Bu::FBasicString<short>; | 3 | * |
4 | 4 | * This file is part of the libbu++ library and is released under the | |
5 | template<> uint32_t Bu::__calcHashCode<Bu::UtfString>( const Bu::UtfString &k ) | 5 | * terms of the license contained in the file LICENSE. |
6 | { | 6 | */ |
7 | long j, sz = k.getSize()*2; | ||
8 | const char *s = (const char *)k.getStr(); | ||
9 | 7 | ||
10 | long nPos = 0; | 8 | #include "bu/utfstring.h" |
11 | for( j = 0; j < sz; j++, s++ ) | ||
12 | { | ||
13 | nPos = *s + (nPos << 6) + (nPos << 16) - nPos; | ||
14 | } | ||
15 | |||
16 | return nPos; | ||
17 | } | ||
18 | 9 | ||
19 | template<> bool Bu::__cmpHashKeys<Bu::UtfString>( | 10 | Bu::UtfString::UtfString() |
20 | const Bu::UtfString &a, const Bu::UtfString &b ) | ||
21 | { | 11 | { |
22 | return a == b; | ||
23 | } | 12 | } |
24 | 13 | ||
25 | template<> void Bu::__tracer_format<Bu::UtfString>( const Bu::UtfString &v ) | 14 | Bu::UtfString::~UtfString() |
26 | { | 15 | { |
27 | printf("(%ld)\"%s\"", v.getSize(), (const char *)v.getStr() ); | ||
28 | } | 16 | } |
29 | 17 | ||
diff --git a/src/utfstring.h b/src/utfstring.h index bbacb74..2140af1 100644 --- a/src/utfstring.h +++ b/src/utfstring.h | |||
@@ -1,24 +1,29 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. | ||
3 | * | ||
4 | * This file is part of the libbu++ library and is released under the | ||
5 | * terms of the license contained in the file LICENSE. | ||
6 | */ | ||
7 | |||
1 | #ifndef BU_UTF_STRING_H | 8 | #ifndef BU_UTF_STRING_H |
2 | #define BU_UTF_STRING_H | 9 | #define BU_UTF_STRING_H |
3 | 10 | ||
4 | #include "bu/fbasicstring.h" | 11 | #include "bu/string.h" |
5 | 12 | ||
6 | namespace Bu | 13 | namespace Bu |
7 | { | 14 | { |
8 | typedef FBasicString<short> UtfString; | 15 | class UtfString |
9 | 16 | { | |
10 | template<typename T> | 17 | public: |
11 | uint32_t __calcHashCode( const T &k ); | 18 | UtfString(); |
19 | virtual ~UtfString(); | ||
12 | 20 | ||
13 | template<typename T> | 21 | typedef uint32_t point; |
14 | bool __cmpHashKeys( const T &a, const T &b ); | ||
15 | 22 | ||
16 | template<> uint32_t __calcHashCode<UtfString>( const UtfString &k ); | 23 | private: |
17 | template<> bool __cmpHashKeys<UtfString>( | 24 | typedef BasicString<uint16_t> RawString; |
18 | const UtfString &a, const UtfString &b ); | 25 | RawString rsStore; |
19 | 26 | }; | |
20 | template<typename t> void __tracer_format( const t &v ); | 27 | }; |
21 | template<> void __tracer_format<UtfString>( const UtfString &v ); | ||
22 | } | ||
23 | 28 | ||
24 | #endif | 29 | #endif |
diff --git a/src/util.cpp b/src/util.cpp index 0d2420a..6983dfd 100644 --- a/src/util.cpp +++ b/src/util.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/uuid.cpp b/src/uuid.cpp index 410cf6b..69af5b4 100644 --- a/src/uuid.cpp +++ b/src/uuid.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -25,12 +25,12 @@ Bu::Uuid::~Uuid() | |||
25 | { | 25 | { |
26 | } | 26 | } |
27 | 27 | ||
28 | Bu::FString Bu::Uuid::toRawString() | 28 | Bu::String Bu::Uuid::toRawString() |
29 | { | 29 | { |
30 | return Bu::FString( (char *)data, 16 ); | 30 | return Bu::String( (char *)data, 16 ); |
31 | } | 31 | } |
32 | 32 | ||
33 | Bu::FString Bu::Uuid::toString() | 33 | Bu::String Bu::Uuid::toString() |
34 | { | 34 | { |
35 | Bu::MemBuf mb; | 35 | Bu::MemBuf mb; |
36 | Bu::Formatter f( mb ); | 36 | Bu::Formatter f( mb ); |
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -8,7 +8,7 @@ | |||
8 | #ifndef BU_UUID_H | 8 | #ifndef BU_UUID_H |
9 | #define BU_UUID_H | 9 | #define BU_UUID_H |
10 | 10 | ||
11 | #include "bu/fstring.h" | 11 | #include "bu/string.h" |
12 | 12 | ||
13 | namespace Bu | 13 | namespace Bu |
14 | { | 14 | { |
@@ -19,8 +19,8 @@ namespace Bu | |||
19 | Uuid( const Uuid &src ); | 19 | Uuid( const Uuid &src ); |
20 | virtual ~Uuid(); | 20 | virtual ~Uuid(); |
21 | 21 | ||
22 | Bu::FString toRawString(); | 22 | Bu::String toRawString(); |
23 | Bu::FString toString(); | 23 | Bu::String toString(); |
24 | 24 | ||
25 | static Uuid gen(); | 25 | static Uuid gen(); |
26 | static Uuid genV1(); | 26 | static Uuid genV1(); |
diff --git a/src/variant.cpp b/src/variant.cpp index a239e0f..fd0511f 100644 --- a/src/variant.cpp +++ b/src/variant.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -9,7 +9,7 @@ | |||
9 | 9 | ||
10 | namespace Bu | 10 | namespace Bu |
11 | { | 11 | { |
12 | Formatter &operator<<( Formatter &f, const FString &s ); | 12 | Formatter &operator<<( Formatter &f, const String &s ); |
13 | }; | 13 | }; |
14 | 14 | ||
15 | Bu::VariantTypeRoot::VariantTypeRoot() | 15 | Bu::VariantTypeRoot::VariantTypeRoot() |
@@ -37,7 +37,7 @@ Bu::Variant::Variant( const Variant &v ) : | |||
37 | Bu::Variant::Variant( const char *t ) : | 37 | Bu::Variant::Variant( const char *t ) : |
38 | pCore( NULL ) | 38 | pCore( NULL ) |
39 | { | 39 | { |
40 | set( Bu::FString( t ) ); | 40 | set( Bu::String( t ) ); |
41 | } | 41 | } |
42 | 42 | ||
43 | Bu::Variant::~Variant() | 43 | Bu::Variant::~Variant() |
@@ -54,7 +54,7 @@ bool Bu::Variant::isSet() const | |||
54 | return pCore != NULL; | 54 | return pCore != NULL; |
55 | } | 55 | } |
56 | 56 | ||
57 | Bu::FString Bu::Variant::toString() const | 57 | Bu::String Bu::Variant::toString() const |
58 | { | 58 | { |
59 | if( !pCore ) | 59 | if( !pCore ) |
60 | return "***NO DATA***"; | 60 | return "***NO DATA***"; |
@@ -90,14 +90,14 @@ Bu::Formatter &Bu::operator<<( Bu::Formatter &f, const Bu::Variant &v ) | |||
90 | return f << v.toString(); | 90 | return f << v.toString(); |
91 | } | 91 | } |
92 | 92 | ||
93 | template<> Bu::FString Bu::VariantType<int>::toString() const | 93 | template<> Bu::String Bu::VariantType<int>::toString() const |
94 | { | 94 | { |
95 | Bu::FString s; | 95 | Bu::String s; |
96 | s.format("%d", data ); | 96 | s.format("%d", data ); |
97 | return s; | 97 | return s; |
98 | } | 98 | } |
99 | 99 | ||
100 | template<> Bu::FString Bu::VariantType<bool>::toString() const | 100 | template<> Bu::String Bu::VariantType<bool>::toString() const |
101 | { | 101 | { |
102 | return data?"true":"false"; | 102 | return data?"true":"false"; |
103 | } | 103 | } |
diff --git a/src/variant.h b/src/variant.h index f659ad2..2b88efe 100644 --- a/src/variant.h +++ b/src/variant.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -8,7 +8,7 @@ | |||
8 | #ifndef BU_VARIANT_H | 8 | #ifndef BU_VARIANT_H |
9 | #define BU_VARIANT_H | 9 | #define BU_VARIANT_H |
10 | 10 | ||
11 | #include <bu/fstring.h> | 11 | #include <bu/string.h> |
12 | #include <typeinfo> | 12 | #include <typeinfo> |
13 | #include <bu/membuf.h> | 13 | #include <bu/membuf.h> |
14 | #include <bu/formatter.h> | 14 | #include <bu/formatter.h> |
@@ -26,7 +26,7 @@ namespace Bu | |||
26 | VariantTypeRoot(); | 26 | VariantTypeRoot(); |
27 | virtual ~VariantTypeRoot(); | 27 | virtual ~VariantTypeRoot(); |
28 | 28 | ||
29 | virtual Bu::FString toString() const=0; | 29 | virtual Bu::String toString() const=0; |
30 | virtual const std::type_info &getType() const=0; | 30 | virtual const std::type_info &getType() const=0; |
31 | virtual VariantTypeRoot *clone() const=0; | 31 | virtual VariantTypeRoot *clone() const=0; |
32 | }; | 32 | }; |
@@ -65,7 +65,7 @@ namespace Bu | |||
65 | return data; | 65 | return data; |
66 | } | 66 | } |
67 | 67 | ||
68 | virtual Bu::FString toString() const | 68 | virtual Bu::String toString() const |
69 | { | 69 | { |
70 | MemBuf mb; | 70 | MemBuf mb; |
71 | Formatter f( mb ); | 71 | Formatter f( mb ); |
@@ -124,7 +124,7 @@ namespace Bu | |||
124 | virtual ~Variant(); | 124 | virtual ~Variant(); |
125 | 125 | ||
126 | bool isSet() const; | 126 | bool isSet() const; |
127 | Bu::FString toString() const; | 127 | Bu::String toString() const; |
128 | const std::type_info &getType() const; | 128 | const std::type_info &getType() const; |
129 | 129 | ||
130 | Variant &operator=( const Variant &rhs ); | 130 | Variant &operator=( const Variant &rhs ); |
@@ -228,8 +228,8 @@ namespace Bu | |||
228 | 228 | ||
229 | Bu::Formatter &operator<<( Bu::Formatter &f, const Variant &v ); | 229 | Bu::Formatter &operator<<( Bu::Formatter &f, const Variant &v ); |
230 | 230 | ||
231 | template<> Bu::FString VariantType<int>::toString() const; | 231 | template<> Bu::String VariantType<int>::toString() const; |
232 | template<> Bu::FString VariantType<bool>::toString() const; | 232 | template<> Bu::String VariantType<bool>::toString() const; |
233 | }; | 233 | }; |
234 | 234 | ||
235 | #endif | 235 | #endif |
diff --git a/src/xmlreader.cpp b/src/xmlreader.cpp index 7da2755..ba7fb3d 100644 --- a/src/xmlreader.cpp +++ b/src/xmlreader.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
diff --git a/src/xmlreader.h b/src/xmlreader.h index 8533c1a..7cb44c9 100644 --- a/src/xmlreader.h +++ b/src/xmlreader.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2010 Xagasoft, All rights reserved. | 2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. |
3 | * | 3 | * |
4 | * This file is part of the libbu++ library and is released under the | 4 | * This file is part of the libbu++ library and is released under the |
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
@@ -8,7 +8,7 @@ | |||
8 | #ifndef BU_XML_READER_H | 8 | #ifndef BU_XML_READER_H |
9 | #define BU_XML_READER_H | 9 | #define BU_XML_READER_H |
10 | 10 | ||
11 | #include "bu/fstring.h" | 11 | #include "bu/string.h" |
12 | #include "bu/exceptionbase.h" | 12 | #include "bu/exceptionbase.h" |
13 | 13 | ||
14 | namespace Bu | 14 | namespace Bu |
@@ -27,8 +27,8 @@ namespace Bu | |||
27 | Stream &rInput; | 27 | Stream &rInput; |
28 | int iCurToken; | 28 | int iCurToken; |
29 | int iNextToken; | 29 | int iNextToken; |
30 | Bu::FString sBuf; | 30 | Bu::String sBuf; |
31 | Bu::FString sStr; | 31 | Bu::String sStr; |
32 | bool bIgnoreWS; | 32 | bool bIgnoreWS; |
33 | typedef struct StreamPos | 33 | typedef struct StreamPos |
34 | { | 34 | { |