/sqlite3cc

To get this branch, use:
bzr branch http://bzr.ed.am/sqlite3cc

« back to all changes in this revision

Viewing changes to include/sqlite3cc/row.h

  • Committer: edam
  • Date: 2010-07-29 21:00:36 UTC
  • Revision ID: edam@waxworlds.org-20100729210036-7me19mqc1iqo34pm
- failed to update TODO in last commit

Show diffs side-by-side

added added

removed removed

Lines of Context:
60
60
 
61
61
        /**
62
62
         * Constructor that produces a valid row.
63
 
         * @param the handle of the statement (query) that created this row
64
 
         * @oaram the result index that is this row
 
63
         * @param handle of the statement (query) that created this row
 
64
         * @oaram row_number the index of this row
65
65
         */
66
66
        explicit row(
67
67
                sqlite3_stmt *handle,
68
 
                unsigned long long index );
 
68
                unsigned long long row_number );
69
69
 
70
70
        /**
71
71
         * Constructor that produces an invalid row.
72
 
         * @param the handle of the statement (query) that created this row
73
72
         */
74
73
        explicit row();
75
74
 
81
80
         * Determine if this row is valid or not. If it is not valid, there are no
82
81
         * more rows in the results of the query.
83
82
         */
84
 
        inline operator bool() const
85
 
        {
86
 
                return _index != std::numeric_limits< unsigned long long >::max();
87
 
        }
 
83
        operator bool() const;
88
84
 
89
85
        /**
90
86
         * get the index in to the results that is this row
91
87
         * @return index
92
88
         */
93
 
        inline unsigned long long index()
 
89
        inline unsigned long long row_number()
94
90
        {
95
 
                return _index;
 
91
                return _row_number;
96
92
        }
97
93
 
98
94
        /**
170
166
        row &operator >>(
171
167
                detail::set_index_t t );
172
168
 
 
169
        /**
 
170
         * Test to see if two rows are the same
 
171
         * @param other the row to compare this one to
 
172
         * @return true if they are
 
173
         */
 
174
        bool operator ==(
 
175
                const row &other )
 
176
                const;
 
177
 
173
178
//______________________________________________________________________________
174
179
//                                                                implementation
175
180
protected:
176
181
 
177
 
        /** the query's handle */
 
182
        /** the query's handle, or NULL */
178
183
        sqlite3_stmt *_handle;
179
184
 
180
185
private:
183
188
        unsigned int _column_index;
184
189
 
185
190
        /** the index of this row */
186
 
        unsigned long long _index;
 
191
        unsigned long long _row_number;
187
192
 
188
193
};
189
194