File indexing completed on 2024-04-28 15:39:58

0001 /*
0002    SPDX-FileCopyrightText: 2018 Johannes Zarl-Zierl <johannes@zarl-zierl.at>
0003    SPDX-FileCopyrightText: 2003-2010 Jesper K. Pedersen <blackie@kde.org>
0004 
0005    SPDX-License-Identifier: GPL-2.0-or-later
0006 */
0007 #ifndef MEDIACOUNT_H
0008 #define MEDIACOUNT_H
0009 
0010 namespace DB
0011 {
0012 class MediaCount
0013 {
0014 public:
0015     MediaCount()
0016         : m_null(true)
0017         , m_images(0)
0018         , m_videos(0)
0019     {
0020     }
0021     MediaCount(int images, int videos)
0022         : m_null(false)
0023         , m_images(images)
0024         , m_videos(videos)
0025     {
0026     }
0027     bool isNull() const { return m_null; }
0028     int images() const { return m_images; }
0029     int videos() const { return m_videos; }
0030     int total() const { return m_images + m_videos; }
0031 
0032 private:
0033     bool m_null;
0034     int m_images;
0035     int m_videos;
0036 };
0037 
0038 }
0039 
0040 #endif /* MEDIACOUNT_H */
0041 
0042 // vi:expandtab:tabstop=4 shiftwidth=4: