StdInc.h 859 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  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. #include <QTemporaryDir>
  20. VCMI_LIB_USING_NAMESPACE
  21. inline QString pathToQString(const boost::filesystem::path & path)
  22. {
  23. #ifdef VCMI_WINDOWS
  24. return QString::fromStdWString(path.wstring());
  25. #else
  26. return QString::fromStdString(path.string());
  27. #endif
  28. }
  29. inline boost::filesystem::path qstringToPath(const QString & path)
  30. {
  31. #ifdef VCMI_WINDOWS
  32. return boost::filesystem::path(path.toStdWString());
  33. #else
  34. return boost::filesystem::path(path.toUtf8().data());
  35. #endif
  36. }