Runtime: Add TransformationStatus enum from corefxlab

Created on 18 Jul 2017  路  11Comments  路  Source: dotnet/runtime

Based on corefxlab work, will be used by a variety of new corefx Span-based APIs. We need to re-review to make sure it's exactly what we want to bake in to the core of the framework
C# namespace System.Buffers // System? { public enum TransformationStatus // TransformStatus? TransformResult? { Done, // Success? Complete? Ok? DestinationTooSmall, NeedMoreSourceData, // SourceTooSmall? InvalidData } }
cc: @terrajobst, @bartonjs, @KrzysztofCwalina, @ahsonkhan

area-System.Runtime blocked

Most helpful comment

Regarding naming, I'd prefer the following:

  • "TransformResult", or something with "Result" in the name
  • "Success", rather than "Done"
  • "SourceTooSmall" -- symmetry with "DestinationTooSmall"

All 11 comments

Regarding naming, I'd prefer the following:

  • "TransformResult", or something with "Result" in the name
  • "Success", rather than "Done"
  • "SourceTooSmall" -- symmetry with "DestinationTooSmall"

I'd prefer the following

In case it wasn't obvious from my comments I added to the type, me too ;)

I have used this enums in some contexts that were not transformations, e.g. in a routine that copies data from one buffer to another. Because of that, the currently proposed name is BufferOperationStatus, or even OperationStatus.

cc: @shiftylogic

the currently proposed name is BufferOperationStatus, or even OperationStatus.

Given the naming feedback:

"TransformResult", or something with "Result" in the name

Should the enum be named BufferOperationResult or OperationResult instead?

I named it Status because I thought it implies current state of an ongoing operation (multiple calls to the method). Result to me implies more the final state.
But it might be splitting hair, and so I would be ok with either postfix

@KrzysztofCwalina I believe we are blocked on some of your TextEncoding APIs to show motivation for this one ...

Video

This is now tracked as part of other work item.

For reference, here is the enum now:
https://github.com/dotnet/corefx/blob/master/src/System.Memory/src/System/Buffers/OperationStatus.cs#L11

C# namespace System.Buffers { public enum OperationStatus { Done, DestinationTooSmall, NeedMoreData, InvalidData, } }

Are we happy with the field names as is?

Where is the main API approval issue? I can't find it ...

@ahsonkhan @KrzysztofCwalina what is the main API issue tracking the proposal now?

FYI: The API review discussion was recorded - see https://youtu.be/bHwCPVNQLwo?t=99 (4 min duration)

Was this page helpful?
0 / 5 - 0 ratings