#ifndef LIBFSPP_HPP
#define LIBFSPP_HPP

#include "config.h"

// libfs++
#include <fs++/file_iterator.h>
#include <fs++/file_t.h>

using filesystem::file_iterator ;
using filesystem::file_t ;
using filesystem::isDirectory ;

// requires lhs and rhs to be in lowercase
bool sort_order(const std::string& lhs, const std::string& rhs,
		bool lhs_is_dir, bool rhs_is_dir);

// decides the order of the files returned from libfs++ when traversing a directory
struct default_order : std::binary_function <const file_t&, const file_t&, bool>
{
  result_type operator() (first_argument_type a, second_argument_type b) const
  {
    return sort_order(a.getName(), b.getName(), isDirectory(a.getName()), isDirectory(b.getName()));
  }
};

#endif
