excelapi.h 790 B

12345678910111213141516171819202122232425262728293031323334
  1. #ifndef EXCELAPI_H
  2. #define EXCELAPI_H
  3. #include <string>
  4. typedef void * (*OpenxlsxFunction)(std::string strfilepath);
  5. typedef int (*getcellvalueFunction)(void * pxlsxhanle,unsigned int column,unsigned int row,std::string & strvalue);
  6. typedef void (*ClosexlsxFunction)(void * pxlsxhanle);
  7. class ExcelAPI
  8. {
  9. public:
  10. ExcelAPI();
  11. static ExcelAPI & Inst();
  12. bool IsLoad();
  13. public:
  14. void * Openxlsx(std::string strfilepath);
  15. int getcellvalue(void * pxlsxhanle,unsigned int column,unsigned int row,std::string & strvalue);
  16. void Closexlsx(void * pxlsxhanle);
  17. private:
  18. bool mbLoad = false;
  19. OpenxlsxFunction mOpenxlsx;
  20. getcellvalueFunction mgetcellvalue;
  21. ClosexlsxFunction mClosexlsx;
  22. };
  23. #define ServiceExcelAPI ExcelAPI::Inst()
  24. #endif // EXCELAPI_H