Select to view content in your preferred language

Accessing the FieldType

2736
1
08-31-2011 06:36 PM
ReneRubalcava
Esri Frequent Contributor
Maybe I'm looking at this wrong, but I have looked over the docs and can't find any further info on FieldType, except that it's a parameter to FieldInfo::GetFieldType().

FieldInfo fInfo;
table.GetFieldInformation(fInfo);
int count = 0;
fInfo.GetFieldCount(count);
wstring fieldNames = L"";
for (int x = 0; x < count; x++)
{
 wstring f = L"";
 fInfo.GetFieldName(x, f);
 fieldNames.append(f);
 FieldType fType;
 fInfo.GetFieldType(x, fType);
 fieldNames.append(L", ");
}


Basically, what I'm trying to do is get the names of each field and the field type.
When I test something like this out in a sample app, I can do
wcout << fType << endl;

I get an integer, which I am guessing coincides with an something like esriIntegerType, but are there methods to FieldType, like toString() or something to get that?
I'm new to C++ and I'm just a little confused on how to use this.

Thanks.
0 Kudos
1 Reply
ReneRubalcava
Esri Frequent Contributor
Nevermind. I found it. It's an Enum in FileGDBCore.h
enum FieldType
{
  fieldTypeSmallInteger =  0,
  fieldTypeInteger      =  1,
  fieldTypeSingle       =  2,
  fieldTypeDouble       =  3,
  fieldTypeString       =  4,
  fieldTypeDate         =  5,
  fieldTypeOID          =  6,
  fieldTypeGeometry     =  7,
  fieldTypeBlob         =  8,
  fieldTypeRaster       =  9,
  fieldTypeGUID         = 10,
  fieldTypeGlobalID     = 11,
  fieldTypeXML          = 12,
};


Noob mistake.
0 Kudos