diff options
| author | Fritz Elfert <felfert@to.com> | 2001-02-02 04:49:20 +0000 | 
|---|---|---|
| committer | Fritz Elfert <felfert@to.com> | 2001-02-02 04:49:20 +0000 | 
| commit | 9fac7af37460c6a73a7debac1ba82b094a8f066c (patch) | |
| tree | c6ef3e0ebd088c62348f140289f82482d82db1cf /lib/plpdirent.cc | |
| parent | 4da48658c8f1dfbf5960bb1768dc6d154c528734 (diff) | |
| download | plptools-9fac7af37460c6a73a7debac1ba82b094a8f066c.tar.gz plptools-9fac7af37460c6a73a7debac1ba82b094a8f066c.tar.bz2 plptools-9fac7af37460c6a73a7debac1ba82b094a8f066c.zip  | |
Replaced lot of ugly char * by string.
Fixed bug in plpftp's filename-completion, which was introduced
yesterday.
Added a class PlpUID for dealing with application-UIDs
Added UID->mimetype mapping in kioslave.
Diffstat (limited to 'lib/plpdirent.cc')
| -rw-r--r-- | lib/plpdirent.cc | 25 | 
1 files changed, 22 insertions, 3 deletions
diff --git a/lib/plpdirent.cc b/lib/plpdirent.cc index 345eac6..33e1a78 100644 --- a/lib/plpdirent.cc +++ b/lib/plpdirent.cc @@ -2,11 +2,25 @@  #include <stream.h>  #include <iomanip> +PlpUID::PlpUID() { +	memset(uid, 0, sizeof(uid)); +} + +PlpUID::PlpUID(const long u1, const long u2, const long u3) { +	uid[0] = u1; uid[1] = u2; uid[2] = u3; +} + +long PlpUID:: +operator[](int idx) { +	assert ((idx > -1) && (idx < 3)); +	return uid[idx]; +} +  PlpDirent::PlpDirent(const PlpDirent &e) {  	size    = e.size;  	attr    = e.attr;  	time    = e.time; -	memcpy(uid, e.uid, sizeof(uid)); +	UID     = e.UID;  	name    = e.name;  	attrstr = e.attrstr;  } @@ -24,10 +38,15 @@ getAttr() {  long PlpDirent::  getUID(int uididx) {  	if ((uididx >= 0) && (uididx < 4)) -		return uid[uididx]; +		return UID[uididx];  	return 0;  } +PlpUID &PlpDirent:: +getUID() { +	return UID; +} +  const char *PlpDirent::  getName() {  	return name.c_str(); @@ -48,7 +67,7 @@ operator=(const PlpDirent &e) {  	size    = e.size;  	attr    = e.attr;  	time    = e.time; -	memcpy(uid, e.uid, sizeof(uid)); +	UID     = e.UID;  	name    = e.name;  	attrstr = e.attrstr;  	return *this;  | 
