-
Notifications
You must be signed in to change notification settings - Fork 806
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SetTempFolder() should take wchar_t instead of char so that we don't #1916
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
//****************************************************************************** | ||
//****************************************************************************** | ||
// | ||
// Copyright (c) Microsoft. All rights reserved. | ||
// | ||
|
@@ -179,6 +179,6 @@ int ApplicationMainStart(const char* principalName, | |
return 0; | ||
} | ||
|
||
void SetTemporaryFolder(const char* folder) { | ||
NSSetTemporaryDirectory([NSString stringWithCString:folder]); | ||
void SetTemporaryFolder(const wchar_t* folder) { | ||
NSSetTemporaryDirectory([NSString stringWithCharacters:(const unichar*)folder length:wcslen(folder)]); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I could have just changed this function to use NSString stringWithUTF8String, but there is no need for back and forth conversions, so just roll with UTF16. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit:C++ style cast? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Darn. If there was some way to get a HSTRING out of the layer above this one, we could pass it via the NSString HSTRING bridge. That'd save us a whole copy :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @DHowett-MSFT yes, and in fact, we do get the value from a HSTRING. But this being a temp folder, it is going to be copied when added to any file path. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes it will be copied there anyway. It would still save a copy to not have a useless extra layer here to set it ... In reply to: 99445013 [](ancestors = 99445013) |
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is really, really silly. Why do we need to set these at runtime like this. When would this not be what we want. Seems like we should have the getters return this ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
? the first one is required because starboard is removed from the application layer. The second is rather bizarre, but NSPathUtilties depends on it. Sure, NSPathUtiltities can do this instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They are both silly. It doesn't make sense that the application compositor sets any sort of file system stuff. Starboard should know how to do this itself. That would be more proper encapsulation ...
In reply to: 99649338 [](ancestors = 99649338)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bbowman any re-write on this should be considered through #1904. what we have is not ideal.