Lines Matching refs:other
173 Value::CZString::CZString(const CZString& other)
174 : cstr_(other.index_ != noDuplication && other.cstr_ != 0
175 ? duplicateStringValue(other.cstr_)
176 : other.cstr_),
177 index_(other.cstr_
178 ? static_cast<ArrayIndex>(other.index_ == noDuplication
180 : other.index_) {}
187 void Value::CZString::swap(CZString& other) {
188 std::swap(cstr_, other.cstr_);
189 std::swap(index_, other.index_);
192 Value::CZString& Value::CZString::operator=(CZString other) {
193 swap(other);
197 bool Value::CZString::operator<(const CZString& other) const {
199 return strcmp(cstr_, other.cstr_) < 0;
200 return index_ < other.index_;
203 bool Value::CZString::operator==(const CZString& other) const {
205 return strcmp(cstr_, other.cstr_) == 0;
206 return index_ == other.index_;
324 Value::Value(const Value& other)
325 : type_(other.type_), allocated_(false)
331 comments_(0), start_(other.start_), limit_(other.limit_) {
338 value_ = other.value_;
341 if (other.value_.string_) {
342 value_.string_ = duplicateStringValue(other.value_.string_);
352 value_.map_ = new ObjectValues(*other.value_.map_);
356 value_.array_ = arrayAllocator()->newArrayCopy(*other.value_.array_);
359 value_.map_ = mapAllocator()->newMapCopy(*other.value_.map_);
365 if (other.comments_) {
368 const CommentInfo& otherComment = other.comments_[comment];
408 Value& Value::operator=(Value other) {
409 swap(other);
413 void Value::swap(Value& other) {
415 type_ = other.type_;
416 other.type_ = temp;
417 std::swap(value_, other.value_);
419 allocated_ = other.allocated_;
420 other.allocated_ = temp2;
421 std::swap(start_, other.start_);
422 std::swap(limit_, other.limit_);
427 int Value::compare(const Value& other) const {
428 if (*this < other)
430 if (*this > other)
435 bool Value::operator<(const Value& other) const {
436 int typeDelta = type_ - other.type_;
443 return value_.int_ < other.value_.int_;
445 return value_.uint_ < other.value_.uint_;
447 return value_.real_ < other.value_.real_;
449 return value_.bool_ < other.value_.bool_;
451 return (value_.string_ == 0 && other.value_.string_) ||
452 (other.value_.string_ && value_.string_ &&
453 strcmp(value_.string_, other.value_.string_) < 0);
457 int delta = int(value_.map_->size() - other.value_.map_->size());
460 return (*value_.map_) < (*other.value_.map_);
464 return value_.array_->compare(*(other.value_.array_)) < 0;
466 return value_.map_->compare(*(other.value_.map_)) < 0;
474 bool Value::operator<=(const Value& other) const { return !(other < *this); }
476 bool Value::operator>=(const Value& other) const { return !(*this < other); }
478 bool Value::operator>(const Value& other) const { return other < *this; }
480 bool Value::operator==(const Value& other) const {
481 // if ( type_ != other.type_ )
485 int temp = other.type_;
492 return value_.int_ == other.value_.int_;
494 return value_.uint_ == other.value_.uint_;
496 return value_.real_ == other.value_.real_;
498 return value_.bool_ == other.value_.bool_;
500 return (value_.string_ == other.value_.string_) ||
501 (other.value_.string_ && value_.string_ &&
502 strcmp(value_.string_, other.value_.string_) == 0);
506 return value_.map_->size() == other.value_.map_->size() &&
507 (*value_.map_) == (*other.value_.map_);
510 return value_.array_->compare(*(other.value_.array_)) == 0;
512 return value_.map_->compare(*(other.value_.map_)) == 0;
520 bool Value::operator!=(const Value& other) const { return !(*this == other); }
720 bool Value::isConvertibleTo(ValueType other) const {
721 switch (other) {