MCPcopy Create free account
hub / github.com/ValveSoftware/openvr / Path_WriteStringToTextFile

Function Path_WriteStringToTextFile

src/vrcore/pathtools_public.cpp:818–841  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

816}
817
818bool Path_WriteStringToTextFile( const std::string &strFilename, const char *pchData )
819{
820 FILE *f;
821#if defined( POSIX )
822 f = fopen( strFilename.c_str(), "w" );
823#else
824 std::wstring wstrFilename = UTF8to16( strFilename.c_str() );
825 errno_t err = _wfopen_s( &f, wstrFilename.c_str(), L"w" );
826 if ( err != 0 )
827 {
828 f = NULL;
829 }
830#endif
831
832 bool ok = false;
833
834 if ( f != NULL )
835 {
836 ok = fputs( pchData, f) >= 0;
837 fclose(f);
838 }
839
840 return ok;
841}
842
843bool Path_WriteStringToTextFileAtomic( const std::string &strFilename, const char *pchData )
844{

Callers 2

BSaveToFileMethod · 0.70

Calls 1

UTF8to16Function · 0.70

Tested by

no test coverage detected