Repository: realm/realm-swift
File: src/tightdb/objc/table.h (C/C++)

Code before:
 * table class, then this method returns nil. It also returns nil if
 * it encounters a memory allocation error (out of memory).
 *
 * The specified table class must be one that is declared by using
 * one of the table macros TIGHTDB_TABLE_*.
 */
-(id)castClass:(Class)obj;

/* Column meta info */
-(size_t)getColumnCount;
-(NSString *)getColumnName:(size_t)ndx;
-(size_t)getColumnIndex:(NSString *)name;
-(TightdbType)getColumnType:(size_t)ndx;
-(TightdbDescriptor *)getDescriptor;
-(TightdbDescriptor *)getDescriptorWithError:(NSError *__autoreleasing *)error;
-(BOOL)isEmpty;
-(size_t)count;
-(TightdbCursor *)addEmptyRow;

/* Only curser based add should be public. This is just a temporaray way to hide the methods. */
/* TODO: Move to class extension. */
-(size_t)_addEmptyRow;
-(size_t)_addEmptyRows:(size_t)rowCount;

-(BOOL)clear;
-(BOOL)removeRowAtIndex:(size_t)ndx;
-(BOOL)removeRowAtIndex:(size_t)ndx error:(NSError *__autoreleasing *)error;
-(BOOL)removeLastRow;
-(BOOL)removeLastRowWithError:(NSError *__autoreleasing *)error;

-(TightdbCursor *)cursorAtIndex:(size_t)ndx;
-(TightdbCursor *)cursorAtLastIndex;

-(TightdbCursor *)insertRowAtIndex:(size_t)ndx;

-(BOOL)insertRow:(size_t)ndx;
-(BOOL)insertRow:(size_t)ndx error:(NSError *__autoreleasing *)error;

-(BOOL)getBoolInColumn:(size_t)colNdx atRow:(size_t)ndx;
-(int64_t)getIntInColumn:(size_t)colNdx atRow:(size_t)ndx;
-(float)getFloatInColumn:(size_t)colNdx atRow:(size_t)ndx;
-(double)getDoubleInColumn:(size_t)colNdx atRow:(size_t)ndx;
-(time_t)getDateInColumn:(size_t)colNdx atRow:(size_t)ndx;
-(NSString *)getStringInColumn:(size_t)colNdx atRow:(size_t)ndx;
-(TightdbBinary *)getBinaryInColumn:(size_t)colNdx atRow:(size_t)ndx;
-(TightdbTable *)getTableInColumn:(size_t)colNdx atRow:(size_t)ndx;
-(id)getTableInColumn:(size_t)colNdx atRow:(size_t)ndx withClass:(Class)obj;
-(TightdbMixed *)getMixedInColumn:(size_t)colNdx atRow:(size_t)ndx;

-(void)setInt:(int64_t)value inColumn:(size_t)col_ndx atRow:(size_t)row_ndx;
-(void)setBool:(BOOL)value inColumn:(size_t)col_ndx atRow:(size_t)row_ndx;

Review comment (bug):
Strictly speaking this should be done in a different PR dealing with cleanup of the error handling, but I took the freedom to remove this wrongly used error while I was going over the method anyway


Code after:
 * table class, then this method returns nil. It also returns nil if
 * it encounters a memory allocation error (out of memory).
 *
 * The specified table class must be one that is declared by using
 * one of the table macros TIGHTDB_TABLE_*.
 */
-(id)castClass:(Class)obj;

/* Column meta info */
-(size_t)getColumnCount;
-(NSString *)getColumnName:(size_t)ndx;
-(size_t)getColumnIndex:(NSString *)name;
-(TightdbType)getColumnType:(size_t)ndx;
-(TightdbDescriptor *)getDescriptor;
-(TightdbDescriptor *)getDescriptorWithError:(NSError *__autoreleasing *)error;
-(BOOL)isEmpty;
-(size_t)count;
-(TightdbCursor *)addEmptyRow;

/* Only curser based add should be public. This is just a temporaray way to hide the methods. */
/* TODO: Move to class extension. */
-(size_t)_addEmptyRow;
-(size_t)_addEmptyRows:(size_t)rowCount;

-(BOOL)clear;
-(BOOL)removeRowAtIndex:(size_t)ndx;
-(BOOL)removeRowAtIndex:(size_t)ndx error:(NSError *__autoreleasing *)error;
-(BOOL)removeLastRow;
-(BOOL)removeLastRowWithError:(NSError *__autoreleasing *)error;

-(TightdbCursor *)objectAtIndexedSubscript:(NSUInteger)ndx; /* object subscripting */
-(TightdbCursor *)cursorAtIndex:(size_t)ndx;
-(TightdbCursor *)cursorAtLastIndex;

-(TightdbCursor *)insertRowAtIndex:(size_t)ndx;

-(BOOL)appendRow:(NSArray *)data;

-(BOOL)insertRow:(size_t)ndx;
-(BOOL)insertRow:(size_t)ndx error:(NSError *__autoreleasing *)error;

-(BOOL)getBoolInColumn:(size_t)colNdx atRow:(size_t)ndx;
-(int64_t)getIntInColumn:(size_t)colNdx atRow:(size_t)ndx;
-(float)getFloatInColumn:(size_t)colNdx atRow:(size_t)ndx;
-(double)getDoubleInColumn:(size_t)colNdx atRow:(size_t)ndx;
-(time_t)getDateInColumn:(size_t)colNdx atRow:(size_t)ndx;
-(NSString *)getStringInColumn:(size_t)colNdx atRow:(size_t)ndx;
-(TightdbBinary *)getBinaryInColumn:(size_t)colNdx atRow:(size_t)ndx;
-(TightdbTable *)getTableInColumn:(size_t)colNdx atRow:(size_t)ndx;
-(id)getTableInColumn:(size_t)colNdx atRow:(size_t)ndx withClass:(Class)obj;
-(TightdbMixed *)getMixedInColumn:(size_t)colNdx atRow:(size_t)ndx;