History log of /haiku-fatelf/headers/os/support/String.h
Revision Date Author Comments
# ad07ecd8 16-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

BString::Private class to access BString internals


# 156ea481 16-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Add HashValue() methods to BString


# 85b41b15 07-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

* Added bool and double BString::operator<<() versions.
* Removed the clashing operator in JobSetupDlg. Automatic whitespace
cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42387 a95241bf-73f2-0310-859d-f6bbb57e9c96


# a928c3f0 13-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

operation <<(): Use the standard types [unsigned] long [long] instead of
[u]int32 and [u]int64 to avoid clashes with the int/unsigned int versions.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42165 a95241bf-73f2-0310-859d-f6bbb57e9c96


# b2d98439 12-Apr-2011 Jonas Sundström <jonas@kirilla.com>

Add BString::IsEmpty() method.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41242 a95241bf-73f2-0310-859d-f6bbb57e9c96


# a29fb938 01-Mar-2011 Jonas Sundström <jonas@kirilla.com>

Rename and a small simplification. Thanks, Clemens and Ingo.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40756 a95241bf-73f2-0310-859d-f6bbb57e9c96


# c9e27ada 27-Feb-2011 Jonas Sundström <jonas@kirilla.com>

Cleanup. Efficiency makerover.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40720 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 7581d0b2 26-Feb-2011 Jonas Sundström <jonas@kirilla.com>

BString::SetToArguments(). Forgot the header. :I

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40697 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 323e7fe5 12-Aug-2010 Rene Gollent <anevilyak@gmail.com>

Fix build error in IMAP client due to incorrect inequality check in one of BString's inlines. Fixes #6439.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38075 a95241bf-73f2-0310-859d-f6bbb57e9c96


# a5b7cbe3 31-Jan-2010 Michael Lotz <mmlr@mlotz.ch>

Adding utf-8 aware version of most functions to BString. They are named after
the corresponding normal functions but have a "Chars" in the name like
"MoveCharsInto" or "AppendChars". Also added CountBytes() and CharAt().
This should make everyday string handling with multibyte strings a bit easier.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35371 a95241bf-73f2-0310-859d-f6bbb57e9c96


# e90b90da 31-Jul-2009 Axel Dörfler <axeld@pinc-software.de>

* Added desperately missing Trim() method.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32035 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 1746066c 20-Jul-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

* Made _Allocate() static.
* Moved the private inline methods up in the source file, so they can actually
be inlined.
* UnlockBuffer(): Removed superfluous "if". Maybe the one who wrote it can have
a look and check whether something else was intended originally.
* _MakeWritable() (both versions): Removed the superfluous ref count increment
and the matching decrements.
* _Resize(): Fixed ref count ASSERT. It would always be triggered when called
from UnlockBuffer(), since the ref count is -1 in that case.
* Clarified some comments.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31662 a95241bf-73f2-0310-859d-f6bbb57e9c96


# ff293f20 01-Jul-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Added (const char*) cast operator. That makes BString more convenient to pass
around, particularly returning it from methods instead of a const char*, if the
object stores the string as a BString anyway, thus leveraging CoW.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31354 a95241bf-73f2-0310-859d-f6bbb57e9c96


# e52400cf 06-Jun-2009 Axel Dörfler <axeld@pinc-software.de>

* Fixed a race condition in the former _Detach*() functions: since atomic_get()
was used, two different threads could decide to share the same mutable string.
* Renamed some functions to make clearer what they do, ie. _Detach() is now
called _MakeWritable().
* Cleaned up some questionable semantics, like the const char* parameter in
_DetachWith() - you can now choose to copy the original string or not with
a boolean. This also makes sure that the string is actually copied when it
has to, which wasn't the case before (but that was no problem with the way
that function was used).
* Made the header compliant with our style guide.
* Further cleanup.
* All BString related unit tests are passed, so I guess I didn't break too
much :-)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30980 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 4b832620 10-Mar-2008 Axel Dörfler <axeld@pinc-software.de>

* _Realloc() did not initialize the reference count either.
* _Alloc() can now preserve the original reference count, only _Clone()
still initializes it to 1. As Karsten pointed out, this is necessary to
preserve the "shareable" status of the private data.
* I hope that's finally it. What happened to our testing suite, anyway? :-)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24355 a95241bf-73f2-0310-859d-f6bbb57e9c96


