Permalink
Browse files

binaryParser: added function to parse text fields

  • Loading branch information...
1 parent acdd726 commit ba9b85fe261f97c6fac80b302bd13b92112e248c @AlexanderS AlexanderS committed Jun 6, 2011
Showing with 15 additions and 0 deletions.
  1. +8 −0 lib/binaryParser.js
  2. +3 −0 lib/query.js
  3. +4 −0 lib/textParser.js
View
@@ -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
@@ -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
@@ -80,4 +80,8 @@ p.parseStringArray = function(value) {
});
};
+p.parseText = function(value) {
+ return value;
+};
+
module.exports = TextParser;

0 comments on commit ba9b85f

Please sign in to comment.