filegdb 0.0.6 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (36) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +1 -0
  3. data/README.md +2 -2
  4. data/ext/filegdb/base.hpp +3 -4
  5. data/ext/filegdb/double_primitive.cpp +0 -1
  6. data/ext/filegdb/extconf.rb +0 -44
  7. data/ext/filegdb/field_info.cpp +1 -2
  8. data/ext/filegdb/filegdb.hpp +4 -4
  9. data/ext/filegdb/filegdb/include/FileGDBAPI.h +4 -1
  10. data/ext/filegdb/filegdb/include/FileGDBCore.h +4 -1
  11. data/ext/filegdb/filegdb/include/Geodatabase.h +319 -291
  12. data/ext/filegdb/filegdb/include/GeodatabaseManagement.h +1 -1
  13. data/ext/filegdb/filegdb/include/Raster.h +1 -1
  14. data/ext/filegdb/filegdb/include/Row.h +175 -5
  15. data/ext/filegdb/filegdb/include/Table.h +300 -296
  16. data/ext/filegdb/filegdb/include/Util.h +24 -15
  17. data/ext/filegdb/filegdb/include/make.include +39 -29
  18. data/ext/filegdb/filegdb/lib/libFileGDBAPI.dylib +0 -0
  19. data/ext/filegdb/filegdb/lib/libFileGDBAPI.so +0 -0
  20. data/ext/filegdb/filegdb/lib/libfgdbunixrtl.dylib +0 -0
  21. data/ext/filegdb/filegdb/lib/libfgdbunixrtl.so +0 -0
  22. data/ext/filegdb/geodatabase.cpp +11 -12
  23. data/ext/filegdb/integer_primitive.cpp +0 -1
  24. data/ext/filegdb/multi_part_shape_buffer.cpp +0 -1
  25. data/ext/filegdb/multi_point_shape_buffer.cpp +0 -1
  26. data/ext/filegdb/point.cpp +0 -1
  27. data/ext/filegdb/point_shape_buffer.cpp +0 -1
  28. data/ext/filegdb/row.cpp +1 -2
  29. data/ext/filegdb/shape_buffer.cpp +0 -1
  30. data/ext/filegdb/spatial_reference.cpp +1 -2
  31. data/ext/filegdb/table.cpp +0 -1
  32. data/ext/filegdb/util.cpp +10 -5
  33. data/filegdb.gemspec +1 -1
  34. data/lib/filegdb/version.rb +1 -1
  35. data/spec/geodatabase_spec.rb +2 -2
  36. metadata +4 -4
@@ -3,7 +3,7 @@
3
3
  //
4
4
 
