Beispiel #1
0
string DictJSONGenerator::genSection(string section_name, string sql)
{
    string json = {"\0"};
    Field *field;

    shared_ptr<QueryResult> qres(db->queryNA(sql.c_str()));
    if (!qres.get())
        return "";
    json += "\"";
    json += section_name;
    json += "\":[";
    do
    {
        field = qres->fetch();
        json += "{\"obj\":[";
        for (uint i = 0; i < qres->getFieldCount(); ++i)
        {
            json += "\"";
            json += field[i].getString();
            json += "\"";
            if (i != qres->getFieldCount() - 1)
                json += ",";
        }
        json += "]},";
    }
    while (qres->nextRow());
    json.erase(json.length() - 1, 1);
    json += "],";
    return json;
}
Beispiel #2
0
      veca<T,3>			    inv_rot_vec(const vecn<T,3>& v)	const
                            { veca<T,3> qres( m_quat * Quaternion<T>(v.x(),v.y(),v.z(),T(0)) * m_quat.conjugated() );
						      return qres;
						    }