/**********************************************************************
 * LeechCraft - modular cross-platform feature rich internet client.
 * Copyright (C) 2006-2014  Georg Rudoy
 *
 * Boost Software License - Version 1.0 - August 17th, 2003
 *
 * Permission is hereby granted, free of charge, to any person or organization
 * obtaining a copy of the software and accompanying documentation covered by
 * this license (the "Software") to use, reproduce, display, distribute,
 * execute, and transmit the Software, and to prepare derivative works of the
 * Software, and to permit third-parties to whom the Software is furnished to
 * do so, all subject to the following:
 *
 * The copyright notices in the Software and this entire statement, including
 * the above license grant, this restriction and the following disclaimer,
 * must be included in all copies of the Software, in whole or in part, and
 * all derivative works of the Software, unless such copies or derivative
 * works are solely in the form of machine-executable object code generated by
 * a source language processor.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
 * SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
 * FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 * DEALINGS IN THE SOFTWARE.
 **********************************************************************/

#include "dir.h"

using namespace LeechCraft;

Dir::Dir (QObject *parent)
: QObject (parent)
, Imp_ (new QDir)
{
}

Dir::Dir (const Dir& obj)
: QObject (obj.parent ())
, Imp_ (new QDir (*obj.Imp_))
{
}

Dir::~Dir ()
{
}

QString Dir::absoluteFilePath (const QString& file) const
{
	return Imp_->absoluteFilePath (file);
}

QString Dir::absolutePath () const
{
	return Imp_->absolutePath ();
}

QString Dir::canonicalPath () const
{
	return Imp_->canonicalPath ();
}

bool Dir::cd (const QString& dir)
{
	return Imp_->cd (dir);
}

bool Dir::cdUp ()
{
	return Imp_->cdUp ();
}

uint Dir::count () const
{
	return Imp_->count ();
}

QString Dir::dirName () const
{
	return Imp_->dirName ();
}

QFileInfoList Dir::entryInfoList (const QStringList& nameFilters,
		QDir::Filters filters, QDir::SortFlags sort) const
{
	return Imp_->entryInfoList (nameFilters, filters, sort);
}

QFileInfoList Dir::entryInfoList (QDir::Filters filters, QDir::SortFlags sort) const
{
	return Imp_->entryInfoList (filters, sort);
}

QStringList Dir::entryList (const QStringList& nameFilters,
		QDir::Filters filters, QDir::SortFlags sort) const
{
	return Imp_->entryList (nameFilters, filters, sort);
}

QStringList Dir::entryList (QDir::Filters filters, QDir::SortFlags sort) const
{
	return Imp_->entryList (filters, sort);
}

bool Dir::exists (const QString& dir) const
{
	return Imp_->exists (dir);
}

bool Dir::exists () const
{
	return Imp_->exists ();
}

QString Dir::filePath (const QString& path) const
{
	return Imp_->filePath (path);
}

QDir::Filters Dir::filter () const
{
	return Imp_->filter ();
}

bool Dir::isAbsolute () const
{
	return Imp_->isAbsolute ();
}

bool Dir::isReadable () const
{
	return Imp_->isReadable ();
}

bool Dir::isRelative () const
{
	return Imp_->isRelative ();
}

bool Dir::isRoot () const
{
	return Imp_->isRoot ();
}

bool Dir::makeAbsolute ()
{
	return Imp_->makeAbsolute ();
}

bool Dir::mkdir (const QString& path) const
{
	return Imp_->mkdir (path);
}

bool Dir::mkpath (const QString& path) const
{
	return Imp_->mkpath (path);
}

QStringList Dir::nameFilters () const
{
	return Imp_->nameFilters ();
}

QString Dir::path () const
{
	return Imp_->path ();
}

void Dir::refresh () const
{
	Imp_->refresh ();
}

QString Dir::relativeFilePath (const QString& path) const
{
	return Imp_->relativeFilePath (path);
}

bool Dir::remove (const QString& file)
{
	return Imp_->remove (file);
}

bool Dir::rename (const QString& old, const QString& newName)
{
	return Imp_->rename (old, newName);
}

bool Dir::rmdir (const QString& dir) const
{
	return Imp_->rmdir (dir);
}

bool Dir::rmpath (const QString& path) const
{
	return Imp_->rmpath (path);
}

void Dir::setFilter (QDir::Filters filters)
{
	Imp_->setFilter (filters);
}

void Dir::setNameFilters (const QStringList& filters)
{
	Imp_->setNameFilters (filters);
}

void Dir::setPath (const QString& path)
{
	Imp_->setPath (path);
}

void Dir::setSorting (QDir::SortFlags sorts)
{
	Imp_->setSorting (sorts);
}

QDir::SortFlags Dir::sorting () const
{
	return Imp_->sorting ();
}

bool Dir::operator!= (const Dir& other) const
{
	return *Imp_ != *other.Imp_;
}

Dir& Dir::operator= (const Dir& other)
{
	*Imp_ = *other.Imp_;
	return *this;
}

bool Dir::operator== (const Dir& other) const
{
	return *Imp_ == *other.Imp_;
}

QString Dir::operator[] (int pos) const
{
	return (*Imp_) [pos];
}

