MythTV  master
mythsorthelper.h
Go to the documentation of this file.
1 // -*- Mode: c++ -*-
2 // vim: set expandtab tabstop=4 shiftwidth=4
3 
4 #ifndef MYTHSORTHELPER_H_
5 #define MYTHSORTHELPER_H_
6 
7 #include <QCoreApplication>
8  #include <QRegularExpression>
9 #include <memory>
10 #include "mythbaseexp.h"
11 
13 {
17 };
18 
20 {
23 };
24 
29 {
30  Q_DECLARE_TR_FUNCTIONS(MythSortHelper)
31 
32  public:
34  explicit MythSortHelper(MythSortHelper *other);
35  MythSortHelper(Qt::CaseSensitivity case_sensitive, SortPrefixMode prefix_mode,
36  QString exclusions);
37 
38  QString doTitle(const QString& title) const;
39  QString doPathname(const QString& pathname) const;
40 
47  bool hasPrefixes(void) { return not m_prefixes.isEmpty(); }
48 
49  private:
50  void MythSortHelperCommon(void);
51 
53  Qt::CaseSensitivity m_case_sensitive {Qt::CaseInsensitive};
54 
58 
62  QString m_prefixes {QString()};
65  QRegularExpression m_prefixes_regex {QRegularExpression()};
68  QRegularExpression m_prefixes_regex2 {QRegularExpression()};
69 
75  QString m_exclusions {"A to Z"};
77  QStringList m_excl_list {QStringList()};
79 };
80 
81 MBASE_PUBLIC std::shared_ptr<MythSortHelper> getMythSortHelper(void);
83 
84 
85 #endif // MYTHSORTHELPER_H_
A class to consolidate all the soring functions.
#define MBASE_PUBLIC
Definition: mythbaseexp.h:15
SortExclusionMode
SortPrefixMode
MBASE_PUBLIC void resetMythSortHelper(void)
Delete the MythSortHelper singleton.
bool hasPrefixes(void)
Does the language translation specify any prefixes.
MBASE_PUBLIC std::shared_ptr< MythSortHelper > getMythSortHelper(void)
Get a pointer to the MythSortHelper singleton.