| 634 | } |
| 635 | |
| 636 | bool Path_WriteBinaryFile(const std::string &strFilename, unsigned char *pData, unsigned nSize) |
| 637 | { |
| 638 | FILE *f; |
| 639 | #if defined( POSIX ) |
| 640 | f = fopen(strFilename.c_str(), "wb"); |
| 641 | #else |
| 642 | std::wstring wstrFilename = UTF8to16( strFilename.c_str() ); |
| 643 | errno_t err = _wfopen_s( &f, wstrFilename.c_str(), L"wb" ); |
| 644 | if (err != 0) |
| 645 | { |
| 646 | f = NULL; |
| 647 | } |
| 648 | #endif |
| 649 | |
| 650 | size_t written = 0; |
| 651 | if (f != NULL) { |
| 652 | written = fwrite(pData, sizeof(unsigned char), nSize, f); |
| 653 | fclose(f); |
| 654 | } |
| 655 | |
| 656 | return written = nSize ? true : false; |
| 657 | } |
| 658 | |
| 659 | std::string Path_ReadTextFile( const std::string &strFilename ) |
| 660 | { |
nothing calls this directly
no test coverage detected