add new API to cursor.

Signed-off-by: Daogang Tang <daogangtang@gmail.com>