From a9fe8f28a4a9aaf1d9b84dbc6907849ace87f66e Mon Sep 17 00:00:00 2001 From: Fritz Elfert Date: Tue, 6 Feb 2001 01:01:46 +0000 Subject: - Added KDE2 PropsDialog Plugin (incomplete) - Fixed some KDE related autoconf stuff - Added PlpDrive class for returning results from rfsv:devinfo - Added auto-watch in ppsocket and finally got rid of the nasty SIGPIPE bug. Now it's no more necessary to ignore SIGPIPE in applications. - Made constructors of rfsv16, rfsv32, rpcs16 and rpcs32 private to enforce use of the factories. - Removed error output in the factories and replaced that by error codes which can be retrieved and evaluated by an application. --- lib/plpdirent.h | 164 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 164 insertions(+) (limited to 'lib/plpdirent.h') diff --git a/lib/plpdirent.h b/lib/plpdirent.h index 9a25a67..c567a9b 100644 --- a/lib/plpdirent.h +++ b/lib/plpdirent.h @@ -157,4 +157,168 @@ private: string attrstr; string name; }; + +/** + * A class representing information about + * a Disk drive on the psion. An Object of this type + * is used by @ref rfsv::devinfo for returning the + * information of the probed drive. + * + * @author Fritz Elfert + */ +class PlpDrive { + friend rfsv32; + friend rfsv16; + + public: + /** + * Default constructor. + */ + PlpDrive(); + + /** + * Copy constructor + */ + PlpDrive(const PlpDrive &other); + + /** + * Retrieve the media type of the drive. + * + * @returns The media type of the probed drive. + *
+	 * Media types are encoded by a number
+         * in the range 0 .. 8 with the following
+	 * meaning:
+	 *
+	 *   0 = Not present
+	 *   1 = Unknown
+	 *   2 = Floppy
+	 *   3 = Disk
+	 *   4 = CD-ROM
+	 *   5 = RAM
+	 *   6 = Flash Disk
+	 *   7 = ROM
+	 *   8 = Remote
+	 * 
+ */ + u_int32_t getMediaType(); + + /** + * Retrieve the media type of the drive. + * Just like the above function, but returns + * the media type as human readable string. + * + * @param ret The string is returned here. + */ + void getMediaType(string &ret); + + /** + * Retrieve the attributes of the drive. + * + * @returns The attributes of the probed drive. + *
+	 * Drive attributes are encoded by a number
+	 * in the range 0 .. 63. The bits have the
+	 * the following meaning:
+	 *
+	 *   bit 0 = local
+	 *   bit 1 = ROM
+	 *   bit 2 = redirected
+	 *   bit 3 = substituted
+	 *   bit 4 = internal
+	 *   bit 5 = removable
+	 * 
+ */ + u_int32_t getDriveAttribute(); + + /** + * Retrieve the attributes of the drive. + * Just like the above function, but returns + * the attributes as human readable string. + * + * @param ret The string is returned here. + */ + void getDriveAttribute(string &ret); + + /** + * Retrieve the attributes of the media. + * + * @returns The attributes of the probed media. + *
+	 * Media attributes are encoded by a number
+	 * in the range 0 .. 15. The bits have the
+	 * following meaning:
+	 *
+	 *   bit 0 = variable size
+	 *   bit 1 = dual density
+	 *   bit 2 = formattable
+	 *   bit 3 = write protected
+	 * 
+ */ + u_int32_t getMediaAttribute(); + + /** + * Retrieve the attributes of the media. + * Just like the above function, but returns + * the attributes as human readable string. + * + * @param ret The string is returned here. + */ + void getMediaAttribute(string &ret); + + /** + * Retrieve the UID of the drive. + * Each drive, except the ROM drive on a Psion has + * a unique ID which can be retrieved here. + * + * @returns The UID of the probed drive. + */ + u_int32_t getUID(); + + /** + * Retrieve the total capacity of the drive. + * + * @returns The capacity of the probed drive in bytes. + */ + u_int64_t getSize(); + + /** + * Retrieve the free capacity on the drive. + * + * @returns The free space on the probed drive in bytes. + */ + u_int64_t getSpace(); + + /** + * Retrieve the volume name of the drive. + * + * returns The volume name of the drive. + */ + string getName(); + + /** + * Retrieve the drive letter of the drive. + * + * returns The letter of the probed drive. + */ + char getDrivechar(); + + private: + void setMediaType(u_int32_t type); + void setDriveAttribute(u_int32_t attr); + void setMediaAttribute(u_int32_t attr); + void setUID(u_int32_t uid); + void setSize(u_int32_t sizeLo, u_int32_t sizeHi); + void setSpace(u_int32_t spaceLo, u_int32_t spaceHi); + void setName(char drive, const char * const volname); + + u_int32_t mediatype; + u_int32_t driveattr; + u_int32_t mediaattr; + u_int32_t uid; + u_int64_t size; + u_int64_t space; + char drivechar; + string name; +}; #endif -- cgit v1.2.3