summaryrefslogtreecommitdiff
path: root/recman.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'recman.cpp')
-rw-r--r--recman.cpp48
1 files changed, 48 insertions, 0 deletions
diff --git a/recman.cpp b/recman.cpp
index db2d5fc..e9150b6 100644
--- a/recman.cpp
+++ b/recman.cpp
@@ -282,6 +282,54 @@ namespace vdrlive {
/**
+ * Implemetation of class RecordingsItemPtrCompare
+ */
+ bool RecordingsItemPtrCompare::ByAscendingDate(RecordingsItemPtr & first, RecordingsItemPtr & second)
+ {
+ if (first->StartTime() < second->StartTime())
+ return true;
+ return false;
+ }
+
+ bool RecordingsItemPtrCompare::ByDescendingDate(RecordingsItemPtr & first, RecordingsItemPtr & second)
+ {
+ if (first->StartTime() < second->StartTime())
+ return false;
+ return true;
+ }
+
+ bool RecordingsItemPtrCompare::ByAscendingName(RecordingsItemPtr & first, RecordingsItemPtr & second)
+ {
+ unsigned int i = 0;
+ while (i < first->Name().length() && i < second->Name().length()) {
+ if (tolower((first->Name())[i]) < tolower((second->Name())[i]))
+ return true;
+ else if (tolower((first->Name())[i]) > tolower((second->Name())[i]))
+ return false;
+ ++i;
+ }
+ if (first->Name().length() < second->Name().length())
+ return true;
+ return false;
+ }
+
+ bool RecordingsItemPtrCompare::ByDescendingName(RecordingsItemPtr & first, RecordingsItemPtr & second)
+ {
+ unsigned int i = 0;
+ while (i < first->Name().length() && i < second->Name().length()) {
+ if (tolower((second->Name())[i]) < tolower((first->Name())[i]))
+ return true;
+ else if (tolower((second->Name())[i]) > tolower((first->Name())[i]))
+ return false;
+ ++i;
+ }
+ if (second->Name().length() < first->Name().length())
+ return true;
+ return false;
+ }
+
+
+ /**
* Implementation of class RecordingsItem:
*/
RecordingsItem::RecordingsItem(string const & name, RecordingsItemPtr parent) :