Ticket #10030 (closed defect: invalid)
wxConfigBase::Read() returns false "true"
| Reported by: | pmendl | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | base | Version: | 2.8.x |
| Keywords: | wxConfigBase Read | Cc: | |
| Blocked By: | Patch: | no | |
| Blocking: |
Description
Description: the following piece of code should list "url=<empty>" if key not found for the given entity. However, it lists many "url=" lines (and following processing shows url to be really empty as set to wxEmptyString in object constructor) and no "url=<empty>" line. If I am not missing some obvious thing it seems that wxConfigBase::Read() returns allways "true", even if key does not exist...
class cAbstractEntity
{
public:
//...
wxString url;
//...
protected:
//...
};
//...
wxFileConfig *conf;
cAbstractEntity *ae;
//...
// Other fields read properly, from the proper config path/section here
//...
if(conf->Read(wxT("URL"), &(ae->url)))
std::cout << "url=" << ae->url.mb_str() << std::endl;
else
std::cout << "url=<empty>" << std::endl;
I am open to any further tests you can see helpfull, just ask.
Change History
Note: See
TracTickets for help on using
tickets.
