Exemplo n.º 1
0
 /* {{{ MySQL_ArtResultSet::absolute() -I- */
 bool
 MySQL_ArtResultSet::absolute(const int row)
 {
     CPP_ENTER("MySQL_ArtResultSet::absolute");
     checkValid();
     if (row > 0) {
         if (row > (int) num_rows) {
             afterLast();
         }
         else {
             row_position = row;
             seek();
             return true;
         }
     }
     else if (row < 0) {
         if ((-row) > (int) num_rows) {
             beforeFirst();
         }
         else {
             row_position = num_rows - (-row)  + 1;
             seek();
             return true;
         }
     }
     else {
         /* According to the JDBC book, absolute(0) means before the result set */
         beforeFirst();
     }
     return (row_position > 0 && row_position < (num_rows + 1));
 }
void ChartDataCollector::setupConnections()
{
	m_chartValues.clear();
	m_otherValue.value=0;
	if (m_chartDataSource!=FromStaticData && m_query.length() && findQuery(m_query))
	{
		findQuery(m_query)->disconnect();
		connect(findQuery(m_query),SIGNAL(afterFirst()),SLOT(collectData()));
		connect(findQuery(m_query),SIGNAL(afterNext()),SLOT(collectData()));
		connect(findQuery(m_query),SIGNAL(afterPrevious()),SLOT(collectData()));
		connect(findQuery(m_query),SIGNAL(afterLast()),SLOT(collectData()));
	}
}
Exemplo n.º 3
0
        /* {{{ MySQL_ArtResultSet::relative() -I- */
        bool
        MySQL_ArtResultSet::relative(const int rows)
        {
            CPP_ENTER("MySQL_ArtResultSet::relative");
            checkValid();
            if (rows != 0) {
                if ((row_position + rows) > num_rows || (row_position + rows) < 1) {
                    rows > 0 ? afterLast() : beforeFirst(); /* after last or before first */
                }
                else {
                    row_position += rows;
                    seek();
                }
            }

            return (row_position > 0 && row_position <= num_rows);
        }
Exemplo n.º 4
0
 /* {{{ MySQL_ArtResultSet::next() -I- */
 bool
 MySQL_ArtResultSet::next()
 {
     CPP_ENTER("MySQL_ArtResultSet::next");
     checkValid();
     bool ret = false;
     if (isLast()) {
         afterLast();
     }
     else if (row_position == 0) {
         first();
         ret = true;
     }
     else if (row_position > 0 && row_position < num_rows) {
         ++current_record;
         ++row_position;
         ret = true;
     }
     CPP_INFO_FMT("row_position=%llu num_rows=%llu", row_position, num_rows);
     return ret;
 }
Exemplo n.º 5
0
 Zstring getFileShortName(const Zstring& itemPathImpl) const override { return afterLast(itemPathImpl, FILE_NAME_SEPARATOR, IF_MISSING_RETURN_ALL); }