Okay, here's an [updated] standalone example. The meat of the code is:
/* .. Describe top level contents
*/
if ((hr = geodatabase.GetChildDatasets(parentPath,datasetType,children)) != S_OK) {
msg = L"GetChildDatasets failed";
ErrorInfo::GetErrorDescription(hr,errorText);
goto bailout;
}
/* .. List contents (or their children)
*/
count = children.size();
for (size_t i = 0; i < count; i++) {
/* .. Use "OpenTable" to distinguish between FDS and FC
*/
Table table;
if ((hr = geodatabase.OpenTable(children.at(i),table)) != S_OK) {
numFDS++;
std::vector<std::wstring> grands;
fprintf(stdout," %S:\n",children.at(i).c_str());
if ((hr = geodatabase.GetChildDatasets(children.at(i),datasetType,grands)) == S_OK) {
size_t kount = grands.size();
for (size_t j = 0; j < kount; j++) {
fprintf(stdout," %S\n",grands.at(j).c_str());
numFCs++;
} }
} else {
fprintf(stdout," %S\n",children.at(i).c_str());
numFCs++;
} }
Using your dataset I get the folowing output:
norge% ./fgdbList ./WS_Data.gdb "\"
\WSInfrastructure:
\WSInfrastructure\ww_Pump
\WSInfrastructure\sw_Casing
\WSInfrastructure\sw_Catchbasin
\WSInfrastructure\sw_CatchbasinLead
\WSInfrastructure\sw_CleanOut
\WSInfrastructure\sw_ControlValve
\WSInfrastructure\sw_Culvert
\WSInfrastructure\sw_Detention
\WSInfrastructure\sw_DischargePoint
\WSInfrastructure\sw_Fitting
\WSInfrastructure\sw_Inlet
\WSInfrastructure\sw_ManagementPond
\WSInfrastructure\sw_Manhole
\WSInfrastructure\sw_NetworkStructure
\WSInfrastructure\sw_OpenDrain
\WSInfrastructure\sw_StormwaterMain
\WSInfrastructure\sw_SystemValve
\WSInfrastructure\sw_VirtualDrainline
\WSInfrastructure\w_ConnectionPoint
\WSInfrastructure\w_CurbStop
\WSInfrastructure\w_FacilityFootprint
\WSInfrastructure\w_Flowmeter
\WSInfrastructure\w_Hydrant
\WSInfrastructure\w_Node
\WSInfrastructure\w_PressureDistrictExisting
\WSInfrastructure\w_PressureDistrictPlanned
\WSInfrastructure\w_ProductionWell
\WSInfrastructure\w_Pump
\WSInfrastructure\w_PumpingStation
\WSInfrastructure\w_SamplingStation
\WSInfrastructure\w_TreatmentPlant
\WSInfrastructure\w_UndergroundEnclosure
\WSInfrastructure\w_Valve
\WSInfrastructure\w_Watermain
\WSInfrastructure\w_WaterStorage
\WSInfrastructure\ww_ConnectionPoint
\WSInfrastructure\ww_EqualizationTank
\WSInfrastructure\ww_FacilityFootprint
\WSInfrastructure\ww_FlowControl
\WSInfrastructure\ww_Flowmeter
\WSInfrastructure\ww_Manhole
\WSInfrastructure\ww_PollutionControlPlant
\WSInfrastructure\ww_PumpingStation
\WSInfrastructure\ww_PumpYR
\WSInfrastructure\ww_Sewershed
\WSInfrastructure\ww_UndergroundEnclosure
\WSInfrastructure\ww_Valve
\WSInfrastructure\ww_WastewaterMain
\IlluminationWS
\AssumptionArea
FGDB Path = ./WS_Data.gdb
Containers = 1
Num FCs = 50
norge% ./fgdbList ./WS_Data.gdb "\" "Feature Class"
\IlluminationWS
\AssumptionArea
FGDB Path = ./WS_Data.gdb
Containers = 0
Num FCs = 2
If you want to describe the fields of each table, you've got a starting point (just make sure you capture both paths where numFCs is incremented).
- V
UPDATED with a new zipfile and new source name, without timing and with corrected counting 21:24 EDT