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

Column type rename #43

Merged
merged 12 commits into from
Feb 7, 2013
Merged
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
1 change: 1 addition & 0 deletions TightDB.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -599,6 +599,7 @@
<ClInclude Include="src\tightdb\column_string_enum.hpp" />
<ClInclude Include="src\tightdb\column_table.hpp" />
<ClInclude Include="src\tightdb\column_tpl.hpp" />
<ClInclude Include="src\tightdb\data_type.hpp" />
<ClInclude Include="src\tightdb\column_type.hpp" />
<ClInclude Include="src\tightdb\config.h" />
<ClInclude Include="src\tightdb\date.hpp" />
Expand Down
3 changes: 3 additions & 0 deletions TightDB.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,9 @@
<ClInclude Include="src\tightdb\column_tpl.hpp">
<Filter>src\include</Filter>
</ClInclude>
<ClInclude Include="src\tightdb\data_type.hpp">
<Filter>src\include</Filter>
</ClInclude>
<ClInclude Include="src\tightdb\column_type.hpp">
<Filter>src\include</Filter>
</ClInclude>
Expand Down
7 changes: 7 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ Format:
==================


2013-02-06 (Kristian Spangsege)
+ New enum DataType replaces ColumnType throughout the public API.


2013-01-27 (Kristian Spangsege)
+ New Group::Group(unattached_tag) added. Same for SharedGroup.
+ New Group::open(...) methods added. Same for SharedGroup.
Expand All @@ -25,6 +29,7 @@ Format:
- Group::set_shared() removed.
- SharedGroup::is_valid() removed. Errors are now reported as exceptions from the constructor.


2013-01-11 (Kristian Spangsege)
+ Simplified open-mode for Group constructor.
- Group::is_valid() removed. Errors are now reported as exceptions from the constructor.
Expand All @@ -37,10 +42,12 @@ Format:
+ Mixed::set_int() added (same for other value types except subtables).
+ Removed two-argument Mixed constructor for binary data since its signature is expected to be used for strings that are not zero-terminated.


2013-01-08 (Brian Munkholm)
----------
+ New: Added a bunch of methods to support two new column types: float and double.


