Class TokyoCabinet::BDBCUR
In: tokyocabinet.c
tokyocabinet-doc.rb
Parent: Object
BDB\n[tokyocabinet-doc.rb\ntokyocabinet.c] FDB\n[tokyocabinet-doc.rb\ntokyocabinet.c] BDBCUR\n[tokyocabinet-doc.rb\ntokyocabinet.c] HDB\n[tokyocabinet-doc.rb\ntokyocabinet.c] TDB\n[tokyocabinet-doc.rb\ntokyocabinet.c] TDBQRY\n[tokyocabinet-doc.rb\ntokyocabinet.c] ADB\n[tokyocabinet-doc.rb\ntokyocabinet.c] BDBCUR_data ADB_data TDB_data HDB_data TDBQRY_data FDB_data BDB_data tokyocabinet-doc.rb tokyocabinet.c TokyoCabinet dot/m_19_0.png

Cursor is a mechanism to access each record of B+ tree database in ascending or descending order.%%

Methods

first   jump   key   last   new   next   out   prev   put   val  

Constants

CPCURRENT = INT2NUM(BDBCPCURRENT)
CPBEFORE = INT2NUM(BDBCPBEFORE)
CPAFTER = INT2NUM(BDBCPAFTER)
CPCURRENT = 0   cursor put mode: current
CPBEFORE = 1   cursor put mode: before
CPAFTER = 2   cursor put mode: after

Public Class methods

Create a cursor object.%% `bdb’ specifies the B+ tree database object.%% The return value is the new cursor object.%% Note that the cursor is available only after initialization with the `first’ or the `jump’ methods and so on. Moreover, the position of the cursor will be indefinite when the database is updated after the initialization of the cursor.%%

[Source]

     # File tokyocabinet-doc.rb, line 642
642:     def initialize(bdb)
643:       # (native code)
644:     end

Public Instance methods

Move the cursor to the first record.%% If successful, the return value is true, else, it is false. False is returned if there is no record in the database.%%

[Source]

     # File tokyocabinet-doc.rb, line 647
647:     def first()
648:       # (native code)
649:     end

Move the cursor to the front of records corresponding a key.%% `key’ specifies the key.%% If successful, the return value is true, else, it is false. False is returned if there is no record corresponding the condition.%% The cursor is set to the first record corresponding the key or the next substitute if completely matching record does not exist.%%

[Source]

     # File tokyocabinet-doc.rb, line 659
659:     def jump(key)
660:       # (native code)
661:     end

Get the key of the record where the cursor is.%% If successful, the return value is the key, else, it is `nil’. ‘nil’ is returned when the cursor is at invalid position.%%

[Source]

     # File tokyocabinet-doc.rb, line 688
688:     def key()
689:       # (native code)
690:     end

Move the cursor to the last record.%% If successful, the return value is true, else, it is false. False is returned if there is no record in the database.%%

[Source]

     # File tokyocabinet-doc.rb, line 652
652:     def last()
653:       # (native code)
654:     end

Move the cursor to the next record.%% If successful, the return value is true, else, it is false. False is returned if there is no next record.%%

[Source]

     # File tokyocabinet-doc.rb, line 669
669:     def next()
670:       # (native code)
671:     end

Remove the record where the cursor is.%% If successful, the return value is true, else, it is false. False is returned when the cursor is at invalid position.%% After deletion, the cursor is moved to the next record if possible.%%

[Source]

     # File tokyocabinet-doc.rb, line 683
683:     def out()
684:       # (native code)
685:     end

Move the cursor to the previous record.%% If successful, the return value is true, else, it is false. False is returned if there is no previous record.%%

[Source]

     # File tokyocabinet-doc.rb, line 664
664:     def prev()
665:       # (native code)
666:     end

Insert a record around the cursor.%% `value’ specifies the value.%% `cpmode’ specifies detail adjustment: `TokyoCabinet::BDBCUR::CPCURRENT’, which means that the value of the current record is overwritten, `TokyoCabinet::BDBCUR::CPBEFORE’, which means that the new record is inserted before the current record, `TokyoCabinet::BDBCUR::CPAFTER’, which means that the new record is inserted after the current record.%% If successful, the return value is true, else, it is false. False is returned when the cursor is at invalid position.%% After insertion, the cursor is moved to the inserted record.%%

[Source]

     # File tokyocabinet-doc.rb, line 677
677:     def put(value, cpmode)
678:       # (native code)
679:     end

Get the value of the record where the cursor is.%% If successful, the return value is the value, else, it is `nil’. ‘nil’ is returned when the cursor is at invalid position.%%

[Source]

     # File tokyocabinet-doc.rb, line 693
693:     def val()
694:       # (native code)
695:     end

[Validate]