mirror of
https://git.mirrors.martin98.com/https://github.com/syoyo/tinygltf.git
synced 2025-08-15 15:35:53 +08:00
Fix #411 by adding a Value(const char *) constructor.
Avoid implicit conversion of pointers to bool. Closes #411.
This commit is contained in:
parent
d71c6f61f3
commit
49caa65177
@ -301,6 +301,9 @@ class Value {
|
|||||||
}
|
}
|
||||||
explicit Value(std::string &&s)
|
explicit Value(std::string &&s)
|
||||||
: type_(STRING_TYPE), string_value_(std::move(s)) {}
|
: type_(STRING_TYPE), string_value_(std::move(s)) {}
|
||||||
|
explicit Value(const char *s) : type_(STRING_TYPE) {
|
||||||
|
string_value_ = s;
|
||||||
|
}
|
||||||
explicit Value(const unsigned char *p, size_t n) : type_(BINARY_TYPE) {
|
explicit Value(const unsigned char *p, size_t n) : type_(BINARY_TYPE) {
|
||||||
binary_value_.resize(n);
|
binary_value_.resize(n);
|
||||||
memcpy(binary_value_.data(), p, n);
|
memcpy(binary_value_.data(), p, n);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user