From 4da48658c8f1dfbf5960bb1768dc6d154c528734 Mon Sep 17 00:00:00 2001 From: Fritz Elfert Date: Thu, 1 Feb 2001 22:23:42 +0000 Subject: Added in missing plpdirent.cc Added a small description of the KDE stuff in README Small fixes in rfsv16 and ppsocket. --- lib/plpdirent.cc | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 lib/plpdirent.cc (limited to 'lib/plpdirent.cc') diff --git a/lib/plpdirent.cc b/lib/plpdirent.cc new file mode 100644 index 0000000..345eac6 --- /dev/null +++ b/lib/plpdirent.cc @@ -0,0 +1,66 @@ +#include +#include +#include + +PlpDirent::PlpDirent(const PlpDirent &e) { + size = e.size; + attr = e.attr; + time = e.time; + memcpy(uid, e.uid, sizeof(uid)); + name = e.name; + attrstr = e.attrstr; +} + +long PlpDirent:: +getSize() { + return size; +} + +long PlpDirent:: +getAttr() { + return attr; +} + +long PlpDirent:: +getUID(int uididx) { + if ((uididx >= 0) && (uididx < 4)) + return uid[uididx]; + return 0; +} + +const char *PlpDirent:: +getName() { + return name.c_str(); +} + +PsiTime PlpDirent:: +getPsiTime() { + return time; +} + +void PlpDirent:: +setName(const char *str) { + name = str; +} + +PlpDirent &PlpDirent:: +operator=(const PlpDirent &e) { + size = e.size; + attr = e.attr; + time = e.time; + memcpy(uid, e.uid, sizeof(uid)); + name = e.name; + attrstr = e.attrstr; + return *this; +} + +ostream & +operator<<(ostream &o, const PlpDirent &e) { + ostream::fmtflags old = o.flags(); + + o << e.attrstr << " " << dec << setw(10) + << setfill(' ') << e.size << " " << e.time + << " " << e.name; + o.flags(old); + return o; +} -- cgit v1.2.3