ProcessUtils.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. //
  2. // Urho3D Engine
  3. // Copyright (c) 2008-2012 Lasse Öörni
  4. //
  5. // Permission is hereby granted, free of charge, to any person obtaining a copy
  6. // of this software and associated documentation files (the "Software"), to deal
  7. // in the Software without restriction, including without limitation the rights
  8. // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  9. // copies of the Software, and to permit persons to whom the Software is
  10. // furnished to do so, subject to the following conditions:
  11. //
  12. // The above copyright notice and this permission notice shall be included in
  13. // all copies or substantial portions of the Software.
  14. //
  15. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  16. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  17. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  18. // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  19. // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  20. // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  21. // THE SOFTWARE.
  22. //
  23. #pragma once
  24. #include "Str.h"
  25. class Mutex;
  26. /// Initialize the FPU to round-to-nearest, single precision mode.
  27. void InitFPU();
  28. /// Display an error dialog with the specified title and message.
  29. void ErrorDialog(const String& title, const String& message);
  30. /// Exit the application with an error message to the console.
  31. void ErrorExit(const String& message, int exitCode = 1);
  32. /// Open a console window.
  33. void OpenConsoleWindow();
  34. /// Print Unicode text to the console. Will not be printed to the MSVC output window.
  35. void PrintUnicode(const String& str);
  36. /// Print Unicode text to the console with a newline appended. Will not be printed to the MSVC output window.
  37. void PrintUnicodeLine(const String& str);
  38. /// Print ASCII text to the console with a newline appended. Uses printf() to allow printing into the MSVC output window.
  39. void PrintLine(const String& str);
  40. /// Parse arguments from the command line.
  41. const Vector<String>& ParseArguments(const String& cmdLine);
  42. /// Parse arguments from the command line.
  43. const Vector<String>& ParseArguments(const char* cmdLine);
  44. /// Parse arguments from a wide char command line.
  45. const Vector<String>& ParseArguments(const WString& cmdLine);
  46. /// Parse arguments from a wide char command line.
  47. const Vector<String>& ParseArguments(const wchar_t* cmdLine);
  48. /// Parse arguments from argc & argv
  49. const Vector<String>& ParseArguments(int argc, char** argv);
  50. /// Return previously parsed arguments.
  51. const Vector<String>& GetArguments();
  52. /// Read input from the console window. Return empty if no input.
  53. String GetConsoleInput();
  54. /// Return the number of physical CPU cores.
  55. unsigned GetNumPhysicalCPUs();
  56. /// Return the number of logical CPUs (different from physical if hyperthreading is used.)
  57. unsigned GetNumLogicalCPUs();
  58. /// Return the static library init/shutdown mutex.
  59. Mutex& GetStaticMutex();