[Plugin] jXML
#7

Quote:
Originally Posted by xeeZ
Посмотреть сообщение
I'm sorry but isn't this just a ripoff of another XML plugin's code?
Looks like the code was ripped from this.

scripting.cpp (Zeex's plugin):

pawn Код:
// native xml_get_string(XML:handle, const xpath[], result[], size = sizeof result);
static cell AMX_NATIVE_CALL n_xml_get_string(AMX *amx, cell *params)
{
    document_iterator i = documents.find(reinterpret_cast<pugi::xml_document*>(params[1]));

    if (i != documents.end())
    {
        char *xpath;
        amx_StrParam(amx, params[2], xpath);

        cell* addr;
        amx_GetAddr(amx, params[3], &addr);

        try
        {
            amx_SetString(addr, pugi::xpath_query(xpath).evaluate_string(*(i->first)).c_str(), 0, 0, params[4]);
            return 1;
        }
        catch (std::exception &e)
        {
            logprintf("XML exception: %s\n", e.what());
        }
    }
    return 0;
}
jXML.cpp (jXML plugin):

pawn Код:
static cell AMX_NATIVE_CALL plugin_xml_get_value_string(AMX *amx, cell *params) // native xml_get_value_string(XML:handle, const node[], destination[], size = sizeof destination);
{
    document_iterator doc = documents.find(reinterpret_cast<pugi::xml_document*>(params[1]));

    if (doc != documents.end())
    {
        char *node;
        amx_StrParam(amx, params[2], node);

        cell* addr;
        amx_GetAddr(amx, params[3], &addr);

        try
        {
            amx_SetString(addr, pugi::xpath_query(node).evaluate_string(*(doc->first)).c_str(), 0, 0, params[4]);
            return 1;
        }
        catch (std::exception &error)
        {
            logprintf("[jXML] Exception: %s\n", error.what());
        }
    }
    return 0;
}
Reply


Messages In This Thread
jXML - by J4Rr3x - 13.05.2015, 19:17
Re: jXML - by ranme15 - 13.05.2015, 20:11
Re: jXML - by Abagail - 13.05.2015, 20:32
Re: jXML - by J4Rr3x - 13.05.2015, 20:51
Re: jXML - by Crayder - 13.05.2015, 21:05
Re: jXML - by xeeZ - 14.05.2015, 02:30
Re: jXML - by Emmet_ - 14.05.2015, 02:42
Re: jXML - by J4Rr3x - 14.05.2015, 04:51

Forum Jump:


Users browsing this thread: 1 Guest(s)