这篇教程C++ valueAllocator函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中valueAllocator函数的典型用法代码示例。如果您正苦于以下问题:C++ valueAllocator函数的具体用法?C++ valueAllocator怎么用?C++ valueAllocator使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了valueAllocator函数的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: valueAllocator void Value::CommentInfo::setComment(const char *text) { if (comment_) valueAllocator()->releaseStringValue(comment_); JSON_ASSERT(text); JSON_ASSERT_MESSAGE(text[0] == '/0' || text[0] == '/', "Comments must start with /"); // It seems that /**/ style comments are acceptable as well. comment_ = valueAllocator()->duplicateStringValue(text); }
开发者ID:hroskes,项目名称:cmssw,代码行数:8,
示例2: type_Value::Value ( const Value& other ) : type_ ( other.type_ ){ switch ( type_ ) { case nullValue: case intValue: case uintValue: case realValue: case booleanValue: value_ = other.value_; break; case stringValue: if ( other.value_.string_ ) { value_.string_ = valueAllocator ()->duplicateStringValue ( other.value_.string_ ); allocated_ = true; } else value_.string_ = 0; break; case arrayValue: case objectValue: value_.map_ = new ObjectValues ( *other.value_.map_ ); break; default: JSON_ASSERT_UNREACHABLE; }}
开发者ID:CFQuantum,项目名称:CFQuantumd,代码行数:33,
示例3: switch Value::~Value() { switch (type_) { case nullValue: case intValue: case uintValue: case realValue: case booleanValue: break; case stringValue: if (allocated_) valueAllocator()->releaseStringValue(value_.string_); break;#ifndef JSON_VALUE_USE_INTERNAL_MAP case arrayValue: case objectValue: delete value_.map_; break;#else case arrayValue: arrayAllocator()->destructArray(value_.array_); break; case objectValue: mapAllocator()->destructMap(value_.map_); break;#endif default: JSON_ASSERT_UNREACHABLE; } if (comments_) delete[] comments_; }
开发者ID:hroskes,项目名称:cmssw,代码行数:32,
示例4: switchValue::~Value (){ switch ( type_ ) { case nullValue: case intValue: case uintValue: case realValue: case booleanValue: break; case stringValue: if ( allocated_ ) valueAllocator ()->releaseStringValue ( value_.string_ ); break; case arrayValue: case objectValue: delete value_.map_; break; default: JSON_ASSERT_UNREACHABLE; }}
开发者ID:CFQuantum,项目名称:CFQuantumd,代码行数:26,
示例5: cstr_Value::CZString::CZString( const CZString &other ): cstr_( other.index_ != noDuplication && other.cstr_ != 0 ? valueAllocator()->makeMemberName( other.cstr_ ) : other.cstr_ ) , index_( other.cstr_ ? (other.index_ == noDuplication ? noDuplication : duplicate) : other.index_ ){}
开发者ID:FreyaTsao,项目名称:windows_leanplum_sdk,代码行数:8,
示例6: type_Value::Value( const CppTL::ConstString &value ) : type_( stringValue ) , allocated_( true ) , comments_( 0 )# ifdef JSON_VALUE_USE_INTERNAL_MAP , itemIsUsed_( 0 )#endif{ value_.string_ = valueAllocator()->duplicateStringValue( value, value.length() );}
开发者ID:FreyaTsao,项目名称:windows_leanplum_sdk,代码行数:10,
示例7: type_ Value::Value(const std::string &value) : type_(stringValue), allocated_(true), comments_(nullptr)#ifdef JSON_VALUE_USE_INTERNAL_MAP , itemIsUsed_(0)#endif { value_.string_ = valueAllocator()->duplicateStringValue(value.c_str(), (unsigned int)value.length()); }
开发者ID:hroskes,项目名称:cmssw,代码行数:11,
示例8: type_Value::Value( const Value &other ) : type_( other.type_ ) , comments_( 0 )# ifdef JSON_VALUE_USE_INTERNAL_MAP , itemIsUsed_( 0 )#endif{ switch ( type_ ) { case nullValue: case intValue: case uintValue: case realValue: case int64Value: case uint64Value: case booleanValue: value_ = other.value_; break; case stringValue: if ( other.value_.string_ ) { value_.string_ = valueAllocator()->duplicateStringValue( other.value_.string_ ); allocated_ = true; } else value_.string_ = 0; break;#ifndef JSON_VALUE_USE_INTERNAL_MAP case arrayValue: case objectValue: value_.map_ = new ObjectValues( *other.value_.map_ ); break;#else case arrayValue: value_.array_ = arrayAllocator()->newArrayCopy( *other.value_.array_ ); break; case objectValue: value_.map_ = mapAllocator()->newMapCopy( *other.value_.map_ ); break;#endif default: JSON_ASSERT_UNREACHABLE; } if ( other.comments_ ) { comments_ = new CommentInfo[numberOfCommentPlacement]; for ( int comment =0; comment < numberOfCommentPlacement; ++comment ) { const CommentInfo &otherComment = other.comments_[comment]; if ( otherComment.comment_ ) comments_[comment].setComment( otherComment.comment_ ); } }}
开发者ID:Maysscui,项目名称:weibo-sdk-util,代码行数:54,
示例9: type_Value::Value( const Datacratic::Utf8String &value ) : type_( stringValue ) , allocated_( true ) , comments_( 0 )# ifdef JSON_VALUE_USE_INTERNAL_MAP , itemIsUsed_( 0 )#endif{ value_.string_ = valueAllocator()->duplicateStringValue( value.rawData(), (unsigned int)value.rawLength() );}
开发者ID:mikebd,项目名称:soa,代码行数:12,
示例10: type_Value::Value (beast::String const& beastString) : type_ ( stringValue ) , allocated_ ( true ) , comments_ ( 0 )# ifdef JSON_VALUE_USE_INTERNAL_MAP , itemIsUsed_ ( 0 )#endif{ value_.string_ = valueAllocator ()->duplicateStringValue ( beastString.toStdString ().c_str (), (unsigned int)beastString.length () );}
开发者ID:12w21,项目名称:rippled,代码行数:12,
示例11: cstr_ Value::CZString::CZString(const char *cstr, DuplicationPolicy allocate) : cstr_(allocate == duplicate ? valueAllocator()->makeMemberName(cstr) : cstr), index_(allocate) {}
开发者ID:hroskes,项目名称:cmssw,代码行数:2,
示例12: DummyValueAllocatorInitializer DummyValueAllocatorInitializer() { valueAllocator(); // ensure valueAllocator() statics are initialized before main(). }
开发者ID:hroskes,项目名称:cmssw,代码行数:3,
示例13: DummyValueAllocatorInitializer DummyValueAllocatorInitializer() { // ensure value allocator statics are initialized before main valueAllocator(); }
开发者ID:gamedevforks,项目名称:mariachi,代码行数:4,
注:本文中的valueAllocator函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ valueAt函数代码示例 C++ value1函数代码示例 |