#include <OSD_Protection.hxx>
#include <Standard_ProgramError.hxx>
#include <TCollection_ExtendedString.hxx>
+#include <NCollection_String.hxx>
#include <OSD_WNT_1.hxx>
} // end constructor ( 2 )
-void OSD_Directory :: Build (const OSD_Protection& Protect ) {
+void OSD_Directory :: Build (const OSD_Protection& Protect) {
TCollection_AsciiString dirName;
if ( dirName.IsEmpty () )
- Standard_ProgramError :: Raise (
- TEXT( "OSD_Directory :: Build (): incorrect call - no directory name" )
- );
+ Standard_ProgramError :: Raise ( "OSD_Directory :: Build (): incorrect call - no directory name");
TCollection_ExtendedString dirNameW(dirName);
- if ( Exists () || CreateDirectoryW ( (const wchar_t*) dirNameW.ToExtString (), NULL ) )
-
- SetProtection ( Protect );
-
- else
+ if (Exists() || CreateDirectoryW((const wchar_t*)dirNameW.ToExtString(), NULL)) {
+#ifndef OCCT_UWP
+ SetProtection(Protect);
+#else
+ (void)Protect;
+#endif
+ } else
_osd_wnt_set_error ( myError, OSD_WDirectory );
OSD_Directory retVal;
OSD_Protection prt;
- OSD_Path dirPath ( tctmpnam ( NULL ) );
+
+ wchar_t* aName = _wtmpnam(NULL);
+ NCollection_String aFolder(aName != NULL ? aName : L"");
+ OSD_Path dirPath(aFolder.ToCString());
retVal.SetPath ( dirPath );
retVal.Build ( prt );