X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fc2171bd4c660b8554dae2a1cbf34ff09f3032a6..683b60e9ab1a059913d02d4bddf9e5dbc697967a:/docs/latex/wx/tstring.tex diff --git a/docs/latex/wx/tstring.tex b/docs/latex/wx/tstring.tex index 58b7dde136..fa25faee5e 100644 --- a/docs/latex/wx/tstring.tex +++ b/docs/latex/wx/tstring.tex @@ -2,7 +2,7 @@ Classes: \helpref{wxString}{wxstring}, \helpref{wxArrayString}{wxarraystring}, \helpref{wxStringTokenizer}{wxstringtokenizer} -\subsection{Introduction} +\subsection{Introduction}\label{introductiontowxstring} wxString is a class which represents a character string of arbitrary length (limited by {\it MAX\_INT} which is usually 2147483647 on 32 bit machines) and containing @@ -22,7 +22,7 @@ replacing and both C-like \helpref{Printf()}{wxstringprintf} and stream-like insertion functions as well as much more - see \helpref{wxString}{wxstring} for a list of all functions. -\subsection{Comparison of wxString to other string classes} +\subsection{Comparison of wxString to other string classes}\label{otherstringclasses} The advantages of using a special string class instead of working directly with C strings are so obvious that there is a huge number of such classes available. @@ -131,7 +131,7 @@ strings inside the function faster because of strings should return {\it wxString} - this makes it safe to return local variables. -\subsection{Other string related functions and classes} +\subsection{Other string related functions and classes}\label{relatedtostring} As most programs use character strings, the standard C library provides quite a few functions to work with them. Unfortunately, some of them have rather @@ -167,20 +167,8 @@ vastly better from a performance point of view than a wxObjectArray of wxStrings \subsection{Reference counting and why you shouldn't care about it}\label{wxstringrefcount} -wxString objects use a technique known as {\it copy on write} (COW). This means -that when a string is assigned to another, no copying really takes place: only -the reference count on the shared string data is incremented and both strings -share the same data. - -But as soon as one of the two (or more) strings is modified, the data has to be -copied because the changes to one of the strings shouldn't be seen in the -others. As data copying only happens when the string is written to, this is -known as COW. - -What is important to understand is that all this happens absolutely -transparently to the class users and that whether a string is shared or not is -not seen from the outside of the class - in any case, the result of any -operation on it is the same. +All considerations for wxObject-derived \helpref{reference counted}{trefcount} objects +are valid also for wxString, even if it does not derive from wxObject. Probably the unique case when you might want to think about reference counting is when a string character is taken from a string which is not a