#include <iostream>
int main(int argc, char* argv[])
{
if (argc != 2)
{
std::cerr << "Usage: " << argv[0] << " <odimh5file>" << std::endl;
return -1;
}
OdimFactory* factory = NULL;
OdimObject* odimobj = NULL;
try
{
factory = new OdimFactory();
odimobj = factory->open(argv[1]);
std::string object = odimobj->getObject();
time_t datetime = odimobj->getDateTime();
bool boolval = odimobj->getWhat()->getBool("booleano");
char charval = odimobj->getWhat()->getChar("char");
unsigned char ucharval = odimobj->getWhat()->getUChar("unsigned char");
short shortval = odimobj->getWhat()->getShort("short");
unsigned short ushortval = odimobj->getWhat()->getUShort("unsigned short");
int intval = odimobj->getWhat()->getInt("int");
unsigned int uintval = odimobj->getWhat()->getUInt("unsigned int");
int64_t int64val = odimobj->getWhat()->getLong("long");
float floatval = odimobj->getWhat()->getFloat("float");
double doubleval = odimobj->getWhat()->getDouble("double");
std::string stringval = odimobj->getWhat()->getStr("string");
std::vector<bool> bools = odimobj->getWhat()->getBools("bools");
std::vector<int> ints = odimobj->getWhat()->getInts("ints");
std::vector<double> doubles = odimobj->getWhat()->getDoubles("doubles");
std::vector<std::string> strings = odimobj->getWhat()->getStrings("strings");
std::vector<std::pair<float,float> > angles;
angles = odimobj->getWhat()->getFloatPairs("angles");
AZTimes tempo1;
AZTimes tempo2;
std::vector<AZTimes> tempi = odimobj->getWhat()->getAZTimes("tempi");
tempo1 = tempi[0];
tempo2 = tempi[1];
std::cout << "Lettura eseguita!" << std::endl;
}
catch (std::exception& stde)
{
std::cerr << "Errore di esecuzione: " << stde.what() << std::endl;
}
catch (...)
{
std::cerr << "Errore sconosciuto" << std::endl;
}
delete odimobj;
delete factory;
return 0;
}
Namespace related to ODIMH5 version 2.0.
Definition: odimh5v20.hpp:46
Main header file of the library.