version.h 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. // These variables are autogenerated and compiled
  2. // into the library by the version.cmake script
  3. extern "C"
  4. {
  5. extern const char* GIT_TAG;
  6. extern const char* GIT_REV;
  7. extern const char* GIT_BRANCH;
  8. extern const char* BUILD_TIME;
  9. }
  10. #include <string>
  11. #include <string.h>
  12. #include "Helper.h"
  13. #include <fstream>
  14. const char* GIT_BASE_BRANCH = "master - v8.2.0 - 2021-08-24";
  15. const char* git_base_branch(void)
  16. {
  17. return GIT_BASE_BRANCH;
  18. }
  19. const char* build_time(void)
  20. {
  21. return BUILD_TIME;
  22. }
  23. const char* libfive_git_version(void)
  24. {
  25. return GIT_TAG;
  26. }
  27. const char* libfive_git_revision(void)
  28. {
  29. return GIT_REV;
  30. }
  31. const char* libfive_git_branch(void)
  32. {
  33. return GIT_BRANCH;
  34. }
  35. std::string getHTMLversion(void){
  36. string line = "";
  37. FILE* pFile;
  38. string fn = FormatFileName("/sdcard/html/version.txt");
  39. pFile = fopen(fn.c_str(), "r");
  40. if (pFile == NULL)
  41. return std::string("NAN");
  42. char zw[1024];
  43. fgets(zw, 1024, pFile);
  44. line = std::string(trim(zw));
  45. fclose(pFile);
  46. return line;
  47. }