2012-12-16 (Kristian Spangsege)
----------
+ my_table[i].foo.get() added for all column types except subtables. This is to avoid having to repeat the explicit column type in cast expressions when the actual value is needed.
Expand Down
4 changes: 2 additions & 2 deletions doc/Tutorial/dyntable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ using namespace std;
int main(int argc, char *argv[]) {
Table t;

t.add_column(COLUMN_TYPE_STRING, "name");
t.add_column(type_String, "name");
size_t name_ndx = t.get_column_index("name");

t.add_empty_row();
Expand All @@ -18,7 +18,7 @@ int main(int argc, char *argv[]) {
t.set_string(name_ndx, 1, "Joe");

// forgot about age
t.add_column(COLUMN_TYPE_INT, "age");
t.add_column(type_Int, "age");
size_t age_ndx = t.get_column_index("age");
t.set_int(age_ndx, 0, 32);
t.set_int(age_ndx, 1, 18);
Expand Down
6 changes: 3 additions & 3 deletions doc/ref_cpp/data/dyn_table_ref.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ CATEGORIES :
TYPES : size_t
DESCR : The column index.
RETURN:
TYPES : ColumnType
TYPES : DataType
DESCR : The column type.
EXAMPLES:
- CODE : ex_cpp_dyn_table_get_column_type
Expand Down Expand Up @@ -354,7 +354,7 @@ CATEGORIES :
const char* get_string(size_t column_ndx, size_t row_ndx) const;
BinaryData get_binary(size_t column_ndx, size_t row_ndx) const;
Mixed get_mixed(size_t column_ndx, size_t row_ndx) const;
ColumnType get_mixed_type(size_t column_ndx, size_t row_ndx) const
DataType get_mixed_type(size_t column_ndx, size_t row_ndx) const

TableRef get_subtable(size_t column_ndx, size_t row_ndx);
ConstTableRef get_subtable(size_t column_ndx, size_t row_ndx) const;
Expand All @@ -367,7 +367,7 @@ CATEGORIES :
TYPES : size_t
DESCR : The row index.
RETURN:
TYPES : [bool, int64_t, time_t, const char*, BinaryData, Mixed, ColumnType]
TYPES : [bool, int64_t, time_t, const char*, BinaryData, Mixed, DataType]
DESCR : The value.
EXAMPLES:
- CODE : ex_cpp_dyn_table_get_xxx
Expand Down
4 changes: 2 additions & 2 deletions doc/ref_cpp/data/dyn_view_ref.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ CATEGORIES :
const char* get_string(size_t column_ndx, size_t row_ndx) const;
BinaryData get_binary(size_t column_ndx, size_t row_ndx) const;
Mixed get_mixed(size_t column_ndx, size_t row_ndx) const;
ColumnType get_mixed_type(size_t column_ndx, size_t row_ndx) const
DataType get_mixed_type(size_t column_ndx, size_t row_ndx) const
TableRef get_subtable(size_t column_ndx, size_t row_ndx);
ConstTableRef get_subtable(size_t column_ndx, size_t row_ndx) const;
CONST : True
Expand All @@ -198,7 +198,7 @@ CATEGORIES :
TYPES : size_t
DESCR : The row index.
RETURN:
TYPES : [bool, int64_t, time_t, const char*, BinaryData, Mixed, ColumnType, TableRef, ConstTableRef]
TYPES : [bool, int64_t, time_t, const char*, BinaryData, Mixed, DataType, TableRef, ConstTableRef]
DESCR : The value.
EXAMPLES:
- CODE : ex_cpp_dyn_view_get_xxx
Expand Down
2 changes: 1 addition & 1 deletion doc/ref_cpp/data/mixed_ref.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ CATEGORIES:
This method retrieves the real type of a Mixed variable.
CONST : True
RETURN:
TYPES : ColumnType
TYPES : DataType
DESCR : The type.
EXAMPLES:
- CODE : ex_cpp_mixed_get_type
Expand Down
4 changes: 2 additions & 2 deletions doc/ref_cpp/data/typed_view_ref.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ CATEGORIES :
const char* get_string(size_t row_ndx) const;
BinaryData get_binary(size_t row_ndx) const;
Mixed get_mixed(size_t row_ndx) const;
ColumnType get_mixed_type(size_t row_ndx) const
DataType get_mixed_type(size_t row_ndx) const
TableRef get_subtable(size_t row_ndx);
ConstTableRef get_subtable(size_t row_ndx) const;
CONST : True
Expand All @@ -137,7 +137,7 @@ CATEGORIES :
TYPES : size_t
DESCR : The row index.
RETURN:
TYPES : [bool, int64_t, time_t, const char*, BinaryData, Mixed, ColumnType, TableRef, ConstTableRef]
TYPES : [bool, int64_t, time_t, const char*, BinaryData, Mixed, DataType, TableRef, ConstTableRef]
DESCR : The value.
EXAMPLES:
- CODE : ex_cpp_typed_view_get_xxx
Expand Down
6 changes: 3 additions & 3 deletions doc/ref_cpp/examples/ex_query_dynamic_avg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ int main()
TableRef table = group.get_table("test");

Spec& s = table->get_spec();
s.add_column(COLUMN_TYPE_STRING, "Name");
s.add_column(COLUMN_TYPE_INT, "Age");
s.add_column(type_String, "Name");
s.add_column(type_Int, "Age");
table->update_from_spec();

table->add_empty_row(3);
Expand All @@ -44,4 +44,4 @@ int main()
assert(avg == (27 + 44) / 2.0);
// @@EndShow@@
}
// @@EndExample@@
// @@EndExample@@
4 changes: 2 additions & 2 deletions doc/ref_cpp/examples/ex_query_dynamic_beginswith.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ int main()
TableRef table = group.get_table("test");

Spec& s = table->get_spec();
s.add_column(COLUMN_TYPE_STRING, "Name");
s.add_column(type_String, "Name");
table->update_from_spec();

table->add_empty_row(5);
Expand Down Expand Up @@ -41,4 +41,4 @@ int main()
#endif
// @@EndShow@@
}
// @@EndExample@@
// @@EndExample@@
6 changes: 3 additions & 3 deletions doc/ref_cpp/examples/ex_query_dynamic_between.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ int main()
TableRef table = group.get_table("test");

