MCPcopy Create free account
hub / github.com/PlayFab/gsdk / Value

Method Value

cpp/cppsdk/jsoncpp.cpp:2821–2848  ·  view source on GitHub ↗

! \internal Default constructor initialization must be equivalent to: * memset( this, 0, sizeof(Value) ) * This optimization is used in ValueInternalMap fast allocator. */

Source from the content-addressed store, hash-verified

2819 * This optimization is used in ValueInternalMap fast allocator.
2820 */
2821Value::Value(ValueType type) {
2822 static char const emptyString[] = "";
2823 initBasic(type);
2824 switch (type) {
2825 case nullValue:
2826 break;
2827 case intValue:
2828 case uintValue:
2829 value_.int_ = 0;
2830 break;
2831 case realValue:
2832 value_.real_ = 0.0;
2833 break;
2834 case stringValue:
2835 // allocated_ == false, so this is safe.
2836 value_.string_ = const_cast<char*>(static_cast<char const*>(emptyString));
2837 break;
2838 case arrayValue:
2839 case objectValue:
2840 value_.map_ = new ObjectValues();
2841 break;
2842 case booleanValue:
2843 value_.bool_ = false;
2844 break;
2845 default:
2846 JSON_ASSERT_UNREACHABLE;
2847 }
2848}
2849
2850Value::Value(Int value) {
2851 initBasic(intValue);

Callers 2

DeserializeObjectMethod · 0.80

Calls 4

swapFunction · 0.85
dataMethod · 0.80
lengthMethod · 0.80

Tested by

no test coverage detected