main.cpp 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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. std::cout << "Could not open \"" UI_LIBWIDGET_H "\"." << std::endl;
  10. return -1;
  11. }
  12. {
  13. bool gotTr2i18n = false;
  14. while (!f.eof()) {
  15. std::string output;
  16. getline(f, output);
  17. if (!gotTr2i18n) {
  18. gotTr2i18n = output.find("tr2i18n") != std::string::npos;
  19. }
  20. if (output.find("tr2xi18n") != std::string::npos) {
  21. std::cout << "ui_libwidget,h uses tr2xi18n, though it should not."
  22. << std::endl;
  23. return -1;
  24. }
  25. }
  26. if (!gotTr2i18n) {
  27. std::cout << "Did not find tr2i18n in ui_libwidget.h" << std::endl;
  28. return -1;
  29. }
  30. }
  31. f.close();
  32. f.open(UI_MYWIDGET_H);
  33. if (!f.is_open()) {
  34. std::cout << "Could not open \"" UI_MYWIDGET_H "\"." << std::endl;
  35. return -1;
  36. }
  37. {
  38. bool gotTr2xi18n = false;
  39. while (!f.eof()) {
  40. std::string output;
  41. getline(f, output);
  42. if (!gotTr2xi18n) {
  43. gotTr2xi18n = output.find("tr2xi18n") != std::string::npos;
  44. }
  45. if (output.find("tr2i18n") != std::string::npos) {
  46. std::cout << "ui_mywidget,h uses tr2i18n, though it should not."
  47. << std::endl;
  48. return -1;
  49. }
  50. }
  51. if (!gotTr2xi18n) {
  52. std::cout << "Did not find tr2xi18n in ui_mywidget.h" << std::endl;
  53. return -1;
  54. }
  55. }
  56. f.close();
  57. return 0;
  58. }