Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

two feature #4

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

two feature #4

wants to merge 4 commits into from

Conversation

jinnblue
Copy link

@jinnblue jinnblue commented Sep 8, 2017

Add Drap files to generator.exe feature
Add extensions check

2.Fix AddFromBuf bug for Generate .pas;
[+] 1.Add Drap files to generator.exe feature;
    2.Add extensions check.
@@ -85,7 +85,7 @@ procedure TestTTestMsg1.TestSaveLoadFromBuf;
FTestMsg1.DefField9 := 5.5;
FTestMsg1.FieldArr1List.Add(-5);
FTestMsg1.FieldArr2List.Add(234);
FTestMsg1.FieldArr3List.Add('asdf�������');
FTestMsg1.FieldArr3List.Add('asdf������?);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You lost close bracket

@@ -412,7 +412,7 @@ procedure TProtoBufGenerator.GenerateImplementationSection(Proto: TProtoFile; SL
SL.Add(Format(' F%s.Add(T%s(ProtoBuf.readEnum));', [DelphiProp.PropertyName, Prop.PropType]));
end
else
SL.Add(Format(' F%s.AddFromBuf(ProtoBuf, fieldNumber);', [DelphiProp.PropertyName]));
SL.Add(Format(' F%s.AddFromBuf(ProtoBuf, makeTag(FieldNumber, WireType));', [DelphiProp.PropertyName]));
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. The original method AddFromBuf uses FieldNumber, not WireTag. Possibly, you change this method so this is useful for you, but not for original repo.

if edtProtoFiles.Font.Color = clRed then
Exit;

OutPutDir := edtOutputFolder.Text;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ask you in your prev. pull request - what happens when user types file name directly in edtProtoFiles? In this case "Generate" button does nothing, because FFileCount = 0.
I see 2 ways to solve it: set edtProtoFiles.ReadOnly to True or remove FFiles array and parse edtProtoFiles.Text directly.

begin
FileNames := TStringList.Create;
if edtProtoFiles.Font.Color = clRed then
Copy link
Owner

@kami-soft kami-soft Sep 9, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I add some files (by Drag&Drop or by OpenDialog) and get red color in edtProtoFiles.
I see wrong file and I remove it by Delete button on keyboard. But I still can`t use Generate button because of red font...

kami-soft pushed a commit that referenced this pull request Dec 18, 2018
kami-soft pushed a commit that referenced this pull request Dec 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants