-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Labels
pri: LowLowest Priority for issues that are confirmed bugsLowest Priority for issues that are confirmed bugsseg: ClientIssues that happen on the Client side of the packageIssues that happen on the Client side of the packageseg: ServerIssues that happen on the Server side of the packageIssues that happen on the Server side of the packagevcs: OptimizationWhen the issue enhances existing features without changing their functionalityWhen the issue enhances existing features without changing their functionality
Milestone
Description
RALParam:
- SaveToFile
- 3 funções que podem ser juntadas, reduzindo para 1 função
código
procedure TRALParam.SaveToFile(const AFileName: StringRAL);
begin
SaveStream(FContent, AFileName);
end;
procedure TRALParam.SaveToFile;
begin
SaveToFile('', '');
end;
procedure TRALParam.SaveToFile(AFolderName, AFileName: StringRAL);
var
vMime: TRALMIMEType;
vExt: StringRAL;
begin
if AFolderName = '' then
AFolderName := ExtractFileDir(ParamStr(0));
AFolderName := IncludeTrailingPathDelimiter(AFolderName);
if AFileName = '' then
begin
if FFileName = '' then
begin
vMime := TRALMIMEType.Create;
try
vExt := vMime.GetMIMEContentExt(FContentType);
finally
FreeAndNil(vMime);
end;
AFileName := FParamName + vExt;
end
else
begin
AFileName := FFileName;
end;
end;
SaveToFile(AFolderName + AFileName);
end;- Manteria somente a última função e trocaria a última linha para
SaveStream(FContent, AFileName); - Adicionaria valores padrão pros 2 params como string vazia ('') para manter compatibilidade com o
SaveToFile;
RALParams
- AssignParamsText e AssignParamsListText
- Poderia juntar somente na AssignParamsText que possui valores padrão para separador, já que a ListText força CRLF (
#13#10) como separador de linha
- Poderia juntar somente na AssignParamsText que possui valores padrão para separador, já que a ListText força CRLF (
código
como a AssignParamsListText chama a AssignParamsText, só eliminar a primeira e manter a segunda trocando o 3o parâmetro pra HTTPLineBreak
function TRALParams.AssignParamsListText(AKind: TRALParamKind;
const ANameSeparator: StringRAL): StringRAL;
begin
Result := AssignParamsText(AKind, ANameSeparator, HTTPLineBreak);
end;- AssignParamsUrl
- Não deveria aceitar AKind como parâmetro visto que vai fazer o parse de URL, então o Kind seria somente "query", daí ao chamar a função setar como padrão passar
pkQuery
- Não deveria aceitar AKind como parâmetro visto que vai fazer o parse de URL, então o Kind seria somente "query", daí ao chamar a função setar como padrão passar
código
function TRALParams.AssignParamsUrl(AKind: TRALParamKind): StringRAL;
begin
Result := AssignParamsText(AKind); //aqui vira pkQUERY
end;Metadata
Metadata
Assignees
Labels
pri: LowLowest Priority for issues that are confirmed bugsLowest Priority for issues that are confirmed bugsseg: ClientIssues that happen on the Client side of the packageIssues that happen on the Client side of the packageseg: ServerIssues that happen on the Server side of the packageIssues that happen on the Server side of the packagevcs: OptimizationWhen the issue enhances existing features without changing their functionalityWhen the issue enhances existing features without changing their functionality