Improve the documentation and add more examples
heretic13 opened this issue · 4 comments
I do not see the documentation. I do not see examples of use, in particular, examples of "encoding".
Hi!
- To generate API documentation, follow these steps from the README.
- There are two examples in the README (1, 2), where the first one shows the use of
bencoding::encode()
to bencode your data. Simply create your data and then callbencoding::encode(data)
, which will give you a string representation of your bencoded data.
Could you be more specific about what you are missing? A complete example like decoder.cpp, but for encoding?
"To generate". After such words, half the developers will close your page and choose another library. The developer selects the library in several stages. The first stage is to see how easy it is for the API and how complete the examples are. The second stage is the downloading of the library and compilation.
Your 2 examples are very, very simple.
You do not have an example of saving simple data types.
How can I write: a string, an integer, a list and an associative array?
There is no example of data loading and parsing. Something like this:
auto decodedData = bencoding :: decode (stream);
switch (decodedData.type ())
{
case Integer:
int64_t value = decodedData.getInteger ();
break;
case String:
*************
break;
case Map:
// display the contents of map
break;
case List:
// display the contents of the list
break;
}
"To generate". After such words, half the developers will close your page and choose another library.
I agree. I should have made the documentation available online back in 2014 when I wrote the library. I will remedy this.
BTW, I would not blame anyone for choosing another library over this one. When I look at it now, it lacks proper CMake integration into other projects, no versioning/releases, the API could have been much better, etc. Well, we are all learning.
Your 2 examples are very, very simple.
You do not have an example of saving simple data types.
How can I write: a string, an integer, a list and an associative array?
Yes, such examples are indeed missing.
I have made the generated API documentation available here and added a link into the README (607e36c). In 3008c94, I have added more examples into the API documentation.
I am archiving the project as I have no intentions of maintaining it (7eb960f). I suggest using a different library. Thank you for your notes regarding the documentation.