Where could I find the TAnsiString implementation that was once posted on Embarcadero Forums? I am trying to learn how to implement COW and reference counting.

Where could I find the TAnsiString implementation that was once posted on Embarcadero Forums? I am trying to learn how to implement COW and reference counting.

Thanks

Comments

  1. From different types, the assignment is handled with the implicit operator. From same type, it is a record copy, just a few bytes. The COW handles the rest, so there are no memory clashes.

    The real use of this library is not included here. A large library for communication I/O written in TP, where the different protocols are using either ansi characters or bytes (as short strings), is still used to a large extent in Delphi and TP. To make the library compatible with the Unicode Delphi2009+ and the changed AnsiString, it was needed to base the code on a type similar to TAnsiString.

    ReplyDelete
  2. Leif Uneus Could this be adopted for UTF-8/16 aswell?

    ReplyDelete
  3. Well, it is possible to adopt to use for UTF-8. I think Rudy Velthuis made that transition, but I'm not sure if he ever published the code. If that is done, it would be possible to exchange data fully with UTF16.

    ReplyDelete

Post a Comment