• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/ap/gpl/amule/wxWidgets-2.8.12/docs/latex/wx/

Lines Matching refs:to

16 This class has all the standard operations you can expect to find in a string class:
17 dynamic memory management (string extends to accommodate new characters),
19 access to individual characters, string concatenation and comparison, substring
25 \subsection{Comparison of wxString to other string classes}\label{otherstringclasses}
29 The most important advantage is the need to always
30 remember to allocate/free memory for C strings; working with fixed size buffers almost
31 inevitably leads to buffer overflows. At last, C++ has a standard string class
37 \item {\bf Efficiency} This class was made to be as efficient as possible: both
41 which may be enabled to fine tune the memory allocation strategy for your
43 \item {\bf Compatibility} This class tries to combine almost full compatibility
44 with the old wxWidgets 1.xx wxString class, some reminiscence to MFC CString
52 \item {\bf Unicode} wxString is Unicode friendly: it allows to easily convert
53 to and from ANSI and Unicode strings in any build mode (see the
54 \helpref{Unicode overview}{unicode} for more details) and maps to either
58 conversions of objects of any other string class (including std::string) to
63 that there are often several functions to do exactly the same thing: for
64 example, to get the length of the string either one of
69 question is: which one is better to use? And the answer is that:
72 both make your code more familiar to other C++ programmers (who are supposed to
79 try to use the new wxString methods and not the old wxWidgets 1.xx variants
84 Probably the main trap with using this class is the implicit conversion operator to
86 instead to clearly indicate when the conversion is done. Specifically, the
90 // this function converts the input string to uppercase, output it to the screen
102 There are two nasty bugs in these three lines. First of them is in the call to the
103 {\it printf()} function. Although the implicit conversion to C strings is applied
110 because the argument of {\it puts()} is known to be of the type {\it const char *},
114 the most likely result is a program crash. The solution is to use
122 used again, so the code compiles, but as it returns a pointer to a buffer
123 belonging to a local variable which is deleted as soon as the function exits,
124 its contents is totally arbitrary. The solution to this problem is also easy:
127 This leads us to the following general advice: all functions taking string
128 arguments should take {\it const wxString\&} (this makes assignment to the
131 strings should return {\it wxString} - this makes it safe to return local
137 a few functions to work with them. Unfortunately, some of them have rather
140 to them will probably lead to program crash). Moreover, some very useful
141 functions are not standard at all. This is why in addition to all wxString
142 functions, there are also a few global string functions which try to correct
163 is just a version of the "template" dynamic array class which is specialized to work
173 Probably the unique case when you might want to think about reference
175 constant (or a constant reference). In this case, due to C++ rules, the
180 call to this operator may modify the string, its data is unshared (COW is done)
187 string arguments to your functions are passed as {\it const wxString\&} (see the
194 absolutely not necessary to read for using wxString class. Please skip it unless
200 memory needed for each string. Instead, it adds a small amount of space to each
201 allocated block which allows it to not reallocate memory (a relatively
203 subsequently adding one character at a time to it, as for example in:
223 lead to very bad performance in this case because there would be as many memory
225 much extra memory would help to improve the speed in this situation, but due to
229 The very best solution in precisely this case would be to use
230 \helpref{Alloc()}{wxstringalloc} function to preallocate, for example, len bytes
231 from the beginning - this will lead to exactly one memory allocation being
234 However, using Alloc() is tedious and so wxString tries to do its best. The
237 nothing is lost if the amount of memory to allocate is rounded up to the next
244 EXTRA\_ALLOC} in the file string.cpp during compilation (be sure to understand
246 it to greater amount (say twice nLen) or to 0 (to see performance degradation
248 you will probably find it helpful to also define WXSTRING\_STATISTICS symbol
249 which tells the wxString class to collect performance statistics and to show
257 It goes without saying that a profiler should be used to measure the precise
258 difference the change to EXTRA\_ALLOC makes to your program.