MCPcopy Create free account
hub / github.com/Vector35/binaryninja-api / GenericValue

Method GenericValue

rapidjson/document.h:2449–2473  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2447template <typename Encoding, typename Allocator>
2448template <typename SourceAllocator>
2449inline
2450GenericValue<Encoding,Allocator>::GenericValue(const GenericValue<Encoding,SourceAllocator>& rhs, Allocator& allocator)
2451{
2452 switch (rhs.GetType()) {
2453 case kObjectType:
2454 case kArrayType: { // perform deep copy via SAX Handler
2455 GenericDocument<Encoding,Allocator> d(&allocator);
2456 rhs.Accept(d);
2457 RawAssign(*d.stack_.template Pop<GenericValue>(1));
2458 }
2459 break;
2460 case kStringType:
2461 if (rhs.data_.f.flags == kConstStringFlag) {
2462 data_.f.flags = rhs.data_.f.flags;
2463 data_ = *reinterpret_cast<const Data*>(&rhs.data_);
2464 } else {
2465 SetStringRaw(StringRef(rhs.GetString(), rhs.GetStringLength()), allocator);
2466 }
2467 break;
2468 default:
2469 data_.f.flags = rhs.data_.f.flags;
2470 data_ = *reinterpret_cast<const Data*>(&rhs.data_);
2471 break;
2472 }
2473}
2474
2475//! Helper class for accessing Value of array type.
2476/*!

Callers

nothing calls this directly

Calls 5

RawAssignFunction · 0.85
SetStringRawFunction · 0.85
StringRefFunction · 0.70
GetTypeMethod · 0.45
GetStringMethod · 0.45

Tested by

no test coverage detected