ext/filegdb/geodatabase.cpp in filegdb-0.0.6 vs ext/filegdb/geodatabase.cpp in filegdb-1.0.0

- old
+ new

@@ -1,6 +1,5 @@ - #include "geodatabase.hpp" #include "table.hpp" namespace filegdb { @@ -93,11 +92,11 @@ if (FGDB_IS_FAILURE(hr)) { FGDB_RAISE_ERROR(hr); return Qnil; } - db->_value = NULL; + db->_value = Qnil; return Qnil; } VALUE geodatabase::create_table(VALUE self, VALUE table_name, VALUE table_definition) { @@ -226,11 +225,11 @@ } VALUE result = rb_ary_new(); for (std::vector<wstring>::iterator it = children.begin(); it != children.end(); ++it) { - VALUE name = rb_str_new2(to_char_array(*it)); + VALUE name = rb_str_new2(to_string(*it).c_str()); rb_ary_push(result, name); } return result; } @@ -310,11 +309,11 @@ return Qnil; } VALUE result = rb_ary_new(); - for (typename std::vector<string>::iterator it = definitions.begin(); it != definitions.end(); ++it) { + for (std::vector<string>::iterator it = definitions.begin(); it != definitions.end(); ++it) { rb_ary_push(result, rb_str_new2((*it).c_str())); } return result; } @@ -338,11 +337,11 @@ return Qnil; } VALUE result = rb_ary_new(); - for (typename std::vector<string>::iterator it = definitions.begin(); it != definitions.end(); ++it) { + for (std::vector<string>::iterator it = definitions.begin(); it != definitions.end(); ++it) { rb_ary_push(result, rb_str_new2((*it).c_str())); } return result; } @@ -359,12 +358,12 @@ return Qnil; } VALUE result = rb_ary_new(); - for (typename std::vector<wstring>::iterator it = datasetTypes.begin(); it != datasetTypes.end(); ++it) { - rb_ary_push(result, rb_str_new2(to_char_array(*it))); + for (std::vector<wstring>::iterator it = datasetTypes.begin(); it != datasetTypes.end(); ++it) { + rb_ary_push(result, rb_str_new2(to_string(*it).c_str())); } return result; } @@ -380,12 +379,12 @@ return Qnil; } VALUE result = rb_ary_new(); - for (typename std::vector<wstring>::iterator it = datasetTypes.begin(); it != datasetTypes.end(); ++it) { - rb_ary_push(result, rb_str_new2(to_char_array(*it))); + for (std::vector<wstring>::iterator it = datasetTypes.begin(); it != datasetTypes.end(); ++it) { + rb_ary_push(result, rb_str_new2(to_string(*it).c_str())); } return result; } @@ -408,12 +407,12 @@ return Qnil; } VALUE result = rb_ary_new(); - for (typename std::vector<wstring>::iterator it = datasets.begin(); it != datasets.end(); ++it) { - rb_ary_push(result, rb_str_new2(to_char_array(*it))); + for (std::vector<wstring>::iterator it = datasets.begin(); it != datasets.end(); ++it) { + rb_ary_push(result, rb_str_new2(to_string(*it).c_str())); } return result; } @@ -491,10 +490,10 @@ if (FGDB_IS_FAILURE(hr)) { FGDB_RAISE_ERROR(hr); return Qnil; } - return rb_str_new2(to_char_array(result)); + return rb_str_new2(to_string(result).c_str()); } void geodatabase::define(VALUE module) { geodatabase::_klass = rb_define_class_under(module, "Geodatabase", rb_cObject);