M
M
More9162017-03-10 18:00:40
C++ / C#
More916, 2017-03-10 18:00:40

How to organize the structure of the project file of your own program?

I have developed a program that generates binary type files for a specific purpose. Before generating a file, a lot of parameters are entered in the program. Entering these parameters every time anew is not advisable. In this connection, it became necessary to save the "project file". And it became interesting to me, what is the best way to store these parameters in a file, so that after them it would be easier and faster to read and process them?
For one reason or another, I repeatedly had to manually edit the "project files" of various programs, and the method of "storing" the parameters was completely different for everyone. For example, in some programs, the project file was binary (all parameters were marked in strict sequence and with specified field sizes), and in some the file was a set of lines (each line was a parameter that began with the name of the parameter surrounded by quotes and after which (separated by a dash or colon) followed by the value of this parameter).
So what should I be guided by when developing the structure and methodology for storing the "project file"?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Axian Ltd., 2017-03-10
@More916

Typical choices are
Name = Value for flat
Json data or xml for structured data

C
CityCat4, 2017-03-10
@CityCat4

Perhaps the only criterion is whether this file will be read only by the program, or will people also read it? If only by the program - the binary is more convenient. I painted the structure, put it on the record - voila, sorted into the fields! But it will be quite difficult for a person to read it if people also read the file, it is better to spend money on a more or less full-fledged name=value type parser, if edited manually, it will be much easier.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question