Spec& s = table->get_spec();
s.add_column(COLUMN_TYPE_STRING, "name");
s.add_column(COLUMN_TYPE_INT, "age");
s.add_column(type_String, "name");
s.add_column(type_Int, "age");
table->update_from_spec();

table->add_empty_row();
Expand All @@ -46,4 +46,4 @@ int main()
assert(!strcmp(view.get_string(0, 1), "Peter"));
// @@EndShow@@
}
// @@EndExample@@
// @@EndExample@@
2 changes: 1 addition & 1 deletion doc/ref_cpp/examples/ex_query_dynamic_constructor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ int main()
Query q = table->where();
// @@EndShow@@
}
// @@EndExample@@
// @@EndExample@@
4 changes: 2 additions & 2 deletions doc/ref_cpp/examples/ex_query_dynamic_contains.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ int main()
TableRef table = group.get_table("test");

Spec& s = table->get_spec();
s.add_column(COLUMN_TYPE_STRING, "Name");
s.add_column(type_String, "Name");
table->update_from_spec();

table->add_empty_row(5);
Expand Down Expand Up @@ -39,4 +39,4 @@ int main()
#endif
// @@EndShow@@
}
// @@EndExample@@
// @@EndExample@@
2 changes: 1 addition & 1 deletion doc/ref_cpp/examples/ex_query_dynamic_count.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ int main()
assert(count3 == 1);
}
// @@EndFold@@
// @@EndExample@@
// @@EndExample@@
6 changes: 3 additions & 3 deletions doc/ref_cpp/examples/ex_query_dynamic_delete.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ int main()
TableRef table = group.get_table("test");

Spec& s = table->get_spec();
s.add_column(COLUMN_TYPE_STRING, "name");
s.add_column(COLUMN_TYPE_INT, "age");
s.add_column(type_String, "name");
s.add_column(type_Int, "age");
table->update_from_spec();

table->add_empty_row();
Expand All @@ -48,4 +48,4 @@ int main()
assert(table->size() == 1);
// @@EndShow@@
}
// @@EndExample@@
// @@EndExample@@
4 changes: 2 additions & 2 deletions doc/ref_cpp/examples/ex_query_dynamic_endswith.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ int main()
TableRef table = group.get_table("test");

Spec& s = table->get_spec();
s.add_column(COLUMN_TYPE_STRING, "Name");
s.add_column(type_String, "Name");
table->update_from_spec();

table->add_empty_row(5);
Expand Down Expand Up @@ -41,4 +41,4 @@ int main()
#endif
// @@EndShow@@
}
// @@EndExample@@
// @@EndExample@@
12 changes: 6 additions & 6 deletions doc/ref_cpp/examples/ex_query_dynamic_equal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ int main()
TableRef table = group.get_table("test");

Spec& s = table->get_spec();
s.add_column(COLUMN_TYPE_STRING, "name");
s.add_column(COLUMN_TYPE_INT, "age");
s.add_column(COLUMN_TYPE_BOOL, "male");
s.add_column(COLUMN_TYPE_DATE, "hired");
s.add_column(COLUMN_TYPE_BINARY, "photo");
s.add_column(type_String, "name");
s.add_column(type_Int, "age");
s.add_column(type_Bool, "male");
s.add_column(type_Date, "hired");
s.add_column(type_Binary, "photo");
table->update_from_spec();

