1
1
using System ;
2
2
using System . ComponentModel ;
3
+ using System . Text ;
3
4
using TileDB . Interop ;
4
5
5
6
namespace TileDB . CSharp
@@ -185,156 +186,294 @@ public enum DataType : uint
185
186
/// <summary>
186
187
/// A signed 32-bit integer.
187
188
/// </summary>
189
+ /// <remarks>
190
+ /// On generic methods operating to objects of this datatype,
191
+ /// this datatype can be used with <see cref="int"/>.
192
+ /// </remarks>
188
193
Int32 = tiledb_datatype_t . TILEDB_INT32 ,
189
194
/// <summary>
190
195
/// A signed 64-bit integer.
191
196
/// </summary>
197
+ /// <remarks>
198
+ /// On generic methods operating to objects of this datatype,
199
+ /// this datatype can be used with <see cref="long"/>.
200
+ /// </remarks>
192
201
Int64 = tiledb_datatype_t . TILEDB_INT64 ,
193
202
/// <summary>
194
203
/// A 32-bit floating-point number.
195
204
/// </summary>
205
+ /// <remarks>
206
+ /// On generic methods operating to objects of this datatype,
207
+ /// this datatype can be used with <see cref="float"/>.
208
+ /// </remarks>
196
209
Float32 = tiledb_datatype_t . TILEDB_FLOAT32 ,
197
210
/// <summary>
198
211
/// A 64-bit floating-point number.
199
212
/// </summary>
213
+ /// <remarks>
214
+ /// On generic methods operating to objects of this datatype,
215
+ /// this datatype can be used with <see cref="double"/>.
216
+ /// </remarks>
200
217
Float64 = tiledb_datatype_t . TILEDB_FLOAT64 ,
201
218
/// <summary>
202
219
/// A signed 8-bit integer.
203
220
/// </summary>
221
+ /// <remarks>
222
+ /// On generic methods operating to objects of this datatype,
223
+ /// this datatype can be used with <see cref="sbyte"/>.
224
+ /// </remarks>
204
225
Int8 = tiledb_datatype_t . TILEDB_INT8 ,
205
226
/// <summary>
206
227
/// An unsigned 8-bit integer.
207
228
/// </summary>
229
+ /// <remarks>
230
+ /// On generic methods operating to objects of this datatype,
231
+ /// this datatype can be used with <see cref="byte"/>.
232
+ /// </remarks>
208
233
UInt8 = tiledb_datatype_t . TILEDB_UINT8 ,
209
234
/// <summary>
210
235
/// A signed 16-bit integer.
211
236
/// </summary>
237
+ /// <remarks>
238
+ /// On generic methods operating to objects of this datatype,
239
+ /// this datatype can be used with <see cref="short"/>.
240
+ /// </remarks>
212
241
Int16 = tiledb_datatype_t . TILEDB_INT16 ,
213
242
/// <summary>
214
243
/// An unsigned 16-bit integer.
215
244
/// </summary>
245
+ /// <remarks>
246
+ /// On generic methods operating to objects of this datatype,
247
+ /// this datatype can be used with <see cref="ushort"/>.
248
+ /// </remarks>
216
249
UInt16 = tiledb_datatype_t . TILEDB_UINT16 ,
217
250
/// <summary>
218
251
/// An unsigned 32-bit integer.
219
252
/// </summary>
253
+ /// <remarks>
254
+ /// On generic methods operating to objects of this datatype,
255
+ /// this datatype can be used with <see cref="uint"/>.
256
+ /// </remarks>
220
257
UInt32 = tiledb_datatype_t . TILEDB_UINT32 ,
221
258
/// <summary>
222
259
/// An unsigned 64-bit integer.
223
260
/// </summary>
261
+ /// <remarks>
262
+ /// On generic methods operating to objects of this datatype,
263
+ /// this datatype can be used with <see cref="ulong"/>.
264
+ /// </remarks>
224
265
UInt64 = tiledb_datatype_t . TILEDB_UINT64 ,
225
266
/// <summary>
226
267
/// An ASCII string.
227
268
/// </summary>
269
+ /// <remarks>
270
+ /// On generic methods operating to objects of this datatype,
271
+ /// this datatype can be used with <see cref="byte"/>.
272
+ /// </remarks>
228
273
StringAscii = tiledb_datatype_t . TILEDB_STRING_ASCII ,
229
274
/// <summary>
230
275
/// A UTF-8 string.
231
276
/// </summary>
277
+ /// <remarks>
278
+ /// On generic methods operating to objects of this datatype,
279
+ /// this datatype can be used with <see cref="byte"/>.
280
+ /// </remarks>
232
281
StringUtf8 = tiledb_datatype_t . TILEDB_STRING_UTF8 ,
233
282
/// <summary>
234
283
/// A UTF-16 string.
235
284
/// </summary>
285
+ /// <remarks>
286
+ /// On generic methods operating to objects of this datatype,
287
+ /// this datatype can be used with <see cref="ushort"/> or <see cref="char"/>.
288
+ /// </remarks>
236
289
StringUtf16 = tiledb_datatype_t . TILEDB_STRING_UTF16 ,
237
290
/// <summary>
238
291
/// A UTF-32 string.
239
292
/// </summary>
293
+ /// <remarks>
294
+ /// On generic methods operating to objects of this datatype,
295
+ /// this datatype can be used with <see cref="uint"/>.
296
+ /// </remarks>
240
297
StringUtf32 = tiledb_datatype_t . TILEDB_STRING_UTF32 ,
241
298
/// <summary>
242
299
/// A date and time, counted as the signed 64-bit number of
243
300
/// years since the Unix epoch (January 1 1970 at midnight).
244
301
/// </summary>
302
+ /// <remarks>
303
+ /// On generic methods operating to objects of this datatype,
304
+ /// this datatype can be used with <see cref="long"/>.
305
+ /// </remarks>
245
306
DateTimeYear = tiledb_datatype_t . TILEDB_DATETIME_YEAR ,
246
307
/// <summary>
247
308
/// A date and time, counted as the signed 64-bit number of
248
309
/// months since the Unix epoch (January 1 1970 at midnight).
249
310
/// </summary>
311
+ /// <remarks>
312
+ /// On generic methods operating to objects of this datatype,
313
+ /// this datatype can be used with <see cref="long"/>.
314
+ /// </remarks>
250
315
DateTimeMonth = tiledb_datatype_t . TILEDB_DATETIME_MONTH ,
251
316
/// <summary>
252
317
/// A date and time, counted as the signed 64-bit number of
253
318
/// weeks since the Unix epoch (January 1 1970 at midnight).
254
319
/// </summary>
320
+ /// <remarks>
321
+ /// On generic methods operating to objects of this datatype,
322
+ /// this datatype can be used with <see cref="long"/>.
323
+ /// </remarks>
255
324
DateTimeWeek = tiledb_datatype_t . TILEDB_DATETIME_WEEK ,
256
325
/// <summary>
257
326
/// A date and time, counted as the signed 64-bit number of
258
327
/// days since the Unix epoch (January 1 1970 at midnight).
259
328
/// </summary>
329
+ /// <remarks>
330
+ /// On generic methods operating to objects of this datatype,
331
+ /// this datatype can be used with <see cref="long"/>.
332
+ /// </remarks>
260
333
DateTimeDay = tiledb_datatype_t . TILEDB_DATETIME_DAY ,
261
334
/// <summary>
262
335
/// A date and time, counted as the signed 64-bit number of
263
336
/// hours since the Unix epoch (January 1 1970 at midnight).
264
337
/// </summary>
338
+ /// <remarks>
339
+ /// On generic methods operating to objects of this datatype,
340
+ /// this datatype can be used with <see cref="long"/>.
341
+ /// </remarks>
265
342
DateTimeHour = tiledb_datatype_t . TILEDB_DATETIME_HR ,
266
343
/// <summary>
267
344
/// A date and time, counted as the signed 64-bit number of
268
345
/// minutes since the Unix epoch (January 1 1970 at midnight).
269
346
/// </summary>
347
+ /// <remarks>
348
+ /// On generic methods operating to objects of this datatype,
349
+ /// this datatype can be used with <see cref="long"/>.
350
+ /// </remarks>
270
351
DateTimeMinute = tiledb_datatype_t . TILEDB_DATETIME_MIN ,
271
352
/// <summary>
272
353
/// A date and time, counted as the signed 64-bit number of
273
354
/// seconds since the Unix epoch (January 1 1970 at midnight).
274
355
/// </summary>
356
+ /// <remarks>
357
+ /// On generic methods operating to objects of this datatype,
358
+ /// this datatype can be used with <see cref="long"/>.
359
+ /// </remarks>
275
360
DateTimeSecond = tiledb_datatype_t . TILEDB_DATETIME_SEC ,
276
361
/// <summary>
277
362
/// A date and time, counted as the signed 64-bit number of
278
363
/// milliseconds since the Unix epoch (January 1 1970 at midnight).
279
364
/// </summary>
365
+ /// <remarks>
366
+ /// On generic methods operating to objects of this datatype,
367
+ /// this datatype can be used with <see cref="long"/>.
368
+ /// </remarks>
280
369
DateTimeMillisecond = tiledb_datatype_t . TILEDB_DATETIME_MS ,
281
370
/// <summary>
282
371
/// A date and time, counted as the signed 64-bit number of
283
372
/// microseconds since the Unix epoch (January 1 1970 at midnight).
284
373
/// </summary>
374
+ /// <remarks>
375
+ /// On generic methods operating to objects of this datatype,
376
+ /// this datatype can be used with <see cref="long"/>.
377
+ /// </remarks>
285
378
DateTimeMicrosecond = tiledb_datatype_t . TILEDB_DATETIME_US ,
286
379
/// <summary>
287
380
/// A date and time, counted as the signed 64-bit number of
288
381
/// nanoseconds since the Unix epoch (January 1 1970 at midnight).
289
382
/// </summary>
383
+ /// <remarks>
384
+ /// On generic methods operating to objects of this datatype,
385
+ /// this datatype can be used with <see cref="long"/>.
386
+ /// </remarks>
290
387
DateTimeNanosecond = tiledb_datatype_t . TILEDB_DATETIME_NS ,
291
388
/// <summary>
292
389
/// A date and time, counted as the signed 64-bit number of
293
390
/// picoseconds since the Unix epoch (January 1 1970 at midnight).
294
391
/// </summary>
295
392
/// <remarks>
393
+ /// <para>
296
394
/// One second consists of one trillion picoseconds.
395
+ /// </para>
396
+ /// <para>
397
+ /// On generic methods operating to objects of this datatype,
398
+ /// this datatype can be used with <see cref="long"/>.
399
+ /// </para>
297
400
/// </remarks>
298
401
DateTimePicosecond = tiledb_datatype_t . TILEDB_DATETIME_PS ,
299
402
/// <summary>
300
403
/// A date and time, counted as the signed 64-bit number of
301
404
/// femtoseconds since the Unix epoch (January 1 1970 at midnight).
302
405
/// </summary>
303
406
/// <remarks>
407
+ /// <para>
304
408
/// One second consists of one quadrillion femtoseconds.
409
+ /// </para>
410
+ /// <para>
411
+ /// On generic methods operating to objects of this datatype,
412
+ /// this datatype can be used with <see cref="long"/>.
413
+ /// </para>
305
414
/// </remarks>
306
415
DateTimeFemtosecond = tiledb_datatype_t . TILEDB_DATETIME_FS ,
307
416
/// <summary>
308
417
/// A date and time, counted as the signed 64-bit number of
309
418
/// attoseconds since the Unix epoch (January 1 1970 at midnight).
310
419
/// </summary>
311
420
/// <remarks>
421
+ /// <para>
312
422
/// One second consists of one quintillion attoseconds.
423
+ /// </para>
424
+ /// <para>
425
+ /// On generic methods operating to objects of this datatype,
426
+ /// this datatype can be used with <see cref="long"/>.
427
+ /// </para>
313
428
/// </remarks>
314
429
DateTimeAttosecond = tiledb_datatype_t . TILEDB_DATETIME_AS ,
315
430
/// <summary>
316
431
/// A time of day counted in hours.
317
432
/// </summary>
433
+ /// <remarks>
434
+ /// On generic methods operating to objects of this datatype,
435
+ /// this datatype can be used with <see cref="long"/>.
436
+ /// </remarks>
318
437
TimeHour = tiledb_datatype_t . TILEDB_TIME_HR ,
319
438
/// <summary>
320
439
/// A time of day counted in minutes.
321
440
/// </summary>
441
+ /// <remarks>
442
+ /// On generic methods operating to objects of this datatype,
443
+ /// this datatype can be used with <see cref="long"/>.
444
+ /// </remarks>
322
445
TimeMinute = tiledb_datatype_t . TILEDB_TIME_MIN ,
323
446
/// <summary>
324
447
/// A time of day counted in seconds.
325
448
/// </summary>
449
+ /// <remarks>
450
+ /// On generic methods operating to objects of this datatype,
451
+ /// this datatype can be used with <see cref="long"/>.
452
+ /// </remarks>
326
453
TimeSecond = tiledb_datatype_t . TILEDB_TIME_SEC ,
327
454
/// <summary>
328
455
/// A time of day counted in milliseconds.
329
456
/// </summary>
457
+ /// <remarks>
458
+ /// On generic methods operating to objects of this datatype,
459
+ /// this datatype can be used with <see cref="long"/>.
460
+ /// </remarks>
330
461
TimeMillisecond = tiledb_datatype_t . TILEDB_TIME_MS ,
331
462
/// <summary>
332
463
/// A time of day counted in microseconds.
333
464
/// </summary>
465
+ /// <remarks>
466
+ /// On generic methods operating to objects of this datatype,
467
+ /// this datatype can be used with <see cref="long"/>.
468
+ /// </remarks>
334
469
TimeMicrosecond = tiledb_datatype_t . TILEDB_TIME_US ,
335
470
/// <summary>
336
471
/// A time of day counted in nanoseconds.
337
472
/// </summary>
473
+ /// <remarks>
474
+ /// On generic methods operating to objects of this datatype,
475
+ /// this datatype can be used with <see cref="long"/>.
476
+ /// </remarks>
338
477
TimeNanosecond = tiledb_datatype_t . TILEDB_TIME_NS ,
339
478
/// <summary>
340
479
/// A time of day counted in picoseconds.
@@ -349,12 +488,20 @@ public enum DataType : uint
349
488
/// </summary>
350
489
TimeAttosecond = tiledb_datatype_t . TILEDB_TIME_AS ,
351
490
/// <summary>
352
- /// A binary blob .
491
+ /// Binary data .
353
492
/// </summary>
493
+ /// <remarks>
494
+ /// On generic methods operating to objects of this datatype,
495
+ /// this datatype can be used with <see cref="byte"/>.
496
+ /// </remarks>
354
497
Blob = tiledb_datatype_t . TILEDB_BLOB ,
355
498
/// <summary>
356
499
/// A boolean value.
357
500
/// </summary>
501
+ /// <remarks>
502
+ /// On generic methods operating to objects of this datatype,
503
+ /// this datatype can be used with <see cref="byte"/> or <see cref="bool"/>.
504
+ /// </remarks>
358
505
Boolean = tiledb_datatype_t . TILEDB_BOOL
359
506
}
360
507
@@ -1025,6 +1172,15 @@ public static DataType TypeToDataType(Type t)
1025
1172
}
1026
1173
}
1027
1174
1175
+ /// <summary>
1176
+ /// Gets the corresponding <see cref="Type"/> of a <see cref="DataType"/>.
1177
+ /// </summary>
1178
+ /// <param name="datatype">The datatype to convert.</param>
1179
+ /// <remarks>
1180
+ /// Some data types like <see cref="DataType.Boolean"/> and <see cref="DataType.StringUtf16"/>
1181
+ /// correspond to both a numeric type like <see cref="ushort"/> and a non-numeric type like <see cref="char"/>.
1182
+ /// This method will return the numeric type.
1183
+ /// </remarks>
1028
1184
public static Type DataTypeToType ( DataType datatype )
1029
1185
{
1030
1186
switch ( datatype )
@@ -1056,10 +1212,12 @@ public static Type DataTypeToType(DataType datatype)
1056
1212
case DataType . Int8 :
1057
1213
return typeof ( sbyte ) ;
1058
1214
case DataType . StringAscii :
1215
+ case DataType . StringUtf8 :
1216
+ return typeof ( byte ) ;
1059
1217
case DataType . StringUtf16 :
1218
+ return typeof ( ushort ) ;
1060
1219
case DataType . StringUtf32 :
1061
- case DataType . StringUtf8 :
1062
- return typeof ( sbyte ) ;
1220
+ return typeof ( uint ) ;
1063
1221
case DataType . TimeAttosecond :
1064
1222
case DataType . TimeFemtosecond :
1065
1223
case DataType . TimeHour :
@@ -1081,7 +1239,7 @@ public static Type DataTypeToType(DataType datatype)
1081
1239
case DataType . Blob :
1082
1240
return typeof ( byte ) ;
1083
1241
case DataType . Boolean :
1084
- return typeof ( byte ) ;
1242
+ return typeof ( bool ) ;
1085
1243
default :
1086
1244
return typeof ( byte ) ;
1087
1245
}
0 commit comments