Agade09 / CG-Send-Binary

Convert your locally compiled binary to a C++ code/text format that you can use on Codingame.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Specifying source code file

andre2007 opened this issue · comments

While using this great tool I want to specify in addition to the executable also the source code file.
The content of the source code file should be added as comment to the resulting cpp file and serves the purpose of documentation:

  • which language was used
  • which source code is used

For my use case (D Programming Language) it is sufficient to specify only 1 source code file. Maybe for other languages you want specify multiple source code files .

@Agade09 D source code has similar to C++ // and /* comments. In addition also /+ comments which can be nested.
Maybe safest way to include source code as comment might be to start every line with // in cpp file.

I like this idea. I will try to make a branch which gives this option and merge with master when satisfactory.

Can you try the Add_Source branch, see if it does the job?

Thanks it is working fine.

  • could you also add the filename (only the filename without any parent folder) of the source code file to the comment? This makes it easier to identify the used language
  • by adding 2 spaced after the // the source code might be easier to read

Changed commenting from // at every line to a #if 0 #endif preprocessor macro. Should give the best readability. Will take care of your other request.

The program will now comment on the name of the source code file. I also modified the example bash script to write in which compiler was used to produce the binary.

@Agade09 Thanks a lot! I think the issue can be closed.