5
5
  /*
6
- COPYRIGHT � 2012 ESRI
6
+ COPYRIGHT � 2015 ESRI
7
7
  TRADE SECRETS: ESRI PROPRIETARY AND CONFIDENTIAL
8
8
  Unpublished material - all rights reserved under the
9
9
  Copyright Laws of the United States and applicable international
@@ -3,7 +3,7 @@
3
3
  //
4
4
 
5
5
  /*
6
- COPYRIGHT � 2012 ESRI
6
+ COPYRIGHT � 2015 ESRI
7
7
  TRADE SECRETS: ESRI PROPRIETARY AND CONFIDENTIAL
8
8
  Unpublished material - all rights reserved under the
9
9
  Copyright Laws of the United States and applicable international
@@ -3,7 +3,7 @@
3
3
  //
4
4
 
5
5
  /*
6
- COPYRIGHT � 2012 ESRI
6
+ COPYRIGHT � 2015 ESRI
7
7
  TRADE SECRETS: ESRI PROPRIETARY AND CONFIDENTIAL
8
8
  Unpublished material - all rights reserved under the
9
9
  Copyright Laws of the United States and applicable international
@@ -65,19 +65,35 @@ public:
65
65
  /// Indicates whether the specified field contains a null value.
66
66
  /// If the field does not exist, this will fail with an error code of -2147219885 (An expected Field
67
67
  /// was not found or could not be retrieved properly).
68
- /// @param[in] field The field to check for a null value.
68
+ /// @param[in] field The name of the field to check for a null value.
69
69
  /// @param[out] isNull Indicates whether the specified field contains a null value.
70
70
  /// @return Error code indicating whether the method finished successfully.
71
71
  fgdbError IsNull(const std::wstring& field, bool& isNull) const;
72
72
 
73
+ /// Indicates whether the specified field contains a null value.
74
+ /// If the field does not exist, this will fail with an error code of -2147219885 (An expected Field
75
+ /// was not found or could not be retrieved properly).
76
+ /// @param[in] fieldNumber The number of the field to check for a null value.
77
+ /// @param[out] isNull Indicates whether the specified field contains a null value.
78
+ /// @return Error code indicating whether the method finished successfully.
79
+ fgdbError IsNull(int fieldNumber, bool& isNull) const;
80
+
73
81
  /// Assigns a null value to the specified field.
74
82
  /// If the field does not exist, this will fail with an error code of -2147219885 (An expected Field was not
75
83
  /// found or could not be retrieved properly).
76
84
  /// If the field is not nullable, this will fail with an error code of -2147219879 (The field is not nullable).
77
- /// @param[in] field The field to set as null.
85
+ /// @param[in] field The name of the field to set as null.
78
86
  /// @return Error code indicating whether the method finished successfully.
79
87
  fgdbError SetNull(const std::wstring& field);
80
88
 
89
+ /// Assigns a null value to the specified field.
90
+ /// If the field does not exist, this will fail with an error code of -2147219885 (An expected Field was not
91
+ /// found or could not be retrieved properly).
92
+ /// If the field is not nullable, this will fail with an error code of -2147219879 (The field is not nullable).
93
+ /// @param[in] fieldNumber The number of the field to set as null.
94
+ /// @return Error code indicating whether the method finished successfully.
95
+ fgdbError SetNull(int fieldNumber);
96
+
81
97
  /// Gets the row's Object ID.
82
98
  /// If the row's table does not have an Object ID column, this will fail with an error code of -2147219885
83
99
  /// (An expected Field was not found or could not be retrieved properly).
@@ -119,6 +135,15 @@ public:
119
135
  /// @return Error code indicating whether the method finished successfully.
120
136
  fgdbError GetShort(const std::wstring& field, short& value) const;
121
137
 
138
+ /// Gets a short value from the specified field.
139
+ /// If the field does not exist, this will fail with an error code of -2147219885 (An expected Field was not found or could not be retrieved properly).
140
+ /// If the field is has an incompatible data type, this will fail with an error code of -2147217395 (The value type is incompatible with the field type).
141
+ /// If the field contains a null value, this will fail with an error code of E_FAIL.
142
+ /// @param[in] fieldNumber The number of the field to get the value from.
143
+ /// @param[out] value The field's value.
144
+ /// @return Error code indicating whether the method finished successfully.
145
+ fgdbError GetShort(int fieldNumber, short& value) const;
146
+
122
147
  /// Assigns a short value to the specified field.
123
148
  /// If the field does not exist, this will fail with an error code of -2147219885 (An expected Field was not found or could not be retrieved properly).
124
149
  /// If the field has an incompatible data type, this will fail with an error code of -2147217395 (The value type is incompatible with the field type).
@@ -127,6 +152,14 @@ public:
127
152
  /// @return Error code indicating whether the method finished successfully.
128
153
  fgdbError SetShort(const std::wstring& field, short value);
129
154
 
155
+ /// Assigns a short value to the specified field.
156
+ /// If the field does not exist, this will fail with an error code of -2147219885 (An expected Field was not found or could not be retrieved properly).
157
+ /// If the field has an incompatible data type, this will fail with an error code of -2147217395 (The value type is incompatible with the field type).
158
+ /// @param[in] fieldNumber The number of the field to assign the value to.
159
+ /// @param[out] value The value to assign to the field.
160
+ /// @return Error code indicating whether the method finished successfully.
161
+ fgdbError SetShort(int fieldNumber, short value);
162
+
130
163
  /// Gets an integer value from the specified field.
131
164
  /// If the field does not exist, this will fail with an error code of -2147219885 (An expected Field was not found or could not be retrieved properly).
132
165
  /// If the field has an incompatible data type, this will fail with an error code of -2147217395 (The value type is incompatible with the field type).
@@ -136,6 +169,15 @@ public:
136
169
  /// @return Error code indicating whether the method finished successfully.
137
170
  fgdbError GetInteger(const std::wstring& field, int32& value) const;
138
171
 
172
+ /// Gets an integer value from the specified field.
173
+ /// If the field does not exist, this will fail with an error code of -2147219885 (An expected Field was not found or could not be retrieved properly).
174
+ /// If the field has an incompatible data type, this will fail with an error code of -2147217395 (The value type is incompatible with the field type).
175
+ /// If the field contains a null value, this will fail with an error code of E_FAIL.
176
+ /// @param[in] fieldNumber The number of the field to get the value from.
177
+ /// @param[out] value The field's value.
178
+ /// @return Error code indicating whether the method finished successfully.
179
+ fgdbError GetInteger(int fieldNumber, int32& value) const;
180
+
139
181
  /// Assigns an integer value to the specified field.
140
182
  /// If the field does not exist, this will fail with an error code of -2147219885 (An expected Field was not found or could not be retrieved properly).
141
183
  /// If the field has an incompatible data type, this will fail with an error code of -2147217395 (The value type is incompatible with the field type).
@@ -144,6 +186,14 @@ public:
144
186
  /// @return Error code indicating whether the method finished successfully.
145
187
  fgdbError SetInteger(const std::wstring& field, int32 value);
146
188
 
189
+ /// Assigns an integer value to the specified field.
190
+ /// If the field does not exist, this will fail with an error code of -2147219885 (An expected Field was not found or could not be retrieved properly).
191
+ /// If the field has an incompatible data type, this will fail with an error code of -2147217395 (The value type is incompatible with the field type).
192
+ /// @param[in] fieldNumber The number of the field to assign the value to.
193
+ /// @param[in] value The value to assign to the field.
194
+ /// @return Error code indicating whether the method finished successfully.
195
+ fgdbError SetInteger(int fieldNumber, int32 value);
196
+
147
197
  /// Gets a float value from the specified field.
148
198
  /// If the field does not exist, this will fail with an error code of -2147219885 (An expected Field was not found or could not be retrieved properly).
149
199
  /// If the field has an incompatible data type, this will fail with an error code of -2147217395 (The value type is incompatible with the field type).
@@ -153,6 +203,15 @@ public:
153
203
  /// @return Error code indicating whether the method finished successfully.
154
204
  fgdbError GetFloat(const std::wstring& field, float& value) const;
155
205
 
206
+ /// Gets a float value from the specified field.
207
+ /// If the field does not exist, this will fail with an error code of -2147219885 (An expected Field was not found or could not be retrieved properly).
208
+ /// If the field has an incompatible data type, this will fail with an error code of -2147217395 (The value type is incompatible with the field type).
209
+ /// If the field contains a null value, this will fail with an error code of E_FAIL.
210
+ /// @param[in] fieldNumber The number of the field to get the value from.
211
+ /// @param[out] value The field's value.
212
+ /// @return Error code indicating whether the method finished successfully.
213
+ fgdbError GetFloat(int fieldNumber, float& value) const;
214
+
156
215
  /// Assigns a float value to the specified field.
157
216
  /// If the field does not exist, this will fail with an error code of -2147219885 (An expected Field was not found or could not be retrieved properly).
158
217
  /// If the field has an incompatible data type, this will fail with an error code of -2147217395 (The value type is incompatible with the field type).
@@ -161,6 +220,14 @@ public:
161
220
  /// @return Error code indicating whether the method finished successfully.
162
221
  fgdbError SetFloat(const std::wstring& field, float value);
163
222
 
223
+ /// Assigns a float value to the specified field.
224
+ /// If the field does not exist, this will fail with an error code of -2147219885 (An expected Field was not found or could not be retrieved properly).
225
+ /// If the field has an incompatible data type, this will fail with an error code of -2147217395 (The value type is incompatible with the field type).
226
+ /// @param[in] fieldNumber The number of the field to assign the value to.
227
+ /// @param[in] value The value to assign to the field.
228
+ /// @return Error code indicating whether the method finished successfully.
229
+ fgdbError SetFloat(int fieldNumber, float value);
230
+
164
231
  /// Gets a double value from the specified field.
165
232
  /// If the field does not exist, this will fail with an error code of -2147219885 (An expected Field was not found or could not be retrieved properly).
166
233
  /// If the field has an incompatible data type, this will fail with an error code of -2147217395 (The value type is incompatible with the field type).
@@ -170,6 +237,15 @@ public:
170
237
  /// @return Error code indicating whether the method finished successfully.
171
238
  fgdbError GetDouble(const std::wstring& field, double& value) const;
172
239
 
240
+ /// Gets a double value from the specified field.
241
+ /// If the field does not exist, this will fail with an error code of -2147219885 (An expected Field was not found or could not be retrieved properly).
242
+ /// If the field has an incompatible data type, this will fail with an error code of -2147217395 (The value type is incompatible with the field type).
243
+ /// If the field contains a null value, this will fail with an error code of E_FAIL.
244
+ /// @param[in] fieldNumber The number of the field to get the value from.
245
+ /// @param[out] value The field's value.
246
+ /// @return Error code indicating whether the method finished successfully.
247
+ fgdbError GetDouble(int fieldNumber, double& value) const;
248
+
173
249
  /// Assigns a double value to the specified field.
174
250
  /// If the field does not exist, this will fail with an error code of -2147219885 (An expected Field was not found or could not be retrieved properly).
175
251
  /// If the field has an incompatible data type, this will fail with an error code of -2147217395 (The value type is incompatible with the field type).
@@ -178,6 +254,14 @@ public:
178
254
  /// @return Error code indicating whether the method finished successfully.
179
255
  fgdbError SetDouble(const std::wstring& field, double value);
180
256
 
257
+ /// Assigns a double value to the specified field.
258
+ /// If the field does not exist, this will fail with an error code of -2147219885 (An expected Field was not found or could not be retrieved properly).
259
+ /// If the field has an incompatible data type, this will fail with an error code of -2147217395 (The value type is incompatible with the field type).
260
+ /// @param[in] fieldNumber The number of the field to assign the value to.
261
+ /// @param[in] value The value to assign to the field.
262
+ /// @return Error code indicating whether the method finished successfully.
263
+ fgdbError SetDouble(int fieldNumber, double value);
264
+
181
265
  /// Gets a date/time value from the specified field.
182
266
  /// If the field does not exist, this will fail with an error code of -2147219885 (An expected Field was not found or could not be retrieved properly).
183
267
  /// If the field has an incompatible data type, this will fail with an error code of -2147217395 (The value type is incompatible with the field type).
@@ -187,6 +271,15 @@ public:
187
271
  /// @return Error code indicating whether the method finished successfully.
188
272
  fgdbError GetDate(const std::wstring& field, struct tm& value) const;
189
273
 
274
+ /// Gets a date/time value from the specified field.
275
+ /// If the field does not exist, this will fail with an error code of -2147219885 (An expected Field was not found or could not be retrieved properly).
276
+ /// If the field has an incompatible data type, this will fail with an error code of -2147217395 (The value type is incompatible with the field type).
277
+ /// If the field contains a null value, this will fail with an error code of E_FAIL.
278
+ /// @param[in] fieldNumber The number of the field to get the value from.
279
+ /// @param[out] value The field's value.
280
+ /// @return Error code indicating whether the method finished successfully.
281
+ fgdbError GetDate(int fieldNumber, struct tm& value) const;
282
+
190
283
  /// Assigns a date/time value to the specified field.
191
284
  /// If the field does not exist, this will fail with an error code of -2147219885 (An expected Field was not found or could not be retrieved properly).
192
285
  /// If the field has an incompatible data type, this will fail with an error code of -2147217395 (The value type is incompatible with the field type).
@@ -195,6 +288,14 @@ public:
195
288
  /// @return Error code indicating whether the method finished successfully.
196
289
  fgdbError SetDate(const std::wstring& field, const struct tm& value);
197
290
 
291
+ /// Assigns a date/time value to the specified field.
292
+ /// If the field does not exist, this will fail with an error code of -2147219885 (An expected Field was not found or could not be retrieved properly).
293
+ /// If the field has an incompatible data type, this will fail with an error code of -2147217395 (The value type is incompatible with the field type).
294
+ /// @param[in] fieldNumber The number of the field to get the value from.
295
+ /// @param[in] value The value to assign to the field.
296
+ /// @return Error code indicating whether the method finished successfully.
297
+ fgdbError SetDate(int fieldNumber, const struct tm& value);
298
+
198
299
  /// Gets a string value from the specified field.
199
300
  /// If the field does not exist, this will fail with an error code of -2147219885 (An expected Field was not found or could not be retrieved properly).
200
301
  /// If the field has an incompatible data type, this will fail with an error code of -2147217395 (The value type is incompatible with the field type).
@@ -204,14 +305,31 @@ public:
204
305
  /// @return Error code indicating whether the method finished successfully.
205
306
  fgdbError GetString(const std::wstring& field, std::wstring& value) const;
206
307
 
308
+ /// Gets a string value from the specified field.
309
+ /// If the field does not exist, this will fail with an error code of -2147219885 (An expected Field was not found or could not be retrieved properly).
310
+ /// If the field has an incompatible data type, this will fail with an error code of -2147217395 (The value type is incompatible with the field type).
311
+ /// If the field contains a null value, this will fail with an error code of E_FAIL.
312
+ /// @param[in] fieldNumber The number of the field to get the value from.
313
+ /// @param[out] value The field's value.
314
+ /// @return Error code indicating whether the method finished successfully.
315
+ fgdbError GetString(int fieldNumber, std::wstring& value) const;
316
+
207
317
  /// Assigns a string value to the specified field.
208
318
  /// If the field does not exist, this will fail with an error code of -2147219885 (An expected Field was not found or could not be retrieved properly).
209
319
  /// If the field has an incompatible data type, this will fail with an error code of -2147217395 (The value type is incompatible with the field type).
210
320
  /// @param[in] field The name of the field to assign the value to.
211
- /// @param[in] value The value to assign to the field.
321
+ /// @param[in] value The value to assign to the field.
212
322
  /// @return Error code indicating whether the method finished successfully.
213
323
  fgdbError SetString(const std::wstring& field, const std::wstring& value);
214
324
 
325
+ /// Assigns a string value to the specified field.
326
+ /// If the field does not exist, this will fail with an error code of -2147219885 (An expected Field was not found or could not be retrieved properly).
327
+ /// If the field has an incompatible data type, this will fail with an error code of -2147217395 (The value type is incompatible with the field type).
328
+ /// @param[in] fieldNumber The number of the field to assign the value to.
329
+ /// @param[in] value The value to assign to the field.
330
+ /// @return Error code indicating whether the method finished successfully.
331
+ fgdbError SetString(int fieldNumber, const std::wstring& value);
332
+
215
333
  /// Gets a GUID value from the specified field.
216
334
  /// If the field does not exist, this will fail with an error code of -2147219885 (An expected Field was not found or could not be retrieved properly).
217
335
  /// If the field has an incompatible data type, this will fail with an error code of -2147217395 (The value type is incompatible with the field type).
@@ -221,6 +339,15 @@ public:
221
339
  /// @return Error code indicating whether the method finished successfully.
222
340
  fgdbError GetGUID(const std::wstring& field, Guid& value) const;
223
341
 
342
+ /// Gets a GUID value from the specified field.
343
+ /// If the field does not exist, this will fail with an error code of -2147219885 (An expected Field was not found or could not be retrieved properly).
344
+ /// If the field has an incompatible data type, this will fail with an error code of -2147217395 (The value type is incompatible with the field type).
345
+ /// If the field contains a null value, this will fail with an error code of E_FAIL.
346
+ /// @param[in] fieldNumber The number of the field to get the value from.
347
+ /// @param[out] value The field's value.
348
+ /// @return Error code indicating whether the method finished successfully.
349
+ fgdbError GetGUID(int fieldNumber, Guid& value) const;
350
+
224
351
  /// Assigns a GUID value to the specified field.
225
352
  /// If the field does not exist, this will fail with an error code of -2147219885 (An expected Field was not found or could not be retrieved properly).
226
353
  /// If the field has an incompatible data type, this will fail with an error code of -2147217395 (The value type is incompatible with the field type).
@@ -229,6 +356,14 @@ public:
229
356
  /// @return Error code indicating whether the method finished successfully.
230
357
  fgdbError SetGUID(const std::wstring& field, const Guid& value);
231
358
 
359
+ /// Assigns a GUID value to the specified field.
360
+ /// If the field does not exist, this will fail with an error code of -2147219885 (An expected Field was not found or could not be retrieved properly).
361
+ /// If the field has an incompatible data type, this will fail with an error code of -2147217395 (The value type is incompatible with the field type).
362
+ /// @param[in] fieldNumber The number of the field to assign the value to.
363
+ /// @param[in] value The value to assign to the field.
364
+ /// @return Error code indicating whether the method finished successfully.
365
+ fgdbError SetGUID(int fieldNumber, const Guid& value);
366
+
232
367
  /// Gets an XML value from the specified field.
233
368
  /// If the field does not exist, this will fail with an error code of -2147219885 (An expected Field was not found or could not be retrieved properly).
234
369
  /// If the field has an incompatible data type, this will fail with an error code of -2147217395 (The value type is incompatible with the field type).
@@ -238,6 +373,15 @@ public:
238
373
  /// @return Error code indicating whether the method finished successfully.
239
374
  fgdbError GetXML(const std::wstring& field, std::string& value) const;
240
375
 
376
+ /// Gets an XML value from the specified field.
377
+ /// If the field does not exist, this will fail with an error code of -2147219885 (An expected Field was not found or could not be retrieved properly).
378
+ /// If the field has an incompatible data type, this will fail with an error code of -2147217395 (The value type is incompatible with the field type).
379
+ /// If the field contains a null value, this will fail with an error code of E_FAIL.
380
+ /// @param[in] fieldNumber The number of the field to get the value from.
381
+ /// @param[out] value The field's value.
382
+ /// @return Error code indicating whether the method finished successfully.
383
+ fgdbError GetXML(int fieldNumber, std::string& value) const;
384
+
241
385
  /// Assigns an XML value to the specified field.
242
386
  /// If the field does not exist, this will fail with an error code of -2147219885 (An expected Field was not found or could not be retrieved properly).
243
387
  /// If the field has an incompatible data type, this will fail with an error code of -2147217395 (The value type is incompatible with the field type).
@@ -246,6 +390,14 @@ public:
246
390
  /// @return Error code indicating whether the method finished successfully.
247
391
  fgdbError SetXML(const std::wstring& field, const std::string& value);
248
392
 
393
+ /// Assigns an XML value to the specified field.
394
+ /// If the field does not exist, this will fail with an error code of -2147219885 (An expected Field was not found or could not be retrieved properly).
395
+ /// If the field has an incompatible data type, this will fail with an error code of -2147217395 (The value type is incompatible with the field type).
396
+ /// @param[in] fieldNumber The number of the field to assign the value to.
397
+ /// @param[in] value The value to assign to the field.
398
+ /// @return Error code indicating whether the method finished successfully.
399
+ fgdbError SetXML(int fieldNumber, const std::string& value);
400
+
249
401
  /// Gets a raster from the specified field.
250
402
  /// If the field does not exist, this will fail with an error code of -2147219885 (An expected Field was not found or could not be retrieved properly).
251
403
  /// If the field has an incompatible data type, this will fail with an error code of -2147217395 (The value type is incompatible with the field type).
@@ -271,6 +423,15 @@ public:
271
423
  /// @return Error code indicating whether the method finished successfully.
272
424
  fgdbError GetBinary(const std::wstring& field, ByteArray& binaryBuf) const;
273
425
 
426
+ /// Gets a byte array from the specified field.
427
+ /// If the field does not exist, this will fail with an error code of -2147219885 (An expected Field was not found or could not be retrieved properly).
428
+ /// If the field has an incompatible data type, this will fail with an error code of -2147217395 (The value type is incompatible with the field type).
429
+ /// If the field contains a null value, this will fail with an error code of E_FAIL.
430
+ /// @param[in] fieldNumber The number of the field to get the value from.
431
+ /// @param[out] binaryBuf The field's value.
432
+ /// @return Error code indicating whether the method finished successfully.
433
+ fgdbError GetBinary(int fieldNumber, ByteArray& binaryBuf) const;
434
+
274
435
  /// Assigns a byte array to the specified field.
275
436
  /// If the field does not exist, this will fail with an error code of -2147219885 (An expected Field was not found or could not be retrieved properly).
276
437
  /// If the field has an incompatible data type, this will fail with an error code of -2147217395 (The value type is incompatible with the field type).
@@ -278,6 +439,14 @@ public:
278
439
  /// @param[in] binaryBuf The value to assign to the field.
279
440
  /// @return Error code indicating whether the method finished successfully.
280
441
  fgdbError SetBinary(const std::wstring& field, const ByteArray& binaryBuf);
442
+
443
+ /// Assigns a byte array to the specified field.
444
+ /// If the field does not exist, this will fail with an error code of -2147219885 (An expected Field was not found or could not be retrieved properly).
445
+ /// If the field has an incompatible data type, this will fail with an error code of -2147217395 (The value type is incompatible with the field type).
446
+ /// @param[in] fieldNumber The number of the field to assign the value to.
447
+ /// @param[in] binaryBuf The value to assign to the field.
448
+ /// @return Error code indicating whether the method finished successfully.
449
+ fgdbError SetBinary(int fieldNumber, const ByteArray& binaryBuf);
281
450
  //@}
282
451
 
283
452
  /// @name Field properties
@@ -310,12 +479,13 @@ private:
310
479
 
311
480
  fgdbError FindField(const std::wstring& field, int& fieldNumber, FieldType& fieldType) const;
312
481
  fgdbError GetFieldIsNullable(int fieldNumber, bool& isNullable) const;
482
+ fgdbError GetFieldType(int fieldNumber, FieldType& fieldType) const;
313
483
 
314
484
  fgdbError SetOID(int32 objectID);
315
485
  fgdbError SetGlobalID(const Guid& globalID);
316
486
 
317
487
  int m_numFields;
318
- int* m_pFieldMap;
488
+ int* m_pFieldMap;
319
489
  FieldValue* m_pValues;
320
490
  int m_oidFieldNumber;
321
491
  int m_globalIDFieldNumber;
@@ -1,296 +1,300 @@
1
- //
2
- // Table.h
3
- //
4
-
5
- /*
6
- COPYRIGHT � 2012 ESRI
7
- TRADE SECRETS: ESRI PROPRIETARY AND CONFIDENTIAL
8
- Unpublished material - all rights reserved under the
9
- Copyright Laws of the United States and applicable international
10
- laws, treaties, and conventions.
11
-
12
- For additional information, contact:
13
- Environmental Systems Research Institute, Inc.
14
- Attn: Contracts and Legal Services Department
15
- 380 New York Street
16
- Redlands, California, 92373
17
- USA
18
-
19
- email: contracts@esri.com
20
- */
21
-
22
- #pragma once
23
-
24
- #include <string>
25
- #include <vector>
26
-
27
- #ifndef EXPORT_FILEGDB_API
28
- # if defined linux || defined __APPLE__
29
- # define EXT_FILEGDB_API
30
- # else
31
- # define EXT_FILEGDB_API _declspec(dllimport)
32
- # endif
33
- #else
34
- # if defined linux || defined __APPLE__
35
- # define EXT_FILEGDB_API __attribute__((visibility("default")))
36
- # else
37
- # define EXT_FILEGDB_API _declspec(dllexport)
38
- # endif
39
- #endif
40
-
41
- #include "FileGDBCore.h"
42
-
43
- class Datafile;
44
- class AutoLock;
45
-
46
- namespace FileGDBAPI
47
- {
48
-
49
- class EnumRows;
50
- class Envelope;
51
- class Row;
52
- class Geodatabase;
53
- class FieldInfo;
54
- class IndexDef;
55
- class FieldDef;
56
-
57
- /// Provides methods to work with tables, such as querying and modifying both schema and data.
58
- class EXT_FILEGDB_API Table
59
- {
60
- public:
61
-
62
- /// @name Schema
63
- //@{
64
- /// Gets the table's definition as an XML document.
65
- /// @param[out] tableDef An XML document than defines the table's schema.
66
- /// @return Error code indicating whether the method finished successfully.
67
- fgdbError GetDefinition(std::string& tableDef) const;
68
-
69
- /// Gets the table's metadata as XML.
70
- /// @param[out] documentation The table's metadata as XML.
71
- /// @return Error code indicating whether the method finished successfully.
72
- fgdbError GetDocumentation(std::string& documentation) const;
73
-
74
- /// Assigns metadata to the table.
75
- /// @param[in] documentation An XML document that will be the table's metadata.
76
- /// @return Error code indicating whether the method finished successfully.
77
- fgdbError SetDocumentation(const std::string& documentation);
78
-
79
- /// Return information about the fields in the table.
80
- /// @param[out] fieldInfo The field information.
81
- /// @return Error code indicating whether the method finished successfully.
82
- fgdbError GetFieldInformation(FieldInfo& fieldInfo) const;
83
-
84
- /// Returns an array of FieldDef objects of the table's field collection.
85
- /// @param[out] fieldDefs An array of FieldDef objects containing a collection of field definitions.
86
- /// @return Error code indicating whether the method finished successfully.
87
- fgdbError GetFields(std::vector<FieldDef>& fieldDefs) const;
88
-
89
- /// Adds a field to the table.
90
- /// If the XML is not UTF-8 encoded, create will fail with an error code of -2147024809 (Invalid function arguments).<br/>
91
- /// If you are adding an OBJECTID field and one already exists, a -2147219707 (The Fields collection contained multiple OID fields)
92
- /// error will be returned. Only one OBJECTID field is allowed.<br/>
93
- /// If you are adding an GLOBALID field and one already exists, a -2147219703 (The Fields collection contained multiple Global ID fields)
94
- /// error will be returned. Only one GLOBALID field is allowed.<br/>
95
- /// If you attempt to add a NOT NULLABLE field to a table already contains rows,
96
- /// a -2147219879 (The field is not nullable) will be returned. <br/>
97
- /// If the field already exists, a -2147219884 (The Field already exists) will be returned.<br/>
98
- /// <a href="esriFieldTypes.txt">FieldTypes</a> <a href="Field.xml">XML</a>
99
- /// @param[in] fieldDef An XML document defining the field's properties.
100
- /// @return Error code indicating whether the method finished successfully.
101
- fgdbError AddField(const std::string& fieldDef);
102
-
103
- /// Adds a field to the table.
104
- /// @param[in] fieldDef A FieldDef object defining the field's properties.
105
- /// @return Error code indicating whether the method finished successfully.
106
- fgdbError AddField(const FieldDef& fieldDef);
107
-
108
- /// Modifies a field in the table.
109
- /// If the XML is not UTF-8 encoded, create will fail with an error code of -2147024809 (Invalid function arguments).<br/>
110
- /// @param[in] fieldDef An XML document defining the field's properties.
111
- /// @return Error code indicating whether the method finished successfully.
112
- fgdbError AlterField(const std::string& fieldDef);
113
-
114
- /// Deletes a field from the table.
115
- /// If the field does not exist, an -2147219885 (An expected Field was not found or could not be retrieved properly) error will be returned.<br/>
116
- /// @param[in] fieldName The name of the field to delete.
117
- /// @return Error code indicating whether the method finished successfully.
118
- fgdbError DeleteField(const std::wstring& fieldName);
119
-
120
- /// Returns an XML definition of the table's index collection.
121
- /// @param[out] indexDefs An XML document containing a collection of index definitions.
122
- /// @return Error code indicating whether the method finished successfully.
123
- fgdbError GetIndexes(std::vector<std::string>& indexDefs) const;
124
-
125
- /// Returns an array of IndexDef objects of the table's index collection.
126
- /// @param[out] indexDefs An array of IndexDef objects containing a collection of index definitions.
127
- /// @return Error code indicating whether the method finished successfully.
128
- fgdbError GetIndexes(std::vector<IndexDef>& indexDefs) const;
129
-
130
- /// Adds an index to the table.
131
- /// If the XML is not UTF-8 encoded, create will fail with an error code of -2147024809 (Invalid function arguments).<br/>
132
- /// <a href="Index.xml">XML</a>
133
- /// @param[in] indexDef An XML document defining the index's properties.
134
- /// @return Error code indicating whether the method finished successfully.
135
- fgdbError AddIndex(const std::string& indexDef);
136
-
137
- /// Adds an index to the table.
138
- /// @param[in] indexDef An IndexDef object defining the index's properties.
139
- /// @return Error code indicating whether the method finished successfully.
140
- fgdbError AddIndex(const IndexDef& indexDef);
141
-
142
- /// Deletes an index from the table.
143
- /// If the index is not found, an -2147219629 (The index was not found) error will be returned.<br/>
144
- /// @param[in] indexName The name of the index to delete.
145
- /// @return Error code indicating whether the method finished successfully.
146
- fgdbError DeleteIndex(const std::wstring& indexName);
147
-
148
- /// Creates a new subtype to the table.
149
- /// If the XML is not UTF-8 encoded, create will fail with an error code of -2147024809 (Invalid function arguments).<br/>
150
- /// <a href="SubType.xml">XML</a>
151
- /// @param[in] subtypeDef An XML document defining the subtype's properties.
152
- /// @return Error code indicating whether the method finished successfully.
153
- fgdbError CreateSubtype(const std::string& subtypeDef);
154
-
155
- /// Modifies an existing subtype of the table.
156
- /// If the XML is not UTF-8 encoded, create will fail with an error code of -2147024809 (Invalid function arguments).<br/>
157
- /// @param[in] subtypeDef An XML document defining the subtype's properties.
158
- /// @return Error code indicating whether the method finished successfully.
159
- fgdbError AlterSubtype(const std::string& subtypeDef);
160
-
161
- /// Deletes a subtype from the table.
162
- /// @param[in] subtypeName The name of the subtype to delete.
163
- /// @return Error code indicating whether the method finished successfully.
164
- fgdbError DeleteSubtype(const std::wstring& subtypeName);
165
-
166
- /// Enables subtypes on a table.
167
- /// If the XML is not UTF-8 encoded, create will fail with an error code of -2147024809 (Invalid function arguments).<br/>
168
- /// <a href="esriFieldTypes.txt">FieldTypes</a> <a href="Field.xml">XML</a>
169
- /// @param[in] subtypeFieldName The field to use as the subtype field.
170
- /// @param[in] subtypeDef The field to use as the subtype Def.
171
- /// @return Error code indicating whether the method finished successfully.
172
- fgdbError EnableSubtypes(const std::wstring& subtypeFieldName, const std::string& subtypeDef);
173
-
174
- /// Returns the default subtype code.
175
- /// @param[out] defaultCode The table's default subtype code.
176
- /// @return Error code indicating whether the method finished successfully.
177
- fgdbError GetDefaultSubtypeCode(int& defaultCode) const;
178
-
179
- /// Sets the default subtype code.
180
- /// @param[out] defaultCode The code to assign as the default subtype code.
181
- /// @return Error code indicating whether the method finished successfully.
182
- fgdbError SetDefaultSubtypeCode(int defaultCode);
183
-
184
- /// Drops the table's subtypes.
185
- /// @return Error code indicating whether the method finished successfully.
186
- fgdbError DisableSubtypes();
187
- //@}
188
-
189
- /// @name Data
190
- //@{
191
- /// Performs a spatial query (envelope intersects) on the table.
192
- /// @param[in] subfields (Optional) The fields that should be fetched by the query's returned rows. Must
193
- /// include a comma delimited list of fields or a "*". Passing in blank will return a -2147220985 (An invalid SQL statement was used) error.
194
- /// @param[in] whereClause (Optional) Attribute constraints to apply to the query.
195
- /// @param[in] envelope The spatial extent of the query.
196
- /// @param[in] recycling Indicates whether row memory should be recycled.
197
- /// @param[out] rows The results of the query.
198
- /// @return Error code indicating whether the method finished successfully.
199
- fgdbError Search(const std::wstring& subfields, const std::wstring& whereClause, const Envelope& envelope, bool recycling, EnumRows& rows);
200
-
201
- /// Performs an attribute query on the table.
202
- /// @param[in] subfields (Optional) The fields that should be fetched by the query's returned rows. Must
203
- /// include a comma delimited list of fields or a "*". A blank will return a -2147220985 (An invalid SQL statement was used) error.
204
- /// @param[in] whereClause (Optional) Attribute constraints to apply to the query.
205
- /// @param[in] recycling Indicates whether row memory should be recycled.
206
- /// @param[out] rows The results of the query.
207
- /// @return Error code indicating whether the method finished successfully.
208
- fgdbError Search(const std::wstring& subfields, const std::wstring& whereClause, bool recycling, EnumRows& rows);
209
-
210
- /// Creates a new row in memory for the table.
211
- /// @param[out] row The newly-created row.
212
- /// @return Error code indicating whether the method finished successfully.
213
- fgdbError CreateRowObject(Row& row);
214
-
215
- /// Inserts a newly-created and populated row into the table. When bulk inserting rows use LoadOnlyMode and SetWriteLock\FreeWriteLock to improve performance.
216
- /// @param[in] row The row to insert.
217
- /// @return Error code indicating whether the method finished successfully.
218
- fgdbError Insert(Row& row);
219
-
220
- /// Updates an existing row in the table.
221
- /// @param[in] row The row to update.
222
- /// @return Error code indicating whether the method finished successfully.
223
- fgdbError Update(Row& row);
224
-
225
- /// Deletes a row from the table.
226
- /// @param[in] row The row to delete.
227
- /// @return Error code indicating whether the method finished successfully.
228
- fgdbError Delete(Row& row);
229
-
230
- /// Indicates whether the table should be edited.
231
- /// @param[out] isEditable True if the table can safely be edited.
232
- /// @return Error code indicating whether the method finished successfully.
233
- fgdbError IsEditable(bool& isEditable);
234
-
235
- /// Returns the number of rows in the table.
236
- /// @param[out] rowCount The number of rows in the table.
237
- /// @return Error code indicating whether the method finished successfully.
238
- fgdbError GetRowCount(int& rowCount) const;
239
-
240
- /// Returns the extent of the feature class.
241
- /// If the table is not a feature class an error of 1 will be returned.
242
- /// @param[out] extent The extent of the feature class.
243
- /// @return Error code indicating whether the method finished successfully.
244
- fgdbError GetExtent(Envelope& extent) const;
245
-
246
- /// Sets a write lock on a table.
247
- /// This should be used when performing bulk updates and inserts. Otherwise a
248
- /// lock will be created for each update or insert. Should be followed by a call
249
- /// to FreeWriteLock.
250
- fgdbError SetWriteLock(void);
251
-
252
- /// Frees a write lock on a table.
253
- /// This should be used when performing bulk updates and inserts. Otherwise a
254
- /// lock will be created for each update or insert. Should be preceded by a call
255
- /// to SetWriteLock.
256
- fgdbError FreeWriteLock(void);
257
-
258
- /// Begin or End load only mode.
259
- /// @param[in] loadOnlyMode true to begin LoadOnlyMode, false to end.
260
- fgdbError LoadOnlyMode(bool loadOnlyMode);
261
- //@}
262
-
263
- /// @name Constructors and destructors
264
- //@{
265
- /// The class constructor.
266
- Table();
267
-
268
- /// The class destructor.
269
- ~Table();
270
- //@}
271
-
272
- private:
273
-
274
- /// @cond PRIVATE
275
- fgdbError SetupTable(const std::wstring& path, Geodatabase* pGeodatabase, Datafile* pDatafile);
276
- bool IsSetup() const;
277
-
278
- #pragma warning(push)
279
- #pragma warning(disable : 4251)
280
-
281
- Geodatabase* m_pGeodatabase;
282
- Datafile* m_pDatafile;
283
- std::wstring m_Path;
284
- AutoLock* m_pWriteLock;
285
- int m_isEditable;
286
-
287
- #pragma warning(pop)
288
-
289
- friend class Geodatabase;
290
-
291
- Table(const Table&) { }
292
- Table& operator=(const Table&) { return *this; }
293
- /// @endcond
294
- };
295
-
296
- }; // namespace FileGDBAPI
1
+ //
2
+ // Table.h
3
+ //
4
+
5
+ /*
6
+ COPYRIGHT � 2015 ESRI
7
+ TRADE SECRETS: ESRI PROPRIETARY AND CONFIDENTIAL
8
+ Unpublished material - all rights reserved under the
9
+ Copyright Laws of the United States and applicable international
10
+ laws, treaties, and conventions.
11
+
12
+ For additional information, contact:
13
+ Environmental Systems Research Institute, Inc.
14
+ Attn: Contracts and Legal Services Department
15
+ 380 New York Street
16
+ Redlands, California, 92373
17
+ USA
18
+
19
+ email: contracts@esri.com
20
+ */
21
+
22
+ /// Provides methods to work with tables, such as querying and modifying both schema and data.
23
+ /// @file Table.h
24
+
25
+ #pragma once
26
+
27
+ #include <string>
28
+ #include <vector>
29
+
30
+ #ifndef EXPORT_FILEGDB_API
31
+ # if defined linux || defined __APPLE__
32
+ # define EXT_FILEGDB_API
33
+ # else
34
+ # define EXT_FILEGDB_API _declspec(dllimport)
35
+ # endif
36
+ #else
37
+ # if defined linux || defined __APPLE__
38
+ # define EXT_FILEGDB_API __attribute__((visibility("default")))
39
+ # else
40
+ # define EXT_FILEGDB_API _declspec(dllexport)
41
+ # endif
42
+ #endif
43
+
44
+ #include "FileGDBCore.h"
45
+
46
+ class Datafile;
47
+ class AutoLock;
48
+
49
+ namespace FileGDBAPI
50
+ {
51
+
52
+ class EnumRows;
53
+ class Envelope;
54
+ class Row;
55
+ class Geodatabase;
56
+ class FieldInfo;
57
+ class IndexDef;
58
+ class FieldDef;
59
+
60
+ /// Provides methods to work with tables, such as querying and modifying both schema and data.
61
+ class EXT_FILEGDB_API Table
62
+ {
63
+ public:
64
+
65
+ /// @name Schema
66
+ //@{
67
+ /// Gets the table's definition as an XML document.
68
+ /// @param[out] tableDef An XML document than defines the table's schema.
69
+ /// @return Error code indicating whether the method finished successfully.
70
+ fgdbError GetDefinition(std::string& tableDef) const;
71
+
72
+ /// Gets the table's metadata as XML.
73
+ /// @param[out] documentation The table's metadata as XML.
74
+ /// @return Error code indicating whether the method finished successfully.
75
+ fgdbError GetDocumentation(std::string& documentation) const;
76
+
77
+ /// Assigns metadata to the table.
78
+ /// @param[in] documentation An XML document that will be the table's metadata.
79
+ /// @return Error code indicating whether the method finished successfully.
80
+ fgdbError SetDocumentation(const std::string& documentation);
81
+
82
+ /// Return information about the fields in the table.
83
+ /// @param[out] fieldInfo The field information.
84
+ /// @return Error code indicating whether the method finished successfully.
85
+ fgdbError GetFieldInformation(FieldInfo& fieldInfo) const;
86
+
87
+ /// Returns an array of FieldDef objects of the table's field collection.
88
+ /// @param[out] fieldDefs An array of FieldDef objects containing a collection of field definitions.
89
+ /// @return Error code indicating whether the method finished successfully.
90
+ fgdbError GetFields(std::vector<FieldDef>& fieldDefs) const;
91
+
92
+ /// Adds a field to the table.
93
+ /// If the XML is not UTF-8 encoded, create will fail with an error code of -2147024809 (Invalid function arguments).<br/>
94
+ /// If you are adding an OBJECTID field and one already exists, a -2147219707 (The Fields collection contained multiple OID fields)
95
+ /// error will be returned. Only one OBJECTID field is allowed.<br/>
96
+ /// If you are adding an GLOBALID field and one already exists, a -2147219703 (The Fields collection contained multiple Global ID fields)
97
+ /// error will be returned. Only one GLOBALID field is allowed.<br/>
98
+ /// If you attempt to add a NOT NULLABLE field to a table already contains rows,
99
+ /// a -2147219879 (The field is not nullable) will be returned. <br/>
100
+ /// If the field already exists, a -2147219884 (The Field already exists) will be returned.<br/>
101
+ /// <a href="esriFieldTypes.txt">FieldTypes</a> <a href="Field.xml">XML</a>
102
+ /// @param[in] fieldDef An XML document defining the field's properties.
103
+ /// @return Error code indicating whether the method finished successfully.
104
+ fgdbError AddField(const std::string& fieldDef);
105
+
106
+ /// Adds a field to the table.
107
+ /// @param[in] fieldDef A FieldDef object defining the field's properties.
108
+ /// @return Error code indicating whether the method finished successfully.
109
+ fgdbError AddField(const FieldDef& fieldDef);
110
+
111
+ /// Modifies a field in the table.
112
+ /// If the XML is not UTF-8 encoded, create will fail with an error code of -2147024809 (Invalid function arguments).<br/>
113
+ /// Alter allows a domain to be assigned to a field. No other field properties can be changed.
114
+ /// @param[in] fieldDef An XML document defining the field's properties.
115
+ /// @return Error code indicating whether the method finished successfully.
116
+ fgdbError AlterField(const std::string& fieldDef);
117
+
118
+ /// Deletes a field from the table.
119
+ /// If the field does not exist, an -2147219885 (An expected Field was not found or could not be retrieved properly) error will be returned.<br/>
120
+ /// @param[in] fieldName The name of the field to delete.
121
+ /// @return Error code indicating whether the method finished successfully.
122
+ fgdbError DeleteField(const std::wstring& fieldName);
123
+
124
+ /// Returns an XML definition of the table's index collection.
125
+ /// @param[out] indexDefs An XML document containing a collection of index definitions.
126
+ /// @return Error code indicating whether the method finished successfully.
127
+ fgdbError GetIndexes(std::vector<std::string>& indexDefs) const;
128
+
129
+ /// Returns an array of IndexDef objects of the table's index collection.
130
+ /// @param[out] indexDefs An array of IndexDef objects containing a collection of index definitions.
131
+ /// @return Error code indicating whether the method finished successfully.
132
+ fgdbError GetIndexes(std::vector<IndexDef>& indexDefs) const;
133
+
134
+ /// Adds an index to the table.
135
+ /// If the XML is not UTF-8 encoded, create will fail with an error code of -2147024809 (Invalid function arguments).<br/>
136
+ /// <a href="Index.xml">XML</a>
137
+ /// @param[in] indexDef An XML document defining the index's properties.
138
+ /// @return Error code indicating whether the method finished successfully.
139
+ fgdbError AddIndex(const std::string& indexDef);
140
+
141
+ /// Adds an index to the table.
142
+ /// @param[in] indexDef An IndexDef object defining the index's properties.
143
+ /// @return Error code indicating whether the method finished successfully.
144
+ fgdbError AddIndex(const IndexDef& indexDef);
145
+
146
+ /// Deletes an index from the table.
147
+ /// If the index is not found, an -2147219629 (The index was not found) error will be returned.<br/>
148
+ /// @param[in] indexName The name of the index to delete.
149
+ /// @return Error code indicating whether the method finished successfully.
150
+ fgdbError DeleteIndex(const std::wstring& indexName);
151
+
152
+ /// Creates a new subtype to the table.
153
+ /// If the XML is not UTF-8 encoded, create will fail with an error code of -2147024809 (Invalid function arguments).<br/>
154
+ /// <a href="SubType.xml">XML</a>
155
+ /// @param[in] subtypeDef An XML document defining the subtype's properties.
156
+ /// @return Error code indicating whether the method finished successfully.
157
+ fgdbError CreateSubtype(const std::string& subtypeDef);
158
+
159
+ /// Modifies an existing subtype of the table.
160
+ /// If the XML is not UTF-8 encoded, create will fail with an error code of -2147024809 (Invalid function arguments).<br/>
161
+ /// @param[in] subtypeDef An XML document defining the subtype's properties.
162
+ /// @return Error code indicating whether the method finished successfully.
163
+ fgdbError AlterSubtype(const std::string& subtypeDef);
164
+
165
+ /// Deletes a subtype from the table.
166
+ /// @param[in] subtypeName The name of the subtype to delete.
167
+ /// @return Error code indicating whether the method finished successfully.
168
+ fgdbError DeleteSubtype(const std::wstring& subtypeName);
169
+
170
+ /// Enables subtypes on a table.
171
+ /// If the XML is not UTF-8 encoded, create will fail with an error code of -2147024809 (Invalid function arguments).<br/>
172
+ /// <a href="esriFieldTypes.txt">FieldTypes</a> <a href="Field.xml">XML</a>
173
+ /// @param[in] subtypeFieldName The field to use as the subtype field.
174
+ /// @param[in] subtypeDef The field to use as the subtype Def.
175
+ /// @return Error code indicating whether the method finished successfully.
176
+ fgdbError EnableSubtypes(const std::wstring& subtypeFieldName, const std::string& subtypeDef);
177
+
178
+ /// Returns the default subtype code.
179
+ /// @param[out] defaultCode The table's default subtype code.
180
+ /// @return Error code indicating whether the method finished successfully.
181
+ fgdbError GetDefaultSubtypeCode(int& defaultCode) const;
182
+
183
+ /// Sets the default subtype code.
184
+ /// @param[out] defaultCode The code to assign as the default subtype code.
185
+ /// @return Error code indicating whether the method finished successfully.
186
+ fgdbError SetDefaultSubtypeCode(int defaultCode);
187
+
188
+ /// Drops the table's subtypes.
189
+ /// @return Error code indicating whether the method finished successfully.
190
+ fgdbError DisableSubtypes();
191
+ //@}
192
+
193
+ /// @name Data
194
+ //@{
195
+ /// Performs a spatial query (envelope intersects) on the table.
196
+ /// @param[in] subfields (Optional) The fields that should be fetched by the query's returned rows. Must
197
+ /// include a comma delimited list of fields or a "*". Passing in blank will return a -2147220985 (An invalid SQL statement was used) error.
198
+ /// @param[in] whereClause (Optional) Attribute constraints to apply to the query.
199
+ /// @param[in] envelope The spatial extent of the query.
200
+ /// @param[in] recycling Indicates whether row memory should be recycled.
201
+ /// @param[out] rows The results of the query.
202
+ /// @return Error code indicating whether the method finished successfully.
203
+ fgdbError Search(const std::wstring& subfields, const std::wstring& whereClause, const Envelope& envelope, bool recycling, EnumRows& rows);
204
+
205
+ /// Performs an attribute query on the table.
206
+ /// @param[in] subfields (Optional) The fields that should be fetched by the query's returned rows. Must
207
+ /// include a comma delimited list of fields or a "*". A blank will return a -2147220985 (An invalid SQL statement was used) error.
208
+ /// @param[in] whereClause (Optional) Attribute constraints to apply to the query.
209
+ /// @param[in] recycling Indicates whether row memory should be recycled.
210
+ /// @param[out] rows The results of the query.
211
+ /// @return Error code indicating whether the method finished successfully.
212
+ fgdbError Search(const std::wstring& subfields, const std::wstring& whereClause, bool recycling, EnumRows& rows);
213
+
214
+ /// Creates a new row in memory for the table.
215
+ /// @param[out] row The newly-created row.
216
+ /// @return Error code indicating whether the method finished successfully.
217
+ fgdbError CreateRowObject(Row& row);
218
+
219
+ /// Inserts a newly-created and populated row into the table. When bulk inserting rows use LoadOnlyMode and SetWriteLock\\FreeWriteLock to improve performance.
220
+ /// @param[in] row The row to insert.
221
+ /// @return Error code indicating whether the method finished successfully.
222
+ fgdbError Insert(Row& row);
223
+
224
+ /// Updates an existing row in the table.
225
+ /// @param[in] row The row to update.
226
+ /// @return Error code indicating whether the method finished successfully.
227
+ fgdbError Update(Row& row);
228
+
229
+ /// Deletes a row from the table.
230
+ /// @param[in] row The row to delete.
231
+ /// @return Error code indicating whether the method finished successfully.
232
+ fgdbError Delete(Row& row);
233
+
234
+ /// Indicates whether the table should be edited.
235
+ /// @param[out] isEditable True if the table can safely be edited.
236
+ /// @return Error code indicating whether the method finished successfully.
237
+ fgdbError IsEditable(bool& isEditable);
238
+
239
+ /// Returns the number of rows in the table.
240
+ /// @param[out] rowCount The number of rows in the table.
241
+ /// @return Error code indicating whether the method finished successfully.
242
+ fgdbError GetRowCount(int& rowCount) const;
243
+
244
+ /// Returns the extent of the feature class.
245
+ /// If the table is not a feature class an error of 1 will be returned.
246
+ /// @param[out] extent The extent of the feature class.
247
+ /// @return Error code indicating whether the method finished successfully.
248
+ fgdbError GetExtent(Envelope& extent) const;
249
+
250
+ /// Sets a write lock on a table.
251
+ /// This should be used when performing bulk updates and inserts. Otherwise a
252
+ /// lock will be created for each update or insert. Should be followed by a call
253
+ /// to FreeWriteLock.
254
+ fgdbError SetWriteLock(void);
255
+
256
+ /// Frees a write lock on a table.
257
+ /// This should be used when performing bulk updates and inserts. Otherwise a
258
+ /// lock will be created for each update or insert. Should be preceded by a call
259
+ /// to SetWriteLock.
260
+ fgdbError FreeWriteLock(void);
261
+
262
+ /// Begin or End load only mode.
263
+ /// @param[in] loadOnlyMode true to begin LoadOnlyMode, false to end.
264
+ fgdbError LoadOnlyMode(bool loadOnlyMode);
265
+ //@}
266
+
267
+ /// @name Constructors and destructors
268
+ //@{
269
+ /// The class constructor.
270
+ Table();
271
+
272
+ /// The class destructor.
273
+ ~Table();
274
+ //@}
275
+
276
+ private:
277
+
278
+ /// @cond PRIVATE
279
+ fgdbError SetupTable(const std::wstring& path, Geodatabase* pGeodatabase, Datafile* pDatafile);
280
+ bool IsSetup() const;
281
+
282
+ #pragma warning(push)
283
+ #pragma warning(disable : 4251)
284
+
285
+ Geodatabase* m_pGeodatabase;
286
+ Datafile* m_pDatafile;
287
+ std::wstring m_Path;
288
+ AutoLock* m_pWriteLock;
289
+ int m_isEditable;
290
+
291
+ #pragma warning(pop)
292
+
293
+ friend class Geodatabase;
294
+
295
+ Table(const Table&) { }
296
+ Table& operator=(const Table&) { return *this; }
297
+ /// @endcond
298
+ };
299
+
300
+ }; // namespace FileGDBAPI