public method IO2GMessagesTable.getNextRowByColumnValue

Brief

Gets the next row from IO2GMessagesTable based on the column value.

Declaration
C++
virtual bool  getNextRowByColumnValue (const char *columnID, const void *columnValueAsVariant, IO2GTableIterator &iterator, IO2GMessageTableRow *&row) = 0

Parameters
columnID

The name of a column in the Messages table. For example, From.

columnValueAsVariant

The value of the column specified by the columnId parameter. For example, if you want to search the Messages table for messages from a specific sender only, the columnId parameter value is From, the columnValue parameter value is the sender's login ID.

iterator

The table iterator.

row

[out] The row fetched.

Details

This method allows finding all rows that contain the specified column value.
If the row is not found, the method returns false

Example

Get messages from a specific sender [hide]

    O2G2Ptr<IO2GMessagesTable> messagesTable = (IO2GMessagesTable *)tableManager->getTable(Messages);
    bool found = false;
    IO2GTableIterator iterator;
    IO2GMessageTableRow *message = NULL;
    while (messagesTable->getNextRowByColumnValue("From", mSender.c_str(), iterator, message))
    {
        found = true;
        std::cout << "MessageID: " << message->getMsgID() <<
                     " From = " << message->getFrom() <<
                     " Text = " << message->getText() << std::endl;
        message->release();
    }
    if (!found)
        std::cout << "You don't have any messages sent by " << mSender << "." << std::endl;

Declared in IO2GMessagesTable

back