On Tue, 22 Mar 2016, Denis Kozlov wrote:

On 22/03/2016 17:56, Michael Van Canneyt wrote:
or better something concise like ltAuto,ltUser,ltNone.

It may make more sense to call it ListSortType (as opposed to ListType):
 TListSortType = (lstNone, lstAuto, lstManual);

I went for TStringsSortStyle


Something like this could work (prototype code):


=======================================================
function TStringList.GetSorted: Boolean;
begin
 Result := (FSortType = lstAuto);
end;

This should be
  Result in [lstAuto, lstManual];
I am in agreement with David Jenkins that Sorted should reflect the actual state; no matter how this state was reached.

begin
 if FSortType <> lstNonethen
   Result := FindSorted(S, Index);
 else
 begin
   Index := IndexOf(S);

I raise an exception here. Find is for sorted lists.

I have an implementation ready, as soon as all tests are done I will commit it.

Michael.
_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply via email to