What steps will reproduce the problem?
1.rapidjson::GenericDocument<rapidjson::UTF16<>> document;
2.
3.
What is the expected output? What do you see instead?
I've expected work with Unicode String buffer but I had compile error instead
Error was at this place
data_.s.str = (char*)allocator.Malloc(length + 1);
function:
void SetStringRaw(const Ch* s, SizeType length, Allocator& allocator) {
RAPIDJSON_ASSERT(s != NULL);
flags_ = kCopyStringFlag;
data_.s.str = (char*)allocator.Malloc(length + 1);
data_.s.length = length;
memcpy((void*)data_.s.str, s, length);
((char*)data_.s.str)[length] = '\0';
}
I changed to
void SetStringRaw(const Ch* s, SizeType length, Allocator& allocator) {
RAPIDJSON_ASSERT(s != NULL);
flags_ = kCopyStringFlag;
data_.s.str = (Ch*)allocator.Malloc(length + 1);
data_.s.length = length;
memcpy((void*)data_.s.str, s, length);
((char*)data_.s.str)[length] = '\0';
}
value data_s.str has the Ch* type
What version of the product are you using? On what operating system?
I use the last version from code.google.com. VS2010Prof sp1 compiler WinXP Sp3
system
Please provide any additional information below.
Original issue reported on code.google.com by vitaly....@gmail.com on 14 Feb 2012 at 7:59
Original issue reported on code.google.com by
vitaly....@gmail.com
on 14 Feb 2012 at 7:59