# bf4ddb61 10-Mar-2008 Axel Dörfler <axeld@pinc-software.de>

* As found by Karsten, the reference count was not initialized in
_ReplaceAtPositions(), and _DoCharacterEscape() (we don't need to preserve
it, though, as it must be 1).
* Factored out an _Alloc() method which is now always called when the private
data is allocated. It also takes care of correct initialization (and thus
fixes the above problem).
* This fix finally allows turning on reference counting again, thanks Karsten!
* Minor cleanup, renamed "oldAdr"/"newAdr" to "oldString", resp. "newString".


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24348 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 688c1426 10-Mar-2008 Axel Dörfler <axeld@pinc-software.de>

* After my last change, _IsShareable() was called on the wrong string in the
copy constructors, effectively turning of references completely.
* Since that caused troubles (NetPositive now crashes when started), I
temporarily disabled references by letting _IsShareable() always return
false until the issue is resolved.
* _FreePrivateData() now sets the fPrivateData member to NULL, and is also
safe to be called when fPrivateData is NULL.
* Removed my comment about the threading problem in _Detach() and _DetachWith()
as that just couldn't happen.
* _Clone() must not use memcpy() as the string pointed to by "data" might not
be as long as "length".
* LockBuffer() now marks a string as unshareable.
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24345 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 002b33b7 08-Mar-2008 Axel Dörfler <axeld@pinc-software.de>

* Fixed a bunch or concurreny bugs and memory leaks of the new reference
string stuff.
* It's still not thread-safe for all usage patterns, though, so we might want
to remove or disable it: if a string is shared between several threads, and
one of those starts to use a reference, all kinds of problems can happen.
* Some cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24312 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 93608e10 24-Feb-2008 Karsten Heimrich <host.haiku@gmx.de>

* fixed coding style...


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24103 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 576e2bf8 24-Feb-2008 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Patch by Julun: implements a refcounted BString. Thank You!


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24102 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 43cca04a 06-Jan-2007 Axel Dörfler <axeld@pinc-software.de>

Cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19731 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 5480b459 13-Nov-2003 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Another patch from Oliver Tappe: BString behaves better when the user supplies out-of bounds values in Insert(), Remove(), etc.
Code is refactored, and it fully complies with our guidelines.
Tests have been updated too (hint: try the replace tests with R5 and our implementation...)


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5348 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 67330a12 15-Feb-2003 Ingo Weinhold <ingo_weinhold@gmx.de>

Added missing _DoReplace().


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2718 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 769a8954 18-Nov-2002 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Corrected some inaccuracies imported from the BeOS headers:
CapitalizeEachWord() DOESN'T capitalize words separated by spaces, it
capitalizes words separated by non alphabethical characters.
FindLast(char, int32) prototype was misleading.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2008 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 1c5c50fc 27-Sep-2002 shatty <shatty@nowhere.fake>

fixed newline at end of file.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1215 a95241bf-73f2-0310-859d-f6bbb57e9c96


# a15ed5a1 26-Sep-2002 Stefano Ceccherini <stefano.ceccherini@gmail.com>

fixed a typo


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1193 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 6ad2c5a1 06-Sep-2002 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Added a first BString header


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@987 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 93779182 09-Jul-2002 Ingo Weinhold <ingo_weinhold@gmx.de>

This file shadows Be's header. So if it doesn't contain anything, iclude at least the original header.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@17 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 52a38012 08-Jul-2002 ejakowatz <ejakowatz@nowhere.fake>

It is accomplished ...


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10 a95241bf-73f2-0310-859d-f6bbb57e9c96


# ad07ecd82172564bbf3ecad2b9cdf6e7dd3747a6 16-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

BString::Private class to access BString internals


# 156ea481b3270fa156bf26c88b5cf571e97e7374 16-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Add HashValue() methods to BString


# 85b41b15d95ef86c0880faa6dcb0b35547328024 07-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

* Added bool and double BString::operator<<() versions.
* Removed the clashing operator in JobSetupDlg. Automatic whitespace
cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42387 a95241bf-73f2-0310-859d-f6bbb57e9c96


# a928c3f001e0919aa0f206ee35b60c6042861a20 13-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

operation <<(): Use the standard types [unsigned] long [long] instead of
[u]int32 and [u]int64 to avoid clashes with the int/unsigned int versions.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42165 a95241bf-73f2-0310-859d-f6bbb57e9c96


