-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Labels
completedWork has completed (may not have been pushed to GitHub yet)Work has completed (may not have been pushed to GitHub yet)enhancementNew feature or requestNew feature or request
Milestone
Description
Although the Data parameter of the various TPJEnvironmentVars enumerator methods is useful on occasion, a lot of the time it isn't required.
So how about a couple more enumerator overloads without the Data parameter? E.g.:
TPJEnvironmentVars = class(TObject)
// ...
public
// ...
type
TEnumNamesCallback = reference to procedure (const VarName: string);
TEnumVarsCallback = reference to procedure(const EnvVar: TPJEnvironmentVar);
//..
class procedure EnumNames(Callback: TEnumNamesCallback); overload;
class procedure EnumVars(Callback: TEnumVarsCallback); overload;
// ...
end;
// ...
class procedure TPJEnvironmentVars.EnumNames(Callback: TEnumNamesCallback)
begin
Assert(Assigned(Callback));
EnumNames<Integer>(
procedure (const VarName: string; Data: Integer)
begin
Callback(VarName);
end,
0 // Dummy value
);
end;
class procedure TPJEnvironmentVars.EnumVars(Callback: TEnumVarsCallback)
begin
Assert(Assigned(Callback));
EnumVars<Integer>(
procedure (const EnvVar: TPJEnvironmentVar; Data: Integer)
begin
Callback(EnvVar);
end,
0 // Dummy value
);
end;Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
completedWork has completed (may not have been pushed to GitHub yet)Work has completed (may not have been pushed to GitHub yet)enhancementNew feature or requestNew feature or request