GithubHelp home page GithubHelp logo

How to read a string about jbinary HOT 8 CLOSED

Crauzer avatar Crauzer commented on September 3, 2024
How to read a string

from jbinary.

Comments (8)

RReverser avatar RReverser commented on September 3, 2024

Did you check the API docs linked in README? https://github.com/jDataView/jBinary/wiki

from jbinary.

RReverser avatar RReverser commented on September 3, 2024

I'll close this as this is documented under Strings in the docs.

from jbinary.

Crauzer avatar Crauzer commented on September 3, 2024

I read every single page of the docs in the wiki and I honestly still have no idea how your library works.

After hours of debugging and looking at the source I still cannot figure out how to read a string, or rather how to provide a length parameter to the read function as shown above.

The read function only accepts a type name and an offset, no mention of params for the provided type.

from jbinary.

Crauzer avatar Crauzer commented on September 3, 2024

I'm also using TypeScript by the way, so your type definitions might be incorrect ? Since there is aboslutely no way to specify params in the read function for a given type

from jbinary.

RReverser avatar RReverser commented on September 3, 2024

I read every single page of the docs in the wiki and I honestly still have no idea how your library works.

https://github.com/jDataView/jBinary/wiki/Type-usage-syntax describes how to pass type params in general (['typeName', arg1, arg2, ..., argN]).
https://github.com/jDataView/jBinary/wiki/Standard-types#strings documents string type arguments to be passed using syntax above.
https://github.com/jDataView/jBinary/wiki/Typesets even has a detailed example, showing usage of strings among others.

from jbinary.

Crauzer avatar Crauzer commented on September 3, 2024

I'm sorry but your docs honestly make no sense and don't match your type definitions, if you look at the first comment I made it shows the method signature in TypeScript for the read method.

It only accepts 2 arguments, type and offset, type can either be a string or a [string, string, number?] which does definitely not match anything in your docs. So I'm lost as to how I'm supposed to pass parameters into this function in a sane way.

from jbinary.

Crauzer avatar Crauzer commented on September 3, 2024

It just seems like the function signature is missing a params: any[] argument

from jbinary.

RReverser avatar RReverser commented on September 3, 2024

I don't know where TS definitions you're seeing are coming from, and correspondingly can't comment on why they don't match the docs - the library itself doesn't have TS definitions.

But I've provided plenty of links above with examples, including specific example for strings:

jDataView/jBinary/wiki/Typesets even has a detailed example, showing usage of strings among others.

That page literally shows ['string0', 256] as an example of passing length.

from jbinary.

Related Issues (20)

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.