main.cpp 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. #include <fstream>
  2. #include <iostream>
  3. #include <string>
  4. int main(int argc, char **argv)
  5. {
  6. std::ifstream f;
  7. f.open(UI_LIBWIDGET_H);
  8. if (!f.is_open())
  9. {
  10. std::cout << "Could not open \"" UI_LIBWIDGET_H "\"." << std::endl;
  11. return -1;
  12. }
  13. {
  14. bool gotTr2i18n = false;
  15. while (!f.eof())
  16. {
  17. std::string output;
  18. getline(f, output);
  19. if (!gotTr2i18n)
  20. {
  21. gotTr2i18n = output.find("tr2i18n") != std::string::npos;
  22. }
  23. if (output.find("tr2xi18n") != std::string::npos)
  24. {
  25. std::cout << "ui_libwidget,h uses tr2xi18n, though it should not." << std::endl;
  26. return -1;
  27. }
  28. }
  29. if (!gotTr2i18n)
  30. {
  31. std::cout << "Did not find tr2i18n in ui_libwidget.h" << std::endl;
  32. return -1;
  33. }
  34. }
  35. f.close();
  36. f.open(UI_MYWIDGET_H);
  37. if (!f.is_open())
  38. {
  39. std::cout << "Could not open \"" UI_MYWIDGET_H "\"." << std::endl;
  40. return -1;
  41. }
  42. {
  43. bool gotTr2xi18n = false;
  44. while (!f.eof())
  45. {
  46. std::string output;
  47. getline(f, output);
  48. if (!gotTr2xi18n)
  49. {
  50. gotTr2xi18n = output.find("tr2xi18n") != std::string::npos;
  51. }
  52. if (output.find("tr2i18n") != std::string::npos)
  53. {
  54. std::cout << "ui_mywidget,h uses tr2i18n, though it should not." << std::endl;
  55. return -1;
  56. }
  57. }
  58. if (!gotTr2xi18n)
  59. {
  60. std::cout << "Did not find tr2xi18n in ui_mywidget.h" << std::endl;
  61. return -1;
  62. }
  63. }
  64. f.close();
  65. return 0;
  66. }