ipodmountpoint.h

00001  /*****************************************************************************
00002  *   Copyright (C) 2004 by Michael Schulze                                    *
00003  *   mike.s@genion.de                                                         *
00004  *                                                                            *
00005  *  The code contained in this file is free software; you can redistribute    *
00006  *  it and/or modify it under the terms of the GNU Lesser General Public      *
00007  *  License as published by the Free Software Foundation; either version      *
00008  *  2.1 of the License, or (at your option) any later version.                *
00009  *                                                                            *
00010  *  This file is distributed in the hope that it will be useful,              *
00011  *  but WITHOUT ANY WARRANTY; without even the implied warranty of            *
00012  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU         *
00013  *  Lesser General Public License for more details.                           *
00014  *                                                                            *
00015  *  You should have received a copy of the GNU Lesser General Public          *
00016  *  License along with this code; if not, write to the Free Software          *
00017  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA *
00018  *                                                                            *
00019  *  iTunes and iPod are trademarks of Apple                                   *
00020  *                                                                            *
00021  *  This product is not supported/written/published by Apple!                 *
00022  *****************************************************************************/
00023 
00024 #ifndef IPODMOUNTPOINT_H
00025 #define IPODMOUNTPOINT_H
00026 
00027 #include <qstring.h>
00028 #include <vector>
00029 
00030 /**
00031 Parses /proc/mounts and looks for mounted iPods
00032 
00033 @author Michael Schulze
00034 */
00035 class IPodMountPoint{
00036 public:
00037     typedef std::vector<IPodMountPoint> List;
00038     typedef std::vector<QString> StringVector;
00039 
00040     IPodMountPoint() {}
00041     IPodMountPoint( const StringVector& entry );
00042     ~IPodMountPoint();
00043 
00044     /**
00045      * Returns the device name found. In most cases this will be something like
00046      * /dev/...
00047      */
00048     const QString& getDevice() const;
00049 
00050     /**
00051      * Returns the path the device is mounted at
00052      */
00053     const QString& getMountPoint() const;
00054 
00055     /**
00056      * Returns the filesystem type name.
00057      */
00058     const QString& getFsType() const;
00059 
00060     /**
00061      * Returns the mount options.
00062      */
00063     const QString& getOptions() const;
00064 
00065     /**
00066      * Returns a List of mounted devices currently found in the system.
00067      */
00068     static List mountedIPods();
00069 
00070 private:
00071 
00072     const QString& getField(uint fieldnum) const;
00073 
00074     std::vector<QString> fields;
00075 };
00076 
00077 #endif

Generated on Wed Dec 19 00:15:19 2007 for libqtpod by  doxygen 1.5.0