Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

addRow rename to addEmptyRow #13

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions doc/changes.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
30-October-2013:
================
! addRow() renamed to addEmptyRow()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

addRows() renamed to addEmptyRows()

2 changes: 1 addition & 1 deletion doc/ref/data/dyn_table_ref.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ CATEGORIES :
DESCR : The cursor.

- g_dyn_table_add_empty_row:
NAME : addRow
NAME : addEmptyRow
SUMMARY : *objc_typed_table_add_empty_row_summary
DESCR : *objc_typed_table_add_empty_row_descr
SIGNATURE: -(TightdbCursor *)addRow
Expand Down
8 changes: 4 additions & 4 deletions doc/ref/examples/ex_objc_query_dynamic_intro.m
Original file line number Diff line number Diff line change
Expand Up @@ -26,31 +26,31 @@ int main()

// Row 0

cursor = [table addRow];
cursor = [table addEmptyRow];

[cursor setInt:23 inColumn:AGE];
[cursor setString:@"Joe" inColumn:NAME];
[cursor setBool:YES inColumn:HIRED];

// Row 1

cursor = [table addRow];
cursor = [table addEmptyRow];

[cursor setInt:32 inColumn:AGE];
[cursor setString:@"Simon" inColumn:NAME];
[cursor setBool:YES inColumn:HIRED];

// Row 2

cursor = [table addRow];
cursor = [table addEmptyRow];

[cursor setInt:12 inColumn:AGE];
[cursor setString:@"Steve" inColumn:NAME];
[cursor setBool:NO inColumn:HIRED];

// Row 3

cursor = [table addRow];
cursor = [table addEmptyRow];

[cursor setInt:59 inColumn:AGE];
[cursor setString:@"Nick" inColumn:NAME];
Expand Down
8 changes: 4 additions & 4 deletions doc/ref/examples/ex_objc_table_dynamic_intro.m
Original file line number Diff line number Diff line change
Expand Up @@ -22,28 +22,28 @@ int main()

// Row 0

cursor = [table addRow];
cursor = [table addEmptyRow];

[cursor setInt:23 inColumn:AGE];
[cursor setString:@"Joe" inColumn:NAME];

// Row 1

cursor = [table addRow];
cursor = [table addEmptyRow];

[cursor setInt:32 inColumn:AGE];
[cursor setString:@"Simon" inColumn:NAME];

// Row 2

cursor = [table addRow];
cursor = [table addEmptyRow];

[cursor setInt:12 inColumn:AGE];
[cursor setString:@"Steve" inColumn:NAME];

// Row 3

cursor = [table addRow];
cursor = [table addEmptyRow];

[cursor setInt:100 inColumn:AGE];
[cursor setString:@"Nick" inColumn:NAME];
Expand Down
6 changes: 3 additions & 3 deletions doc/ref/examples/ex_objc_table_typed_intro.m
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ int main()

PeopleTable *table = [[PeopleTable alloc] init];

PeopleTable_Cursor *cursor = [table addRow];
PeopleTable_Cursor *cursor = [table addEmptyRow];
cursor.Name = @"Brian";
cursor.Age = 10;

cursor = [table addRow];
cursor = [table addEmptyRow];
cursor.Name = @"Sofie";
cursor.Age = 40;

