1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-20 17:08:00 +02:00

Removed 'internal' protection - it's all about [Friend] now

This commit is contained in:
Brian Fiete 2020-03-09 06:34:16 -07:00
parent 81af04a1ce
commit 14ac27c977
119 changed files with 1339 additions and 1388 deletions

View file

@ -273,13 +273,13 @@ namespace System.IO
}
}
internal struct COMDLG_FILTERSPEC
struct COMDLG_FILTERSPEC
{
internal char16* pszName;
internal char16* pszSpec;
public char16* pszName;
public char16* pszSpec;
}
internal enum FDAP : uint32
enum FDAP : uint32
{
FDAP_BOTTOM = 0x00000000,
FDAP_TOP = 0x00000001,

View file

@ -85,7 +85,7 @@ namespace System.IO
abstract class FileDialog : CommonDialog
{
internal abstract Result<DialogResult> RunFileDialog(ref Windows.OpenFileName ofn);
protected abstract Result<DialogResult> RunFileDialog(ref Windows.OpenFileName ofn);
protected override Result<DialogResult> RunDialog(Windows.HWnd hWndOwner)
{
@ -93,9 +93,9 @@ namespace System.IO
}
private const int32 FILEBUFSIZE = 8192;
internal const int32 OPTION_ADDEXTENSION = (int32)0x80000000;
protected const int32 OPTION_ADDEXTENSION = (int32)0x80000000;
internal int32 mOptions;
protected int32 mOptions;
private String mTitle ~ delete _;
private String mInitialDir ~ delete _;
private String mDefaultExt ~ delete _;
@ -323,12 +323,12 @@ namespace System.IO
return .Ok;
}
internal bool GetOption(int32 option)
protected bool GetOption(int32 option)
{
return (mOptions & option) != 0;
}
internal void SetOption(int32 option, bool value)
protected void SetOption(int32 option, bool value)
{
if (value)
{
@ -496,7 +496,7 @@ namespace System.IO
}
}
internal override Result<DialogResult> RunFileDialog(ref Windows.OpenFileName ofn)
protected override Result<DialogResult> RunFileDialog(ref Windows.OpenFileName ofn)
{
bool result = Windows.GetOpenFileNameW(ref ofn);
if (!result)

View file

@ -38,7 +38,7 @@ namespace System.IO
// Make this public sometime.
// The max total path is 260, and the max individual component length is 255.
// For example, D:\<256 char8 file name> isn't legal, even though it's under 260 char8s.
internal const int32 MaxPath = 260;
protected const int32 MaxPath = 260;
private const int32 MaxDirectoryLength = 255;
public static void GetFullPath(String inPartialPath, String outFullPath)
@ -49,7 +49,7 @@ namespace System.IO
});
}
internal static void CheckInvalidPathChars(StringView path, bool checkAdditional = false)
protected static void CheckInvalidPathChars(StringView path, bool checkAdditional = false)
{
}
@ -74,30 +74,30 @@ namespace System.IO
outFileName.Append(inPath);
}
internal static String NormalizePath(String path, bool fullCheck)
static String NormalizePath(String path, bool fullCheck)
{
return NormalizePath(path, fullCheck, MaxPath);
}
internal static String NormalizePath(String path, bool fullCheck, bool expandShortPaths)
static String NormalizePath(String path, bool fullCheck, bool expandShortPaths)
{
return NormalizePath(path, fullCheck, MaxPath, expandShortPaths);
}
internal static String NormalizePath(String path, bool fullCheck, int32 maxPathLength)
static String NormalizePath(String path, bool fullCheck, int32 maxPathLength)
{
return NormalizePath(path, fullCheck, maxPathLength, true);
}
internal static String NormalizePath(String path, bool fullCheck, int32 maxPathLength, bool expandShortPaths)
static String NormalizePath(String path, bool fullCheck, int32 maxPathLength, bool expandShortPaths)
{
//TODO: Implement
return path;
}
internal static String RemoveLongPathPrefix(String path)
static String RemoveLongPathPrefix(String path)
{
//TODO: Implement
return path;
@ -171,7 +171,7 @@ namespace System.IO
// Gets the length of the root DirectoryInfo or whatever DirectoryInfo markers
// are specified for the first part of the DirectoryInfo name.
//
internal static int GetRootLength(String path)
static int GetRootLength(String path)
{
CheckInvalidPathChars(path);
@ -205,7 +205,7 @@ namespace System.IO
#endif //BF_PLATFORM_WINDOWS
}
internal static bool IsDirectorySeparator(char8 c)
static bool IsDirectorySeparator(char8 c)
{
return (c==DirectorySeparatorChar || c == AltDirectorySeparatorChar);
}

View file

@ -34,7 +34,7 @@ namespace System.IO
}
}
internal override Result<DialogResult> RunFileDialog(ref Windows.OpenFileName ofn)
protected override Result<DialogResult> RunFileDialog(ref Windows.OpenFileName ofn)
{
bool result = Windows.GetSaveFileNameW(ref ofn);
if (!result)

View file

@ -3,8 +3,8 @@ namespace System.IO
[CRepr]
struct SecurityAttributes
{
internal int32 mLength = (int32)sizeof(SecurityAttributes);
internal uint8* mSecurityDescriptor = null;
internal int32 mInheritHandle = 0;
int32 mLength = (int32)sizeof(SecurityAttributes);
uint8* mSecurityDescriptor = null;
int32 mInheritHandle = 0;
}
}