# b2d9843906fdaabca1237f6415533b0da1904765 12-Apr-2011 Jonas Sundström <jonas@kirilla.com>

Add BString::IsEmpty() method.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41242 a95241bf-73f2-0310-859d-f6bbb57e9c96


# a29fb9388d8f0fe48c526b6c582bcd02892f7ba9 01-Mar-2011 Jonas Sundström <jonas@kirilla.com>

Rename and a small simplification. Thanks, Clemens and Ingo.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40756 a95241bf-73f2-0310-859d-f6bbb57e9c96


# c9e27adabfc36772dd8b8c2b32a4b9233f58e07a 27-Feb-2011 Jonas Sundström <jonas@kirilla.com>

Cleanup. Efficiency makerover.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40720 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 7581d0b22480a1d61ac76d53b8ba9dc3c83d360d 26-Feb-2011 Jonas Sundström <jonas@kirilla.com>

BString::SetToArguments(). Forgot the header. :I

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40697 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 323e7fe56710901702a25563bc65595a311d8f8b 12-Aug-2010 Rene Gollent <anevilyak@gmail.com>

Fix build error in IMAP client due to incorrect inequality check in one of BString's inlines. Fixes #6439.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38075 a95241bf-73f2-0310-859d-f6bbb57e9c96


# a5b7cbe3318e316b14b06334c26800f46ac26f3d 31-Jan-2010 Michael Lotz <mmlr@mlotz.ch>

Adding utf-8 aware version of most functions to BString. They are named after
the corresponding normal functions but have a "Chars" in the name like
"MoveCharsInto" or "AppendChars". Also added CountBytes() and CharAt().
This should make everyday string handling with multibyte strings a bit easier.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35371 a95241bf-73f2-0310-859d-f6bbb57e9c96


# e90b90daf6315ab2650ea947cfaa55f86e859591 31-Jul-2009 Axel Dörfler <axeld@pinc-software.de>

* Added desperately missing Trim() method.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32035 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 1746066cde0af657e63ce6ca99e2331c7c6216c5 20-Jul-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

* Made _Allocate() static.
* Moved the private inline methods up in the source file, so they can actually
be inlined.
* UnlockBuffer(): Removed superfluous "if". Maybe the one who wrote it can have
a look and check whether something else was intended originally.
* _MakeWritable() (both versions): Removed the superfluous ref count increment
and the matching decrements.
* _Resize(): Fixed ref count ASSERT. It would always be triggered when called
from UnlockBuffer(), since the ref count is -1 in that case.
* Clarified some comments.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31662 a95241bf-73f2-0310-859d-f6bbb57e9c96


# ff293f209a92c434cf14cac86a4f8ab75bad9675 01-Jul-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Added (const char*) cast operator. That makes BString more convenient to pass
around, particularly returning it from methods instead of a const char*, if the
object stores the string as a BString anyway, thus leveraging CoW.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31354 a95241bf-73f2-0310-859d-f6bbb57e9c96


# e52400cf24d1a3c668a8f127e78b9e3226964cd0 06-Jun-2009 Axel Dörfler <axeld@pinc-software.de>

* Fixed a race condition in the former _Detach*() functions: since atomic_get()
was used, two different threads could decide to share the same mutable string.
* Renamed some functions to make clearer what they do, ie. _Detach() is now
called _MakeWritable().
* Cleaned up some questionable semantics, like the const char* parameter in
_DetachWith() - you can now choose to copy the original string or not with
a boolean. This also makes sure that the string is actually copied when it
has to, which wasn't the case before (but that was no problem with the way
that function was used).
* Made the header compliant with our style guide.
* Further cleanup.
* All BString related unit tests are passed, so I guess I didn't break too
much :-)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30980 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 4b83262008f3f368f2b4dd19b65a2552efa6f136 10-Mar-2008 Axel Dörfler <axeld@pinc-software.de>

* _Realloc() did not initialize the reference count either.
* _Alloc() can now preserve the original reference count, only _Clone()
still initializes it to 1. As Karsten pointed out, this is necessary to
preserve the "shareable" status of the private data.
* I hope that's finally it. What happened to our testing suite, anyway? :-)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24355 a95241bf-73f2-0310-859d-f6bbb57e9c96


