Developer forums (C::B DEVELOPMENT STRICTLY!) > Plugins development
BlackDoc documentation plugin
Jenna:
On wx-dev they recommend to use std::string wherever possible, and use wxString only to interact with the gui.
--- Quote from: Vadim Zeitlin http://groups.google.com/group/wx-dev/msg/2790958146ff5665
---In general, my advice is very simple: do *not* use wxString for textual
manipulation. Use std::string or std::wstring for this and only use
wxString to get data to or from the GUI.
--- End quote ---
MortenMacFly:
--- Quote from: jens on April 22, 2012, 01:14:55 pm ---On wx-dev they recommend to use std::string wherever possible, and use wxString only to interact with the gui.
--- End quote ---
That's what I meant: either only STL or only wxString.
Mmmh... am I missing something here? Is there really a wx recommendation to use the STL methods of wxString instead of the wx ones? Can somebody enlighten me on this?
marked:
The use of std::string instead of wxString will increase the time of development, because std::string is missing some nice methods, like StartsWith/EndsWith, Replace(char* old, char* new, bool all = true) etc. It then will be necessary to implement this operations in my code. C::B SDK also wants wxString, so I decided to use it.
Also it is not very clear, how to add the support for unicode and non-unicode builds of wxWidgets while using std::string and std::wstring. Dealing with locales and convertions between them is a little bit tricky.
@MortenMacFly
I know only what I mentioned above. Here is the quote from wxString help page: "You may notice that wxString sometimes has many functions which do the same thing like, for example, Length(), Len() and length() which all return the string length. In all cases of such duplication the std::string-compatible method (length() in this case, always the lowercase version) should be used as it will ensure smoother transition to std::string when wxWidgets starts using it instead of wxString."
MortenMacFly:
--- Quote from: marked on April 22, 2012, 01:59:42 pm ---In all cases of such duplication the std::string-compatible method (length() in this case, always the lowercase version) should be used as it will ensure smoother transition to std::string when wxWidgets starts using it instead of wxString."
--- End quote ---
This is really new to me. I really can't believe there will be a day without wxString. This would literally affect every wx application on earth!
An btw, Jens:
--- Quote from: jens on April 22, 2012, 01:14:55 pm ---On wx-dev they recommend to use std::string wherever possible, and use wxString only to interact with the gui.
--- End quote ---
If you read further there is an answer of Julian Smart:
--- Quote ---This is possibly the scariest thing I've heard in 2012 so far. I use
wxString *extensively* for data storage and manipulation. All the time,
for almost every class I ever write.
[...]
Am I mad to be using wxString? Well, it's a bit late now that's for sure...
--- End quote ---
I clearly share his thoughts.
Edit: Well, having said that I continued to read how VZ is arguing against that... interesting. I didn't expect such a "battle" on one of these core classes of wxWidgets to be honest.
So well, still: If you are with VZ you should only use std::string and not mixed. ;-)
But we shouln't continue on that an longer as IMHO everything has been said (and I learned something new). Back to the topic: lets talk about the plugin.
Jenna:
--- Quote from: MortenMacFly on April 22, 2012, 02:04:15 pm ---So well, still: If you are with VZ you should only use std::string and not mixed. ;-)
--- End quote ---
The problem is, that many users find wxString in wx2.9 much slower as in 2.8.
That might be (and is most likely) the cause for the much slower cc with wx2.9.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version