c-struct icon indicating copy to clipboard operation
c-struct copied to clipboard

Get accurately defined size of datatype string

Open Stephan1973 opened this issue 10 years ago • 0 comments

Is it possible to get the defined string size from a sructure

Struct definition:

var playerSchema = new _.Schema({
    name: _.type.string(16)
});

Struct use:

var buf = _.packSync('Player', {
    name: 'Foobar'
});

In this case i want get the defined string length of name (16) an not the length of "Foobar".

Thanks for helping Stephan

Stephan1973 avatar Jul 02 '15 11:07 Stephan1973