string_bytes: add StringBytes::IsValidString()
authorBen Noordhuis <info@bnoordhuis.nl>
Tue, 30 Jul 2013 12:26:11 +0000 (14:26 +0200)
committerBen Noordhuis <info@bnoordhuis.nl>
Tue, 30 Jul 2013 12:32:47 +0000 (14:32 +0200)
commitdce26ccea16455179ca538f32d2779cfbf20c51b
treee94e848a9bd89ea7c2f6e45d8d230edba01abdbf
parent4881a6a9a3b4e466f852ab9b3a084f7c4a55d8b5
string_bytes: add StringBytes::IsValidString()

Performs a quick, non-exhaustive check on the input string to see if
it's compatible with the specified string encoding.

Curently it only checks that hex strings have a length that is a
multiple of two.
src/string_bytes.cc
src/string_bytes.h