diff options
| author | wr61 <wr61@e10066b5-e1e2-0310-b819-94efdf66514b> | 2006-01-23 19:05:04 +0000 |
|---|---|---|
| committer | wr61 <wr61@e10066b5-e1e2-0310-b819-94efdf66514b> | 2006-01-23 19:05:04 +0000 |
| commit | 9d98628dba62ae0bb8d6cc47b762f53bfdd727b2 (patch) | |
| tree | a2abd200495828af5320f455a27cfd606a94788f | |
| parent | 0053b1765a7ab42bb1f9826a4f6c8bb6d0ea826e (diff) | |
| download | vdr-plugin-muggle-9d98628dba62ae0bb8d6cc47b762f53bfdd727b2.tar.gz vdr-plugin-muggle-9d98628dba62ae0bb8d6cc47b762f53bfdd727b2.tar.bz2 | |
mgLikstItem: new field unique_id
git-svn-id: https://vdr-muggle.svn.sourceforge.net/svnroot/vdr-muggle/trunk/muggle-plugin@914 e10066b5-e1e2-0310-b819-94efdf66514b
| -rw-r--r-- | mg_listitem.c | 23 | ||||
| -rw-r--r-- | mg_listitem.h | 3 |
2 files changed, 25 insertions, 1 deletions
diff --git a/mg_listitem.c b/mg_listitem.c index 0f32263..b7cac68 100644 --- a/mg_listitem.c +++ b/mg_listitem.c @@ -15,6 +15,7 @@ mgListItem::mgListItem() { m_valid=false; + m_unique_id="0"; m_count=0; } @@ -24,6 +25,7 @@ mgListItem::mgListItem(const mgListItem* from) m_valid=from->m_valid; m_value=from->m_value; m_id=from->m_id; + m_unique_id=from->m_unique_id; m_count=from->m_count; } @@ -51,6 +53,13 @@ mgListItem::set(string v,string i,unsigned int c) m_count=c; } +void +mgListItem::set_unique_id(string uid) +{ + assert(this); + m_unique_id=uid; +} + void mgListItem::operator=(const mgListItem& from) { @@ -58,6 +67,7 @@ mgListItem::operator=(const mgListItem& from) m_valid=from.m_valid; m_value=from.m_value; m_id=from.m_id; + m_unique_id=from.m_unique_id; m_count=from.m_count; } @@ -68,6 +78,7 @@ mgListItem::operator=(const mgListItem* from) m_valid=from->valid(); m_value=from->value(); m_id=from->id(); + m_unique_id=from->unique_id(); m_count=from->count(); } @@ -77,7 +88,8 @@ mgListItem::operator==(const mgListItem& other) const if (!this) return false; return m_value == other.m_value - && m_id == other.m_id; + && m_id == other.m_id + && m_unique_id == other.m_unique_id; } string @@ -98,6 +110,15 @@ mgListItem::id() const return m_id; } +string +mgListItem::unique_id() const +{ + if (!this) + return ""; + else + return m_unique_id; +} + unsigned int mgListItem::count() const { diff --git a/mg_listitem.h b/mg_listitem.h index ada27d1..14bb0f2 100644 --- a/mg_listitem.h +++ b/mg_listitem.h @@ -24,17 +24,20 @@ class mgListItem mgListItem* Clone(); mgListItem(const mgListItem *from); void set(string v,string i,unsigned int c=0); + void set_unique_id(string uid); void operator=(const mgListItem& from); void operator=(const mgListItem* from); bool operator==(const mgListItem& other) const; string value() const; string id() const; + string unique_id() const; unsigned int count() const; bool valid() const; private: bool m_valid; string m_value; string m_id; + string m_unique_id; unsigned int m_count; }; |
