//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// Created 2006-12-03 11:36:58 by Felix Rauscher
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

#ifndef _MEDIUM_
#define _MEDIUM_

//c - c++
#include "string"
#include "mntent.h"

class Medium
	{
	private:
//==================================private data members========================
	//name of the medium
		std::string _name;
	//mount point
		std::string _mountpoint;
	//mount type
		std::string _type;
	//options
		std::string _options;
	//is mounted
		bool _is_mounted;
	//is user (un)mountable
		bool _user_mount;
	//check mounted
		void _check_mounted();
	public:
//================================constructor===================================
	//default constructor
		inline Medium(): _is_mounted(false), _user_mount(false) {}
//================================public member functions=======================
	//initialize from mntent
		void Initialize(struct mntent * mnt);
	//get name
		inline const std::string & GetName() const
			{
			return _name;
			}
	//get mount point
		inline const std::string & GetMountPoint() const
			{
			return _mountpoint;
			}
	//get type
		inline const std::string & GetType() const
			{
			return _type;
			}
	//get option
		inline const std::string & GetOptions() const
			{
			return _options;
			}
	//returns true if medium is user mountable
		inline bool IsUserMountable() const
			{
			return _user_mount;
			}
	//returns true if medium is mounted
		inline bool IsMounted() const
			{
			return _is_mounted;
			}
	//mount
		bool Mount();
	//unount
		bool UnMount();
	};



#endif
