Giter Club home page Giter Club logo

Comments (4)

s3rvac avatar s3rvac commented on June 10, 2024

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 call bencoding::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?

from cpp-bencoding.

heretic13 avatar heretic13 commented on June 10, 2024

"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;
}

from cpp-bencoding.

s3rvac avatar s3rvac commented on June 10, 2024

"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.

from cpp-bencoding.

s3rvac avatar s3rvac commented on June 10, 2024

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.

from cpp-bencoding.

Related Issues (2)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.