summaryrefslogtreecommitdiff
path: root/src/string_bytes.cc
diff options
context:
space:
mode:
authorBen Noordhuis <info@bnoordhuis.nl>2013-07-30 15:19:48 +0200
committerBen Noordhuis <info@bnoordhuis.nl>2013-07-30 15:19:48 +0200
commitb8c04b921b626edd4201f805d0feb384c8e91ea7 (patch)
tree3266e137f154fccf8b8f33ff4904f8aa0e8e8e25 /src/string_bytes.cc
parentdc9acd4faeba1aade414bdd8da28f30b16773575 (diff)
parent6327d67be3a939b1ce6ac8541504b1f6fc338fd9 (diff)
downloadandroid-node-v8-b8c04b921b626edd4201f805d0feb384c8e91ea7.tar.gz
android-node-v8-b8c04b921b626edd4201f805d0feb384c8e91ea7.tar.bz2
android-node-v8-b8c04b921b626edd4201f805d0feb384c8e91ea7.zip
Merge remote-tracking branch 'origin/v0.10'
Conflicts: AUTHORS ChangeLog deps/uv/ChangeLog deps/uv/src/version.c deps/uv/src/win/fs.c src/node.cc src/node_crypto.cc src/node_os.cc src/node_version.h
Diffstat (limited to 'src/string_bytes.cc')
-rw-r--r--src/string_bytes.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/string_bytes.cc b/src/string_bytes.cc
index d389959fe7..64a2937764 100644
--- a/src/string_bytes.cc
+++ b/src/string_bytes.cc
@@ -338,6 +338,13 @@ size_t StringBytes::Write(char* buf,
}
+bool StringBytes::IsValidString(Handle<String> string, enum encoding enc) {
+ if (enc == HEX && string->Length() % 2 != 0) return false;
+ // TODO(bnoordhuis) Add BASE64 check?
+ return true;
+}
+
+
// Quick and dirty size calculation
// Will always be at least big enough, but may have some extra
// UTF8 can be as much as 3x the size, Base64 can have 1-2 extra bytes