blob: 43d795f260c7c8b5b1b98fc66dd659179bcb5677 [file] [log] [blame]
Ankush Singhee2362f2023-08-29 09:42:031// Copyright 2023 The Chromium Authors
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#include "components/sync/service/local_data_description.h"
6
7namespace syncer {
8
9LocalDataDescription::LocalDataDescription() = default;
10
Ankush Singh15b04fc2023-08-31 13:52:0011LocalDataDescription::LocalDataDescription(
12 ModelType type,
Ankush Singh7e8d6052023-09-04 09:59:4113 int item_count,
14 const std::vector<std::string>& domains,
15 int domain_count)
16 : type(type),
17 item_count(item_count),
18 domains(domains),
19 domain_count(domain_count) {}
Ankush Singh15b04fc2023-08-31 13:52:0020
Ankush Singhee2362f2023-08-29 09:42:0321LocalDataDescription::LocalDataDescription(const LocalDataDescription&) =
22 default;
23
24LocalDataDescription& LocalDataDescription::operator=(
25 const LocalDataDescription&) = default;
26
27LocalDataDescription::LocalDataDescription(LocalDataDescription&&) = default;
28
29LocalDataDescription& LocalDataDescription::operator=(LocalDataDescription&&) =
30 default;
31
32LocalDataDescription::~LocalDataDescription() = default;
33
Ankush Singhfcbd6b12023-09-08 11:10:1134bool operator==(const LocalDataDescription& lhs,
35 const LocalDataDescription& rhs) {
36 return lhs.type == rhs.type && lhs.item_count == rhs.item_count &&
37 lhs.domains == rhs.domains && lhs.domain_count == rhs.domain_count;
38}
39
40bool operator!=(const LocalDataDescription& lhs,
41 const LocalDataDescription& rhs) {
42 return !(lhs == rhs);
43}
44
Ankush Singh05d8b39e2023-09-08 13:13:3545void PrintTo(const LocalDataDescription& desc, std::ostream* os) {
46 *os << "{ type:" << syncer::ModelTypeToDebugString(desc.type)
47 << ", item_count:" << desc.item_count << ", domains:[";
48 for (const auto& domain : desc.domains) {
49 *os << domain << ",";
50 }
51 *os << "], domain_count:" << desc.domain_count;
52}
53
Ankush Singhee2362f2023-08-29 09:42:0354} // namespace syncer