# bf4ddb61e1d7e76bb4ac2c1c809ab007c7588d14 10-Mar-2008 Axel Dörfler <axeld@pinc-software.de>

* As found by Karsten, the reference count was not initialized in
_ReplaceAtPositions(), and _DoCharacterEscape() (we don't need to preserve
it, though, as it must be 1).
* Factored out an _Alloc() method which is now always called when the private
data is allocated. It also takes care of correct initialization (and thus
fixes the above problem).
* This fix finally allows turning on reference counting again, thanks Karsten!
* Minor cleanup, renamed "oldAdr"/"newAdr" to "oldString", resp. "newString".


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24348 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 688c14266c074ca6507884d55ca07260bc54a2b3 10-Mar-2008 Axel Dörfler <axeld@pinc-software.de>

* After my last change, _IsShareable() was called on the wrong string in the
copy constructors, effectively turning of references completely.
* Since that caused troubles (NetPositive now crashes when started), I
temporarily disabled references by letting _IsShareable() always return
false until the issue is resolved.
* _FreePrivateData() now sets the fPrivateData member to NULL, and is also
safe to be called when fPrivateData is NULL.
* Removed my comment about the threading problem in _Detach() and _DetachWith()
as that just couldn't happen.
* _Clone() must not use memcpy() as the string pointed to by "data" might not
be as long as "length".
* LockBuffer() now marks a string as unshareable.
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24345 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 002b33b7200207e2d72b35499e34675ee69de713 08-Mar-2008 Axel Dörfler <axeld@pinc-software.de>

* Fixed a bunch or concurreny bugs and memory leaks of the new reference
string stuff.
* It's still not thread-safe for all usage patterns, though, so we might want
to remove or disable it: if a string is shared between several threads, and
one of those starts to use a reference, all kinds of problems can happen.
* Some cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24312 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 93608e10d15a2fbafc1f3f5ce87bf72d06495db6 24-Feb-2008 Karsten Heimrich <host.haiku@gmx.de>

* fixed coding style...


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24103 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 576e2bf833a58f8948eca3fc65fdf7c10f2cfbc6 24-Feb-2008 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Patch by Julun: implements a refcounted BString. Thank You!


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24102 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 43cca04a9a7d68c5510667a0bc7eab0322a66cb2 06-Jan-2007 Axel Dörfler <axeld@pinc-software.de>

Cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19731 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 5480b4590e267957b90b79736b3990ddd39459a3 13-Nov-2003 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Another patch from Oliver Tappe: BString behaves better when the user supplies out-of bounds values in Insert(), Remove(), etc.
Code is refactored, and it fully complies with our guidelines.
Tests have been updated too (hint: try the replace tests with R5 and our implementation...)


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5348 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 67330a126799e077ecbe5a28752439b0541a540d 15-Feb-2003 Ingo Weinhold <ingo_weinhold@gmx.de>

Added missing _DoReplace().


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2718 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 769a89545028226bc60b236d0be9c4345cd79ddf 18-Nov-2002 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Corrected some inaccuracies imported from the BeOS headers:
CapitalizeEachWord() DOESN'T capitalize words separated by spaces, it
capitalizes words separated by non alphabethical characters.
FindLast(char, int32) prototype was misleading.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2008 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 1c5c50fc822de2e63bed2c361abbb7038fe7aeb1 27-Sep-2002 shatty <shatty@nowhere.fake>

fixed newline at end of file.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1215 a95241bf-73f2-0310-859d-f6bbb57e9c96


# a15ed5a14ad97feacf3bf5c08e1cb18861e3d87f 26-Sep-2002 Stefano Ceccherini <stefano.ceccherini@gmail.com>

fixed a typo


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1193 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 6ad2c5a19cdd4593cb3fb6e72f504d84de5c29bb 06-Sep-2002 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Added a first BString header


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@987 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 9377918226cf2059def937e5d63faa291017c869 09-Jul-2002 Ingo Weinhold <ingo_weinhold@gmx.de>

This file shadows Be's header. So if it doesn't contain anything, iclude at least the original header.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@17 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 52a380120846174213ccce9c4aab0dda17c72083 08-Jul-2002 ejakowatz <ejakowatz@nowhere.fake>

It is accomplished ...


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10 a95241bf-73f2-0310-859d-f6bbb57e9c96