binaryParser: added function to parse text fields

This commit is contained in:
Alexander Sulfrian 2011-06-06 19:31:57 +02:00
parent acdd726a29
commit ba9b85fe26
3 changed files with 15 additions and 0 deletions

View File

@ -226,4 +226,12 @@ p.parseIntArray = p.parseStringArray = function(value) {
return parse(dims, elementType);
};
p.parseText = function(value) {
var convertToChar = function(chr) {
return String.fromCharCode(chr);
};
return value.map(convertToChar).join('');
};
module.exports = BinaryParser;

View File

@ -62,6 +62,9 @@ p.handleRowDescription = function(msg) {
case 23:
this._fieldConverters[i] = parsers[format].parseInt32;
break;
case 25:
this._fieldConverters[i] = parsers[format].parseText;
break;
case 26:
this._fieldConverters[i] = parsers[format].parseInt64;
break;

View File

@ -80,4 +80,8 @@ p.parseStringArray = function(value) {
});
};
p.parseText = function(value) {
return value;
};
module.exports = TextParser;