xref: /haiku/src/apps/haikudepot/packagemodel/PackageScreenshotInfo.cpp (revision 344ded80d400028c8f561b4b876257b94c12db4a)
1 /*
2  * Copyright 2024, Andrew Lindesay <apl@lindesay.co.nz>.
3  * All rights reserved. Distributed under the terms of the MIT License.
4  */
5 
6 
7 #include "PackageScreenshotInfo.h"
8 
9 
10 PackageScreenshotInfo::PackageScreenshotInfo()
11 {
12 }
13 
14 
15 PackageScreenshotInfo::PackageScreenshotInfo(const PackageScreenshotInfo& other)
16 	:
17 	fScreenshotInfos(other.fScreenshotInfos)
18 {
19 }
20 
21 
22 PackageScreenshotInfo&
23 PackageScreenshotInfo::operator=(const PackageScreenshotInfo& other)
24 {
25 	fScreenshotInfos = other.fScreenshotInfos;
26 	return *this;
27 }
28 
29 
30 bool
31 PackageScreenshotInfo::operator==(const PackageScreenshotInfo& other) const
32 {
33 	return fScreenshotInfos == other.fScreenshotInfos;
34 }
35 
36 
37 bool
38 PackageScreenshotInfo::operator!=(const PackageScreenshotInfo& other) const
39 {
40 	return !(*this == other);
41 }
42 
43 
44 void
45 PackageScreenshotInfo::Clear()
46 {
47 	fScreenshotInfos.clear();
48 }
49 
50 
51 int32
52 PackageScreenshotInfo::Count() const
53 {
54 	return fScreenshotInfos.size();
55 }
56 
57 
58 ScreenshotInfoRef
59 PackageScreenshotInfo::ScreenshotAtIndex(int32 index) const
60 {
61 	return fScreenshotInfos[index];
62 }
63 
64 
65 void
66 PackageScreenshotInfo::AddScreenshot(const ScreenshotInfoRef& info)
67 {
68 	fScreenshotInfos.push_back(info);
69 }