remove logic for table name determination from cocoa

This commit is contained in:
Ari Lazier 2015-06-03 19:14:39 -07:00
parent 4b82701a9e
commit a82805548e
2 changed files with 13 additions and 0 deletions

View File

@ -303,3 +303,13 @@ bool ObjectStore::update_realm_with_schema(realm::Group *group,
return true;
}
ObjectStore::Schema ObjectStore::schema_from_group(Group *group) {
ObjectStore::Schema schema;
for (unsigned long i = 0; i < group->size(); i++) {
string object_type = object_type_for_table_name(group->get_table_name(i));
if (object_type.length()) {
schema.push_back(ObjectSchemaRef(new ObjectSchema(group, object_type)));
}
}
return schema;
}

View File

@ -53,6 +53,9 @@ namespace realm {
// get a table for an object type
static realm::TableRef table_for_object_type(Group *group, StringData object_type);
// get existing Schema from a group
static Schema schema_from_group(Group *group);
private:
// set a new schema version
static void set_schema_version(Group *group, uint64_t version);