// @@EndFold@@
Expand Down Expand Up @@ -54,4 +54,4 @@ int main()
assert(view5.size() == 1 && !strcmp(view5.get_string(0, 0), "Mary"));
}
// @@EndFold@@
// @@EndExample@@
// @@EndExample@@
6 changes: 3 additions & 3 deletions doc/ref_cpp/examples/ex_query_dynamic_find_all.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ int main()
TableRef table = group.get_table("test");

Spec& s = table->get_spec();
s.add_column(COLUMN_TYPE_STRING, "name");
s.add_column(COLUMN_TYPE_INT, "age");
s.add_column(type_String, "name");
s.add_column(type_Int, "age");
table->update_from_spec();

table->add_empty_row();
Expand Down Expand Up @@ -54,4 +54,4 @@ int main()
assert(!strcmp(view.get_string(0, 1), "Peter"));
// @@EndShow@@
}
// @@EndExample@@
// @@EndExample@@
6 changes: 3 additions & 3 deletions doc/ref_cpp/examples/ex_query_dynamic_find_next.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ int main()
TableRef table = group.get_table("test");

Spec& s = table->get_spec();
s.add_column(COLUMN_TYPE_STRING, "name");
s.add_column(COLUMN_TYPE_INT, "age");
s.add_column(type_String, "name");
s.add_column(type_Int, "age");
table->update_from_spec();

table->add_empty_row();
Expand Down Expand Up @@ -53,4 +53,4 @@ int main()
assert(match == size_t(-1));
// @@EndShow@@
}
// @@EndExample@@
// @@EndExample@@
6 changes: 3 additions & 3 deletions doc/ref_cpp/examples/ex_query_dynamic_greater.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ int main()
TableRef table = group.get_table("test");

Spec& s = table->get_spec();
s.add_column(COLUMN_TYPE_STRING, "name");
s.add_column(COLUMN_TYPE_INT, "age");
s.add_column(type_String, "name");
s.add_column(type_Int, "age");
table->update_from_spec();

table->add_empty_row();
Expand All @@ -46,4 +46,4 @@ int main()
assert(!strcmp(view.get_string(0, 1), string("Peter")));
// @@EndShow@@
}
// @@EndExample@@
// @@EndExample@@
6 changes: 3 additions & 3 deletions doc/ref_cpp/examples/ex_query_dynamic_greater_equal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ int main()
TableRef table = group.get_table("test");

Spec& s = table->get_spec();
s.add_column(COLUMN_TYPE_STRING, "name");
s.add_column(COLUMN_TYPE_INT, "age");
s.add_column(type_String, "name");
s.add_column(type_Int, "age");
table->update_from_spec();

table->add_empty_row();
Expand All @@ -46,4 +46,4 @@ int main()
assert(!strcmp(view.get_string(0, 1), "Peter"));
// @@EndShow@@
}
// @@EndExample@@
// @@EndExample@@
6 changes: 3 additions & 3 deletions doc/ref_cpp/examples/ex_query_dynamic_group.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ int main()
TableRef table = group.get_table("test");

Spec& s = table->get_spec();
s.add_column(COLUMN_TYPE_STRING, "name");
s.add_column(COLUMN_TYPE_INT, "age");
s.add_column(type_String, "name");
s.add_column(type_Int, "age");
table->update_from_spec();

table->add_empty_row();
Expand Down Expand Up @@ -57,4 +57,4 @@ int main()
assert(!strcmp(view.get_string(0, 2), "Alice"));
// @@EndShow@@
}
// @@EndExample@@
// @@EndExample@@
6 changes: 3 additions & 3 deletions doc/ref_cpp/examples/ex_query_dynamic_intro.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ int main()
TableRef table = group.get_table("test");

Spec& s = table->get_spec();
s.add_column(COLUMN_TYPE_STRING, "name");
s.add_column(COLUMN_TYPE_INT, "age");
s.add_column(type_String, "name");
s.add_column(type_Int, "age");
table->update_from_spec();

table->add_empty_row();
Expand All @@ -45,4 +45,4 @@ int main()
assert(!strcmp(view.get_string(0, 0), "Peter"));
// @@EndShow@@
}
// @@EndExample@@
// @@EndExample@@
Loading