Output.cpp 688 B

12345678910111213141516171819202122232425
  1. #include "il2cpp-config.h"
  2. #include "il2cpp-object-internals.h"
  3. #include "Output.h"
  4. #include "os/ErrorCodes.h"
  5. #include "os/File.h"
  6. #include "StringUtils.h"
  7. using namespace il2cpp::utils;
  8. static inline void WriteToHandle(il2cpp::os::FileHandle* handle, const char* message)
  9. {
  10. int error = il2cpp::os::kErrorCodeSuccess;
  11. il2cpp::os::File::Write(handle, message, static_cast<int>(strlen(message)), &error);
  12. IL2CPP_ASSERT(error == il2cpp::os::kErrorCodeSuccess);
  13. }
  14. void Output::WriteToStdout(const char* message)
  15. {
  16. WriteToHandle(os::File::GetStdOutput(), message);
  17. }
  18. void Output::WriteToStderr(const char* message)
  19. {
  20. WriteToHandle(os::File::GetStdError(), message);
  21. }