[table addOrInsertRowAtIndex:[table count]
[table insertRowAtIndex:[table count]
Name:@"Jesper"
Age:200];

Expand Down
8 changes: 4 additions & 4 deletions doc/ref/examples/ex_objc_tableview_dynamic_intro.m
Original file line number Diff line number Diff line change
Expand Up @@ -26,31 +26,31 @@ int main()

// Row 0

cursor = [table addRow];
cursor = [table addEmptyRow];

[cursor setInt:23 inColumn:AGE];
[cursor setString:@"Joe" inColumn:NAME];
[cursor setBool:YES inColumn:HIRED];

// Row 1

cursor = [table addRow];
cursor = [table addEmptyRow];

[cursor setInt:32 inColumn:AGE];
[cursor setString:@"Simon" inColumn:NAME];
[cursor setBool:YES inColumn:HIRED];

// Row 2

cursor = [table addRow];
cursor = [table addEmptyRow];

[cursor setInt:12 inColumn:AGE];
[cursor setString:@"Steve" inColumn:NAME];
[cursor setBool:NO inColumn:HIRED];

// Row 3

cursor = [table addRow];
cursor = [table addEmptyRow];

[cursor setInt:59 inColumn:AGE];
[cursor setString:@"Nick" inColumn:NAME];
Expand Down
6 changes: 3 additions & 3 deletions doc/ref/examples/ex_objc_tableview_typed_intro.m
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ int main()

// Adds rows to the table.

PeopleTable_Cursor *cursor = [table addRow];
PeopleTable_Cursor *cursor = [table addEmptyRow];
cursor.Name = @"Brian";
cursor.Age = 10;

cursor = [table addRow];
cursor = [table addEmptyRow];
cursor.Name = @"Sofie";
cursor.Age = 40;

cursor = [table addRow];
cursor = [table addEmptyRow];
cursor.Name = @"Sam";
cursor.Age = 76;

Expand Down
10 changes: 5 additions & 5 deletions src/tightdb/objc/table.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,12 @@
-(TightdbSpec *)getSpecWithError:(NSError *__autoreleasing *)error;
-(BOOL)isEmpty;
-(size_t)count;
-(TightdbCursor *)addRow;
-(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)_addRow;
-(size_t)_addRows:(size_t)rowCount;
-(size_t)_addEmptyRow;
-(size_t)_addEmptyRows:(size_t)rowCount;

-(BOOL)clear;
-(BOOL)clearWithError:(NSError *__autoreleasing *)error;
Expand All @@ -135,8 +135,8 @@

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

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

-(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;
Expand Down
16 changes: 8 additions & 8 deletions src/tightdb/objc/table_objc.mm
Original file line number Diff line number Diff line change
Expand Up @@ -646,12 +646,12 @@ -(size_t)count
return _table->size();
}

-(TightdbCursor *)addRow
-(TightdbCursor *)addEmptyRow
{
return [[TightdbCursor alloc] initWithTable:self ndx:[self _addRow]];
return [[TightdbCursor alloc] initWithTable:self ndx:[self _addEmptyRow]];
}

-(size_t)_addRow
-(size_t)_addEmptyRow
{
// TODO: Use a macro or er function for error handling

Expand All @@ -677,7 +677,7 @@ -(size_t)_addRow
}


-(size_t)_addRows:(size_t)rowCount
-(size_t)_addEmptyRows:(size_t)rowCount
{
// TODO: Use a macro or er function for error handling

Expand Down Expand Up @@ -717,16 +717,16 @@ -(TightdbCursor *)cursorAtLastIndex

-(TightdbCursor *)insertRowAtIndex:(size_t)ndx
{
[self insertRow:ndx];
[self insertEmptyRow:ndx];
return [[TightdbCursor alloc] initWithTable:self ndx:ndx];
}

-(BOOL)insertRow:(size_t)ndx
-(BOOL)insertEmptyRow:(size_t)ndx
{
return [self insertRow:ndx error:nil];
return [self insertEmptyRow:ndx error:nil];
}

-(BOOL)insertRow:(size_t)ndx error:(NSError *__autoreleasing *)error
-(BOOL)insertEmptyRow:(size_t)ndx error:(NSError *__autoreleasing *)error
{
if (_readOnly) {
if (error)
Expand Down
4 changes: 2 additions & 2 deletions src/tightdb/objc/test/functional.m
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ - (void)testTypedCursor

// Add rows
for (int i = 0; i < TABLE_SIZE; i++) {
cursor = [table addRow];
cursor = [table addEmptyRow];
cursor.Name = [@"Person_" stringByAppendingString: [NSString stringWithFormat:@"%d",i]];
cursor.Age = i;
cursor.Hired = i%2 == 0;
Expand Down Expand Up @@ -162,7 +162,7 @@ - (void)testDynamicCursor

// Add rows
for (int i = 0; i < TABLE_SIZE; i++) {
cursor = [table addRow];
cursor = [table addEmptyRow];
[cursor setString:[@"Person_" stringByAppendingString: [NSString stringWithFormat:@"%d",i]] inColumn:NAME];
[cursor setInt:i inColumn:AGE];
[cursor setBool:i%2 == 0 inColumn:HIRED];
Expand Down
6 changes: 3 additions & 3 deletions src/tightdb/objc/test/group_misc_2.m
Original file line number Diff line number Diff line change
Expand Up @@ -216,17 +216,17 @@ - (void)testSubtables
int COL_SUBTABLE_INT = 0;

// Add a row to the top level table
[table addRow];
[table addEmptyRow];
[table setInt:700 inColumn:COL_TABLE_INT atRow:0];

// Add two rows to the subtable

TightdbTable *subtable = [table getTableInColumn:COL_TABLE_TAB atRow:0];

[subtable addRow];
[subtable addEmptyRow];

[subtable setInt:800 inColumn:COL_SUBTABLE_INT atRow:0];
[subtable addRow];
[subtable addEmptyRow];
[subtable setInt:801 inColumn:COL_SUBTABLE_INT atRow:1];

// Make the mixed values column contain another subtable
Expand Down
4 changes: 2 additions & 2 deletions src/tightdb/objc/test/query.m
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ - (void) testDynamic
TightdbBinary *bin2 = [[TightdbBinary alloc] initWithData:bin size:sizeof bin];

// Using private method just for the sake of testing the setters below.
[table _addRows:2];
[table _addEmptyRows:2];

[table setBool:YES inColumn:BOOL_COL atRow:0];
[table setBool:NO inColumn:BOOL_COL atRow:1];
Expand Down Expand Up @@ -255,7 +255,7 @@ - (void)testFind
{
TightdbTable *table = [[TightdbTable alloc]init];
[table addColumnWithType:tightdb_Int andName:@"IntCol"];
[table _addRows:6];
[table _addEmptyRows:6];

[table setInt:10 inColumn:0 atRow:0];
[table setInt:42 inColumn:0 atRow:1];
Expand Down
14 changes: 7 additions & 7 deletions src/tightdb/objc/test/table.m
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ - (void)testTable
//[_table set:0 ndx:ndx value:0];
//[_table set:1 ndx:ndx value:10];

TightdbCursor *cursor = [_table addRow];
TightdbCursor *cursor = [_table addEmptyRow];
size_t ndx = [cursor index];
[cursor setInt:0 inColumn:0];
[cursor setInt:10 inColumn:1];
Expand Down Expand Up @@ -94,12 +94,12 @@ - (void)testDataTypes_Typed

TestTableAllTypes_Cursor *c;

c = [table addRow];
c = [table addEmptyRow];

c.BoolCol = NO ; c.IntCol = 54 ; c.FloatCol = 0.7 ; c.DoubleCol = 0.8 ; c.StringCol = @"foo";
c.BinaryCol = bin1 ; c.DateCol = 0 ; c.TableCol = subtab1 ; c.MixedCol = mixInt1 ;

c = [table addRow];
c = [table addEmptyRow];

c.BoolCol = YES ; c.IntCol = 506 ; c.FloatCol = 7.7 ; c.DoubleCol = 8.8 ; c.StringCol = @"banach";
c.BinaryCol = bin2 ; c.DateCol = timeNow ; c.TableCol = subtab2 ; c.MixedCol = mixSubtab ;
Expand Down Expand Up @@ -193,12 +193,12 @@ - (void)testDataTypes_Dynamic



cursor = [subtab1 addRow];
cursor = [subtab1 addEmptyRow];
[cursor setInt:200 inColumn:0];



cursor = [subtab2 addRow];
cursor = [subtab2 addEmptyRow];
[cursor setInt:100 inColumn:0];


Expand All @@ -210,7 +210,7 @@ - (void)testDataTypes_Dynamic



c = [table addRow];
c = [table addEmptyRow];



Expand All @@ -224,7 +224,7 @@ - (void)testDataTypes_Dynamic
[c setTable: subtab1 inColumn:TableCol];
[c setMixed: mixInt1 inColumn:MixedCol];

c = [table addRow];
c = [table addEmptyRow];

[c setBool: YES inColumn:BoolCol];
[c setInt: 506 inColumn:IntCol];
Expand Down
Loading