StdInc.h 833 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /*
  2. * StdInc.h, part of VCMI engine
  3. *
  4. * Authors: listed in file AUTHORS in main folder
  5. *
  6. * License: GNU General Public License v2.0 or later
  7. * Full text of license available in license.txt file, in main folder
  8. *
  9. */
  10. #pragma once
  11. #include "../Global.h"
  12. #include <QtWidgets>
  13. #include <QStringList>
  14. #include <QSet>
  15. #include <QVector>
  16. #include <QList>
  17. #include <QString>
  18. #include <QFile>
  19. VCMI_LIB_USING_NAMESPACE
  20. inline QString pathToQString(const boost::filesystem::path & path)
  21. {
  22. #ifdef VCMI_WINDOWS
  23. return QString::fromStdWString(path.wstring());
  24. #else
  25. return QString::fromStdString(path.string());
  26. #endif
  27. }
  28. inline boost::filesystem::path qstringToPath(const QString & path)
  29. {
  30. #ifdef VCMI_WINDOWS
  31. return boost::filesystem::path(path.toStdWString());
  32. #else
  33. return boost::filesystem::path(path.toUtf8().data());
  34. #endif
  35. }