| 1046 | // --------------------------------------------------------------------------- |
| 1047 | |
| 1048 | bool FileManager::mkdir(PJ_CONTEXT *ctx, const char *filename) { |
| 1049 | if (ctx->fileApi.mkdir_cbk) { |
| 1050 | return ctx->fileApi.mkdir_cbk(ctx, filename, ctx->fileApi.user_data) != |
| 1051 | 0; |
| 1052 | } |
| 1053 | |
| 1054 | #ifdef _WIN32 |
| 1055 | try { |
| 1056 | return _wmkdir(UTF8ToWString(filename).c_str()) == 0; |
| 1057 | } catch (const std::exception &e) { |
| 1058 | pj_log(ctx, PJ_LOG_DEBUG, "%s", e.what()); |
| 1059 | return false; |
| 1060 | } |
| 1061 | #else |
| 1062 | (void)ctx; |
| 1063 | return ::mkdir(filename, 0755) == 0; |
| 1064 | #endif |
| 1065 | } |
| 1066 | |
| 1067 | // --------------------------------------------------------------------------- |
| 1068 |
no test coverage detected