Bridge NS and CFStream as well as make CF components use Ebr function…#1137
Conversation
|
@ms-jihua is added to the review. #Closed |
|
@rajsesh-msft is added to the review. #Closed |
| ret->st_size = 0; | ||
| ret->st_mode = 0x1B6 | 0040000; | ||
| // MurmurHash3_x86_32(assetName, strlen(assetName), 0, &ret->st_ino); | ||
| return 0; |
There was a problem hiding this comment.
No point in keeping commented code #Resolved
There was a problem hiding this comment.
There was a problem hiding this comment.
I have no clue. This was a mostly copied version to support 64i32 versions of things. but sure I'll remove commented out line in both.
In reply to: 83125777 [](ancestors = 83125777,83125758)
|
#1099
|
| #define fstat _NS_fstat | ||
| #define mkdir(a,b) _NS_mkdir(a) | ||
| #define rmdir _NS_rmdir | ||
| #define unlink _NS_unlink |
There was a problem hiding this comment.
It worries me that these are scatted across so many files, but I see that that is a la mode #WontFix
There was a problem hiding this comment.
I agree but I thought putting these in a commonly included header would be a bit much as I don't really want to #def something like open unless I'm pretty sure its only used in a file sense. some other terms there are pretty common words so I felt a little better about it and it is obviously the system CF is already expecting so yes. Worrisome but the best of a bad situation?
In reply to: 83126012 [](ancestors = 83126012)
|
|
||
| char path[CFMaxPathSize]; | ||
| #if DEPLOYMENT_TARGET_WINDOWS | ||
| wchar_t path[CFMaxPathSize]; |
There was a problem hiding this comment.
wchar_t path[CFMaxPathSize]; [](start = 4, length = 28)
Does this change need a WINOBJC comment? #Resolved
There was a problem hiding this comment.
it could but its not a change needed specifically for us as the normal impl of _NS_open calls _wopen. It was just to have better code reuse but will comment anyway.
In reply to: 83126093 [](ancestors = 83126093)
| #import <CFFoundationInternal.h> | ||
|
|
||
| #import <StubReturn.h> | ||
|
|
| #import <CoreFoundation/CFStream.h> | ||
| #import <CFFoundationInternal.h> | ||
|
|
||
| #import <StubReturn.h> |
There was a problem hiding this comment.
StubReturn [](start = 9, length = 10)
as before #Resolved
| } | ||
|
|
||
| /** | ||
| @Status Stub |
There was a problem hiding this comment.
Stub [](start = 9, length = 4)
Not a stub? #Resolved
| return -1; | ||
| } | ||
|
|
||
| char* assetName = fixedName + 1; |
There was a problem hiding this comment.
assetName [](start = 10, length = 9)
Unused. Unused above as well in a similar function. #Resolved
| if (ensureFilesWithContents(fileNames, contents)) | ||
|
|
||
| { | ||
| return fileNames[0]; |
There was a problem hiding this comment.
nit: clang format run amok? #Resolved
|
|
| #define lseek _NS_lseek | ||
| #else | ||
| #define statinfo _stat | ||
| #define stat(x,y) _stat64i32(x,y) |
There was a problem hiding this comment.
should this comment stay there? #ByDesign
There was a problem hiding this comment.
no. Every other file had it as _stat64i32 so that is almost assuredly the right thing.
In reply to: 83308434 [](ancestors = 83308434)
| /** | ||
| @Status Interoperable | ||
| */ | ||
| - (id)initWithData:(id)data { |
There was a problem hiding this comment.
nit: can you fix the signatures here? #Resolved
| /** | ||
| @Status Interoperable | ||
| */ | ||
| - (int)read:(uint8_t*)buf maxLength:(NSUInteger)maxLength { |
There was a problem hiding this comment.
int [](start = 3, length = 3)
nit: NSInteger #Resolved
| /** | ||
| @Status Interoperable | ||
| */ | ||
| - (unsigned)streamStatus { |
There was a problem hiding this comment.
unsigned [](start = 3, length = 8)
nit: NSStreamStatus (in nscfoutputstream also) #Resolved
| /** | ||
| @Status Interoperable | ||
| */ | ||
| + (id)inputStreamWithFileAtPath:(id)file { |
There was a problem hiding this comment.
signatures etc etc. not sure whether you'll fix in the NSCF files but I think they should be correct in the NS files at least. #Resolved
|
|
||
| #include <CoreFoundation/CFStream.h> | ||
|
|
||
| FOUNDATION_EXPORT NSString* const NSStreamSocketSecurityLevelKey = @"NSStreamSocketSecurityLevelKey"; |
There was a problem hiding this comment.
the rest of these ought to have CF equivalents also?
|
|
a7771cb to
0520688
Compare
microsoft#1137) Bridge NS and CFStream as well as make CF components use Ebr functions for interoperabilty. Description: Bridge NS and CFStream as well as make CF components use Ebr functions for interoperabilty. This is a prestep to unify the file handling mechanics through stream and data instead of direct reliance on Ebr functions. Works towards microsoft#1099 extend fopen to look for things in Windows.Storage.AccessCache is what this works towards. The basic steps are: 1. Bridge use of CF/NSStream 2. Consolidate Ebr usage across repo to use Stream 3. Enhance underlying support for storage file. How verified: New UTs and old UTs Reviewed-by: rajseh-msft, ms-jihua
…s for interoperabilty. This is a prestep to unify the file handling mechanics through stream and data instead of direct reliance on Ebr functions.