-
Notifications
You must be signed in to change notification settings - Fork 22
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
base: master
Are you sure you want to change the base?
two feature #4
Conversation
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������?); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You lost close bracket
Generator/uProtoBufGenerator.pas
Outdated
@@ -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])); |
There was a problem hiding this comment.
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.
Generator/ufmMain.pas
Outdated
if edtProtoFiles.Font.Color = clRed then | ||
Exit; | ||
|
||
OutPutDir := edtOutputFolder.Text; |
There was a problem hiding this comment.
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.
Generator/ufmMain.pas
Outdated
begin | ||
FileNames := TStringList.Create; | ||
if edtProtoFiles.Font.Color = clRed then |
There was a problem hiding this comment.
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...
…try/finally and initializing tmpBuf to nil; #4
…try/finally and initializing tmpBuf to nil; #4
Add Drap files to generator.exe feature
Add extensions check