View file

@ -179,15 +179,15 @@ namespace System.IO
// with a single allocation.
private sealed class ReadWriteTask : Task<int>, ITaskCompletionAction
{
internal readonly bool _isRead;
internal Stream _stream;
internal uint8 [] _buffer;
internal int _offset;
internal int _count;
readonly bool _isRead;
Stream _stream;
uint8 [] _buffer;
int _offset;
int _count;
private AsyncCallback _callback;
//private ExecutionContext _context;
internal void ClearBeginState() // Used to allow the args to Read/Write to be made available for GC
void ClearBeginState() // Used to allow the args to Read/Write to be made available for GC
{
_stream = null;
_buffer = null;
@ -243,7 +243,7 @@ namespace System.IO
}
}
internal IAsyncResult BeginReadInternal(uint8[] buffer, int offset, int count, AsyncCallback callback, Object state, bool serializeAsynchronously)
IAsyncResult BeginReadInternal(uint8[] buffer, int offset, int count, AsyncCallback callback, Object state, bool serializeAsynchronously)
{
// To avoid a race with a stream's position pointer & generating ----
// conditions with internal buffer indexes in our own streams that
@ -270,12 +270,12 @@ namespace System.IO
// The ReadWriteTask stores all of the parameters to pass to Read.
// As we're currently inside of it, we can get the current task
// and grab the parameters from it.
var thisTask = Task.InternalCurrent as ReadWriteTask;
var thisTask = Task.[Friend]InternalCurrent as ReadWriteTask;
Contract.Assert(thisTask != null, "Inside ReadWriteTask, InternalCurrent should be the ReadWriteTask");
// Do the Read and return the number of bytes read
int bytesRead = thisTask._stream.TryRead(.(thisTask._buffer, thisTask._offset, thisTask._count));
thisTask.ClearBeginState(); // just to help alleviate some memory pressure
int bytesRead = thisTask.[Friend]_stream.TryRead(.(thisTask.[Friend]_buffer, thisTask.[Friend]_offset, thisTask.[Friend]_count));
thisTask.[Friend]ClearBeginState(); // just to help alleviate some memory pressure
return bytesRead;
}, state, this, buffer, offset, count, callback);
@ -308,7 +308,7 @@ namespace System.IO
{
Runtime.FatalError();
}
else if (!readTask._isRead)
else if (!readTask.[Friend]_isRead)
{
Runtime.FatalError();
}

View file

@ -208,7 +208,7 @@ namespace System.IO
StreamReader mStreamReader;
WaitEvent mDoneEvent = new WaitEvent() ~ delete _;
internal this(StreamReader streamReader)
public this(StreamReader streamReader)
{
Debug.WriteLine("ReadLineTask this {0}", this);
@ -216,7 +216,7 @@ namespace System.IO
ThreadPool.QueueUserWorkItem(new => Proc);
}
internal ~this()
public ~this()
{
//Debug.WriteLine("ReadLineTask ~this waiting {0}", this);
mDoneEvent.WaitFor();
@ -384,7 +384,7 @@ namespace System.IO
}
}
internal virtual Result<int> ReadBuffer()
protected virtual Result<int> ReadBuffer()
{
mCharLen = 0;
mCharPos = 0;
@ -578,7 +578,7 @@ namespace System.IO
String mCurrentLine;
Result<void> mLastReadResult;
internal this(StreamReader streamReader)
public this(StreamReader streamReader)
{
mStreamReader = streamReader;
mCurrentLine = new String();