68 lines
1.5 KiB
C++
Raw Normal View History

2014-08-03 19:52:23 +02:00
#include <fstream>
#include <iostream>
#include <string>
2016-07-09 11:21:54 +02:00
int main(int argc, char** argv)
2014-08-03 19:52:23 +02:00
{
std::ifstream f;
f.open(UI_LIBWIDGET_H);
2016-07-09 11:21:54 +02:00
if (!f.is_open()) {
2014-08-03 19:52:23 +02:00
std::cout << "Could not open \"" UI_LIBWIDGET_H "\"." << std::endl;
return -1;
2016-07-09 11:21:54 +02:00
}
2014-08-03 19:52:23 +02:00
{
2016-07-09 11:21:54 +02:00
bool gotTr2i18n = false;
2014-08-03 19:52:23 +02:00
2016-07-09 11:21:54 +02:00
while (!f.eof()) {
std::string output;
getline(f, output);
if (!gotTr2i18n) {
gotTr2i18n = output.find("tr2i18n") != std::string::npos;
2014-08-03 19:52:23 +02:00
}
2016-07-09 11:21:54 +02:00
if (output.find("tr2xi18n") != std::string::npos) {
std::cout << "ui_libwidget,h uses tr2xi18n, though it should not."
<< std::endl;
return -1;
2014-08-03 19:52:23 +02:00
}
}
2016-07-09 11:21:54 +02:00
if (!gotTr2i18n) {
std::cout << "Did not find tr2i18n in ui_libwidget.h" << std::endl;
return -1;
2014-08-03 19:52:23 +02:00
}
}
f.close();
f.open(UI_MYWIDGET_H);
2016-07-09 11:21:54 +02:00
if (!f.is_open()) {
2014-08-03 19:52:23 +02:00
std::cout << "Could not open \"" UI_MYWIDGET_H "\"." << std::endl;
return -1;
2016-07-09 11:21:54 +02:00
}
2014-08-03 19:52:23 +02:00
{
2016-07-09 11:21:54 +02:00
bool gotTr2xi18n = false;
2014-08-03 19:52:23 +02:00
2016-07-09 11:21:54 +02:00
while (!f.eof()) {
std::string output;
getline(f, output);
if (!gotTr2xi18n) {
gotTr2xi18n = output.find("tr2xi18n") != std::string::npos;
2014-08-03 19:52:23 +02:00
}
2016-07-09 11:21:54 +02:00
if (output.find("tr2i18n") != std::string::npos) {
std::cout << "ui_mywidget,h uses tr2i18n, though it should not."
<< std::endl;
return -1;
2014-08-03 19:52:23 +02:00
}
}
2016-07-09 11:21:54 +02:00
if (!gotTr2xi18n) {
std::cout << "Did not find tr2xi18n in ui_mywidget.h" << std::endl;
return -1;
2014-08-03 19:52:23 +02:00
}
}
f.close();
return 0;
}