Developer forums (C::B DEVELOPMENT STRICTLY!) > Plugins development
BlackDoc documentation plugin
MortenMacFly:
--- Quote from: Alpha on April 22, 2012, 05:24:42 am ---Yes; compiled and tested on XP with the project file from my previous post.
--- End quote ---
But only, if hijacking the PCH chain.
To be correct: It would need some patches to work, but these are mainly missing includes. So nothing to worry about.
However, what I aalso noticed:
you are using wxString but then you are doing something like this:
--- Code: --- // const wxString &data is defined
size_t pos = data.find(m_pathsSeparator);
if(wxNOT_FOUND == pos)
--- End code ---
For a better style you should rather not use the STL version of find() but the wx one wxString provides. Especially if you compare with a wx constant (wxNOT_FOUND) afterwards. Either all wx or all STL... ;)
oBFusCATed:
The correct code (I think) is:
--- Code: ---wxString::size_type pos=str.find(...);
if (pos==wxString::npos) {
....
}
--- End code ---
MortenMacFly:
--- Quote from: oBFusCATed on April 22, 2012, 11:29:33 am ---The correct code (I think) is:
--- Code: ---wxString::size_type pos=str.find(...);
if (pos==wxString::npos) {
....
}
--- End code ---
--- End quote ---
True, if you insist on using the STL compatibility layer of wxString. But then again why using wxString at all? If wxString is not needed, STL string will surely perform better.
Edit: BTW: I though more in a direction of wxString::Contains(...) or alike.
oBFusCATed:
http://docs.wxwidgets.org/stable/wx_wxstring.html#wxstringcontains
marked:
Things turned even simpler: i just replaced the std::unique_ptr with the 'old bad' std::auto_ptr.
The use of gnu++0x flag is no more necessary. Sources are updated. Please, test them again. I hope, old GCC will be happy :)
MortenMacFly:
Yes, thank you for finding this mistake. I was changing the code to work the stl way and I've forgot some wxNOT_FOUND's. Now they are replaced in the way oBFusCATed suggested.
I deal with wxString the stl way wherever it is possible, because wxWidgets help is proposing this, for future compatibility etc. It is pointed exactly at the top of this doc
http://docs.wxwidgets.org/stable/wx_wxstring.html
Contains() returns the bool value, and in most cases I later need the start position of occurance to obtain substring.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version