#ifndef IVVERSION_H
#define IVVERSION_H

#include "ivversion_def.h"   //Please use common.pri, If you don't want use ivversion_def.h can comment this line.

#include <iostream>

#ifndef IVVERSION
#define IVVERSION "1.1.0-develop"
#endif

//#include <iostream>
//#include <stdio.h>
//#include <fstream>
//#include <string.h>

//#include <QFile>

//std::string getgitversion()
//{
//    std::string strrtn;
//    bool bfileok = false;
//    char strpath[256];
//    char strtem[256];
//    char strbase[256];
//    snprintf(strbase,256,"./.git/refs/heads/master");
//    snprintf(strtem,256,"./.");
//    int i;
//    for(i=0;i<5;i++)
//    {
//        strncpy(strpath,strtem,256);
//        int j;
//        for(j=0;j<i;j++)strncat(strpath,strtem,256);
//        strncat(strpath,strbase,256);
//        std::ifstream f(strpath);
//        if(f.good())
//        {
//            char strdata[256];
//            f.read(strdata,256);
//            if(f.gcount()>0)strrtn.append(strdata,f.gcount());

//            //        std::cout<<"file ok"<<"size is "<<f.gcount()<<std::endl;
//            bfileok = true;
//            f.close();
//            break;
//        }
//        else
//        {
//            //        std::cout<<" not ok"<<std::endl;
//        }
//    }
//    if(bfileok == false)
//    {
//        strrtn = VERSION;
//    }
//    return strrtn;
//}

#define showversion(modulename) do{std::cout<<"ADC IV Version:"<<IVVERSION<<" | Module name: "<<modulename<<" | Build Time: "<<__DATE__<<" "<<__TIME__<<std::endl;}while(0);

//#define showversion(modulename) do{std::cout<<"ADC IV Version:"<<getgitversion()<<" | Module name: "<<modulename<<" | Build Time: "<<__DATE__<<" "<<__TIME__<<std::endl;}while(0);

#endif