using date:ParseDate(value, wx.wxString_const_iterator()) 

seems to work but looking into the run time we see that the pointer to the 
iterator is a bad pointer not very desirable.

supporting a single argument seems preferable.
The following code works.

static int LUACALL wxLua_wxDateTime_ParseDate(lua_State *L)
{
    // wxString date
    wxString date = wxlua_getwxStringtype(L, 2);
    // wxString::const_iterator end
    wxString::const_iterator * end;
        if (lua_type(L, 3) == LUA_TNONE)
                // missing argument
                end = &(wxString::const_iterator)date.end();
        else
                end = (wxString::const_iterator *)wxluaT_getuserdatatype(L, 3, 
wxluatype_wxString_const_iterator);

but a similar change would be needed for each function expecting an optional 
iterator.

currently wxlua_getwxStringtype does not seem to handle a missing argument.
If it returned NULL we could trigger on the result.

maybe a special function 
   end = GetOptionalIterator(L, 3, date);
which returns the_iterator || &date.end() could be used.

Andre


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
wxlua-users mailing list
wxlua-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxlua-users

Reply via email to