Lines Matching refs:value
45 std::ostream& operator<<(std::ostream& out, const Value& value) { in operator <<() argument
46 value.Print(&out); in operator <<()
78 RawString::RawString(const android::StringPool::Ref& ref) : value(ref) { in RawString()
81 bool RawString::Equals(const Value* value) const { in Equals()
82 const RawString* other = ValueCast<RawString>(value); in Equals()
86 return *this->value == *other->value; in Equals()
91 out_value->data = android::util::HostToDevice32(static_cast<uint32_t>(value.index())); in Flatten()
96 *out << "(raw string) " << *value; in Print()
110 bool Reference::Equals(const Value* value) const { in Equals()
111 const Reference* other = ValueCast<Reference>(value); in Equals()
120 if (name && name.value().type.type == ResourceType::kMacro) { in Flatten()
160 *out << name.value(); in Print()
163 if (id && id.value().is_valid()) { in Print()
167 *out << id.value(); in Print()
192 const ResourceName& name = ref.name.value(); in PrettyPrintReferenceImpl()
200 } else if (ref.id && ref.id.value().is_valid()) { in PrettyPrintReferenceImpl()
201 printer->Print(ref.id.value().to_string()); in PrettyPrintReferenceImpl()
210 const bool print_package = name ? package != name.value().package : true; in PrettyPrint()
214 bool Id::Equals(const Value* value) const { in Equals()
215 return ValueCast<Id>(value) != nullptr; in Equals()
228 String::String(const android::StringPool::Ref& ref) : value(ref) { in String()
231 bool String::Equals(const Value* value) const { in Equals()
232 const String* other = ValueCast<String>(value); in Equals()
237 if (this->value != other->value) { in Equals()
257 if (value.index() > std::numeric_limits<uint32_t>::max()) { in Flatten()
262 out_value->data = android::util::HostToDevice32(static_cast<uint32_t>(value.index())); in Flatten()
267 *out << "(string) \"" << *value << "\""; in Print()
272 printer->Print(*value); in PrettyPrint()
276 StyledString::StyledString(const android::StringPool::StyleRef& ref) : value(ref) { in StyledString()
279 bool StyledString::Equals(const Value* value) const { in Equals()
280 const StyledString* other = ValueCast<StyledString>(value); in Equals()
285 if (this->value != other->value) { in Equals()
304 if (value.index() > std::numeric_limits<uint32_t>::max()) { in Flatten()
309 out_value->data = android::util::HostToDevice32(static_cast<uint32_t>(value.index())); in Flatten()
314 *out << "(styled string) \"" << value->value << "\""; in Print()
315 for (const android::StringPool::Span& span : value->spans) { in Print()
323 bool FileReference::Equals(const Value* value) const { in Equals()
324 const FileReference* other = ValueCast<FileReference>(value); in Equals()
358 BinaryPrimitive::BinaryPrimitive(const android::Res_value& val) : value(val) { in BinaryPrimitive()
362 value.dataType = dataType; in BinaryPrimitive()
363 value.data = data; in BinaryPrimitive()
366 bool BinaryPrimitive::Equals(const Value* value) const { in Equals()
367 const BinaryPrimitive* other = ValueCast<BinaryPrimitive>(value); in Equals()
371 return this->value.dataType == other->value.dataType && in Equals()
372 this->value.data == other->value.data; in Equals()
376 out_value->dataType = value.dataType; in Flatten()
377 out_value->data = android::util::HostToDevice32(value.data); in Flatten()
382 *out << StringPrintf("(primitive) type=0x%02x data=0x%08x", value.dataType, value.data); in Print()
396 const float value = mantissa * (1.0f / (1 << 23)); in ComplexToString() local
398 std::string str = StringPrintf("%f", value); in ComplexToString()
444 switch (value.dataType) { in PrettyPrint()
446 if (value.data == Res_value::DATA_NULL_EMPTY) { in PrettyPrint()
454 printer->Print(StringPrintf("%" PRIi32, static_cast<int32_t>(value.data))); in PrettyPrint()
458 printer->Print(StringPrintf("0x%08x", value.data)); in PrettyPrint()
462 printer->Print(value.data != 0 ? "true" : "false"); in PrettyPrint()
469 printer->Print(StringPrintf("#%08x", value.data)); in PrettyPrint()
473 printer->Print(StringPrintf("%g", *reinterpret_cast<const float*>(&value.data))); in PrettyPrint()
477 printer->Print(ComplexToString(value.data, false /*fraction*/)); in PrettyPrint()
481 printer->Print(ComplexToString(value.data, true /*fraction*/)); in PrettyPrint()
485 printer->Print(StringPrintf("(unknown 0x%02x) 0x%08x", value.dataType, value.data)); in PrettyPrint()
498 out << s.symbol.name.value().entry; in operator <<()
502 return out << "=" << s.value; in operator <<()
510 bool Attribute::Equals(const Value* value) const { in Equals()
511 const Attribute* other = ValueCast<Attribute>(value); in Equals()
540 return a->symbol.Equals(&b->symbol) && a->value == b->value; in Equals()
681 static void BuildAttributeMismatchMessage(const Attribute& attr, const Item& value, in BuildAttributeMismatchMessage() argument
724 *out_msg << " but got " << value; in BuildAttributeMismatchMessage()
752 if (flattened_data == s.value) { in Matches()
769 mask |= s.value; in Matches()
803 out << entry.key.name.value(); in operator <<()
805 out << entry.key.id.value(); in operator <<()
809 out << " = " << entry.value; in operator <<()
837 bool Style::Equals(const Value* value) const { in Equals()
838 const Style* other = ValueCast<Style>(value); in Equals()
844 (parent && other->parent && !parent.value().Equals(&other->parent.value()))) { in Equals()
860 return a->key.Equals(&b->key) && a->value->Equals(b->value.get()); in Equals()
866 if (parent && parent.value().name) { in Print()
867 const Reference& parent_ref = parent.value(); in Print()
871 *out << parent_ref.name.value(); in Print()
878 if (entry.value != nullptr) { in CloneEntry()
880 cloned_entry.value = entry.value->Transform(cloner); in CloneEntry()
937 bool Array::Equals(const Value* value) const { in Equals()
938 const Array* other = ValueCast<Array>(value); in Equals()
957 bool Plural::Equals(const Value* value) const { in Equals()
958 const Plural* other = ValueCast<Plural>(value); in Equals()
1007 bool Styleable::Equals(const Value* value) const { in Equals()
1008 const Styleable* other = ValueCast<Styleable>(value); in Equals()
1028 bool Macro::Equals(const Value* value) const { in Equals()
1029 const Macro* other = ValueCast<Macro>(value); in Equals()
1075 std::unique_ptr<T> CopyValueFields(std::unique_ptr<T> new_value, const T* value) { in CopyValueFields() argument
1076 new_value->SetSource(value->GetSource()); in CopyValueFields()
1077 new_value->SetComment(value->GetComment()); in CopyValueFields()
1085 std::unique_ptr<Reference> CloningValueTransformer::TransformDerived(const Reference* value) { in TransformDerived() argument
1086 return std::make_unique<Reference>(*value); in TransformDerived()
1089 std::unique_ptr<Id> CloningValueTransformer::TransformDerived(const Id* value) { in TransformDerived() argument
1090 return std::make_unique<Id>(*value); in TransformDerived()
1093 std::unique_ptr<RawString> CloningValueTransformer::TransformDerived(const RawString* value) { in TransformDerived() argument
1094 auto new_value = std::make_unique<RawString>(pool_->MakeRef(value->value)); in TransformDerived()
1095 return CopyValueFields(std::move(new_value), value); in TransformDerived()
1098 std::unique_ptr<String> CloningValueTransformer::TransformDerived(const String* value) { in TransformDerived() argument
1099 auto new_value = std::make_unique<String>(pool_->MakeRef(value->value)); in TransformDerived()
1100 new_value->untranslatable_sections = value->untranslatable_sections; in TransformDerived()
1101 return CopyValueFields(std::move(new_value), value); in TransformDerived()
1104 std::unique_ptr<StyledString> CloningValueTransformer::TransformDerived(const StyledString* value) { in TransformDerived() argument
1105 auto new_value = std::make_unique<StyledString>(pool_->MakeRef(value->value)); in TransformDerived()
1106 new_value->untranslatable_sections = value->untranslatable_sections; in TransformDerived()
1107 return CopyValueFields(std::move(new_value), value); in TransformDerived()
1111 const FileReference* value) { in TransformDerived() argument
1112 auto new_value = std::make_unique<FileReference>(pool_->MakeRef(value->path)); in TransformDerived()
1113 new_value->file = value->file; in TransformDerived()
1114 new_value->type = value->type; in TransformDerived()
1115 return CopyValueFields(std::move(new_value), value); in TransformDerived()
1119 const BinaryPrimitive* value) { in TransformDerived() argument
1120 return std::make_unique<BinaryPrimitive>(*value); in TransformDerived()
1123 std::unique_ptr<Attribute> CloningValueTransformer::TransformDerived(const Attribute* value) { in TransformDerived() argument
1125 new_value->type_mask = value->type_mask; in TransformDerived()
1126 new_value->min_int = value->min_int; in TransformDerived()
1127 new_value->max_int = value->max_int; in TransformDerived()
1128 for (const Attribute::Symbol& s : value->symbols) { in TransformDerived()
1131 .value = s.value, in TransformDerived()
1135 return CopyValueFields(std::move(new_value), value); in TransformDerived()
1138 std::unique_ptr<Style> CloningValueTransformer::TransformDerived(const Style* value) { in TransformDerived() argument
1140 new_value->parent = value->parent; in TransformDerived()
1141 new_value->parent_inferred = value->parent_inferred; in TransformDerived()
1142 for (auto& entry : value->entries) { in TransformDerived()
1143 new_value->entries.push_back(Style::Entry{entry.key, entry.value->Transform(*this)}); in TransformDerived()
1145 return CopyValueFields(std::move(new_value), value); in TransformDerived()
1148 std::unique_ptr<Array> CloningValueTransformer::TransformDerived(const Array* value) { in TransformDerived() argument
1150 for (auto& item : value->elements) { in TransformDerived()
1153 return CopyValueFields(std::move(new_value), value); in TransformDerived()
1156 std::unique_ptr<Plural> CloningValueTransformer::TransformDerived(const Plural* value) { in TransformDerived() argument
1158 const size_t count = value->values.size(); in TransformDerived()
1160 if (value->values[i]) { in TransformDerived()
1161 new_value->values[i] = value->values[i]->Transform(*this); in TransformDerived()
1164 return CopyValueFields(std::move(new_value), value); in TransformDerived()
1167 std::unique_ptr<Styleable> CloningValueTransformer::TransformDerived(const Styleable* value) { in TransformDerived() argument
1169 for (const Reference& s : value->entries) { in TransformDerived()
1172 return CopyValueFields(std::move(new_value), value); in TransformDerived()
1175 std::unique_ptr<Macro> CloningValueTransformer::TransformDerived(const Macro* value) { in TransformDerived() argument
1176 auto new_value = std::make_unique<Macro>(*value); in TransformDerived()
1177 return CopyValueFields(std::move(new_value), value); in TransformDerived()