------------------------------------------------------------------------------
--                                                                          --
--                An Ada2005 binding to the Qt C++ framework                --
--                                                                          --
------------------------------------------------------------------------------
--                                                                          --
-- Copyright © 2009 Vadim Godunko <vgodunko@gmail.com>                      --
--                                                                          --
-- QtAda is free software;  you can  redistribute it and/or modify it under --
-- terms of the  GNU General Public License as published  by the Free Soft- --
-- ware  Foundation;  either version 2,  or (at your option) any later ver- --
-- sion. QtAda is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY;  without even the  implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License --
-- for  more details.  You should have  received  a copy of the GNU General --
-- Public License distributed with QtAda;  see file COPYING.  If not, write --
-- to  the  Free Software Foundation,  51  Franklin  Street,  Fifth  Floor, --
-- Boston, MA 02110-1301, USA.                                              --
--                                                                          --
-- As a special exception,  if other files  instantiate  generics from this --
-- unit, or you link  this unit with other files  to produce an executable, --
-- this  unit  does not  by itself cause  the resulting  executable  to  be --
-- covered  by the  GNU  General  Public  License.  This exception does not --
-- however invalidate  any other reasons why  the executable file  might be --
-- covered by the  GNU Public License.                                      --
--                                                                          --
------------------------------------------------------------------------------
--    This file has been generated automatically. Please don't edit it.     --
------------------------------------------------------------------------------
pragma Style_Checks ("NM32766");
with System.Address_To_Access_Conversions;

package body Qt4.Dirs is

   function initialize_QDir
    (Storage : Standard.System.Address)
      return Internals.QDir_Access;
   pragma Import (C, initialize_QDir, "__QtAda_inititialize_QDir");

   function initialize_QDir_QStringCR
    (Storage : Standard.System.Address;
     Path : Qt4.Strings.Internals.QString_Access)
      return Internals.QDir_Access;
   pragma Import (C, initialize_QDir_QStringCR, "__QtAda_inititialize_QDir_QStringCR");

   function adjust_QDir
    (Storage : Standard.System.Address;
     From    : Internals.QDir_Access)
       return Internals.QDir_Access;
   pragma Import (C, adjust_QDir, "__QtAda_adjust_QDir");

   procedure finalize_QDir (Object : Internals.QDir_Access);
   pragma Import (C, finalize_QDir, "__QtAda_finalize_QDir");

   procedure QDir_absoluteFilePath_QStringCR
    (Returns : Qt4.Strings.Internals.QString_Access;
     Self : Internals.QDir_Access;
     File_Name : Qt4.Strings.Internals.QString_Access);
   pragma Import (C, QDir_absoluteFilePath_QStringCR, "__QtAda_QDir_absoluteFilePath_QStringCR_Q");

   procedure QDir_absolutePath
    (Returns : Qt4.Strings.Internals.QString_Access;
     Self : Internals.QDir_Access);
   pragma Import (C, QDir_absolutePath, "__QtAda_QDir_absolutePath_Q");

   procedure QDir_canonicalPath
    (Returns : Qt4.Strings.Internals.QString_Access;
     Self : Internals.QDir_Access);
   pragma Import (C, QDir_canonicalPath, "__QtAda_QDir_canonicalPath_Q");

   function QDir_cd_QStringCR
    (Self : Internals.QDir_Access;
     Dir_Name : Qt4.Strings.Internals.QString_Access)
       return Interfaces.C.unsigned;
   pragma Import (C, QDir_cd_QStringCR, "__QtAda_QDir_cd_QStringCR");

   procedure QDir_cdUp
    (Self : Internals.QDir_Access);
   pragma Import (C, QDir_cdUp, "__QtAda_QDir_cdUp");

   function QDir_count
    (Self : Internals.QDir_Access)
       return Qt4.Q_Unsigned_Integer;
   pragma Import (C, QDir_count, "__QtAda_QDir_count_Q");

   procedure QDir_dirName
    (Returns : Qt4.Strings.Internals.QString_Access;
     Self : Internals.QDir_Access);
   pragma Import (C, QDir_dirName, "__QtAda_QDir_dirName_Q");

   function QDir_exists_QStringCR
    (Self : Internals.QDir_Access;
     Name : Qt4.Strings.Internals.QString_Access)
       return Interfaces.C.unsigned;
   pragma Import (C, QDir_exists_QStringCR, "__QtAda_QDir_exists_QStringCR_Q");

   function QDir_exists
    (Self : Internals.QDir_Access)
       return Interfaces.C.unsigned;
   pragma Import (C, QDir_exists, "__QtAda_QDir_exists_Q");

   procedure QDir_filePath_QStringCR
    (Returns : Qt4.Strings.Internals.QString_Access;
     Self : Internals.QDir_Access;
     File_Name : Qt4.Strings.Internals.QString_Access);
   pragma Import (C, QDir_filePath_QStringCR, "__QtAda_QDir_filePath_QStringCR_Q");

   function QDir_isAbsolute
    (Self : Internals.QDir_Access)
       return Interfaces.C.unsigned;
   pragma Import (C, QDir_isAbsolute, "__QtAda_QDir_isAbsolute_Q");

   function QDir_isReadable
    (Self : Internals.QDir_Access)
       return Interfaces.C.unsigned;
   pragma Import (C, QDir_isReadable, "__QtAda_QDir_isReadable_Q");

   function QDir_isRelative
    (Self : Internals.QDir_Access)
       return Interfaces.C.unsigned;
   pragma Import (C, QDir_isRelative, "__QtAda_QDir_isRelative_Q");

   function QDir_isRoot
    (Self : Internals.QDir_Access)
       return Interfaces.C.unsigned;
   pragma Import (C, QDir_isRoot, "__QtAda_QDir_isRoot_Q");

   procedure QDir_makeAbsolute
    (Self : Internals.QDir_Access);
   pragma Import (C, QDir_makeAbsolute, "__QtAda_QDir_makeAbsolute");

   function QDir_mkdir_QStringCR
    (Self : Internals.QDir_Access;
     Dir_Name : Qt4.Strings.Internals.QString_Access)
       return Interfaces.C.unsigned;
   pragma Import (C, QDir_mkdir_QStringCR, "__QtAda_QDir_mkdir_QStringCR");

   function QDir_mkpath_QStringCR
    (Self : Internals.QDir_Access;
     Dir_Path : Qt4.Strings.Internals.QString_Access)
       return Interfaces.C.unsigned;
   pragma Import (C, QDir_mkpath_QStringCR, "__QtAda_QDir_mkpath_QStringCR");

   procedure QDir_nameFilters
    (Returns : Qt4.String_Lists.Internals.QStringList_Access;
     Self : Internals.QDir_Access);
   pragma Import (C, QDir_nameFilters, "__QtAda_QDir_nameFilters_Q");

   procedure QDir_path
    (Returns : Qt4.Strings.Internals.QString_Access;
     Self : Internals.QDir_Access);
   pragma Import (C, QDir_path, "__QtAda_QDir_path_Q");

   procedure QDir_refresh
    (Self : Internals.QDir_Access);
   pragma Import (C, QDir_refresh, "__QtAda_QDir_refresh_Q");

   procedure QDir_relativeFilePath_QStringCR
    (Returns : Qt4.Strings.Internals.QString_Access;
     Self : Internals.QDir_Access;
     File_Name : Qt4.Strings.Internals.QString_Access);
   pragma Import (C, QDir_relativeFilePath_QStringCR, "__QtAda_QDir_relativeFilePath_QStringCR_Q");

   function QDir_remove_QStringCR
    (Self : Internals.QDir_Access;
     File_Name : Qt4.Strings.Internals.QString_Access)
       return Interfaces.C.unsigned;
   pragma Import (C, QDir_remove_QStringCR, "__QtAda_QDir_remove_QStringCR");

   function QDir_rename_QStringCR_QStringCR
    (Self : Internals.QDir_Access;
     Old_Name : Qt4.Strings.Internals.QString_Access;
     New_Name : Qt4.Strings.Internals.QString_Access)
       return Interfaces.C.unsigned;
   pragma Import (C, QDir_rename_QStringCR_QStringCR, "__QtAda_QDir_rename_QStringCR_QStringCR");

   function QDir_rmdir_QStringCR
    (Self : Internals.QDir_Access;
     Dir_Name : Qt4.Strings.Internals.QString_Access)
       return Interfaces.C.unsigned;
   pragma Import (C, QDir_rmdir_QStringCR, "__QtAda_QDir_rmdir_QStringCR");

   function QDir_rmpath_QStringCR
    (Self : Internals.QDir_Access;
     Dir_Path : Qt4.Strings.Internals.QString_Access)
       return Interfaces.C.unsigned;
   pragma Import (C, QDir_rmpath_QStringCR, "__QtAda_QDir_rmpath_QStringCR");

   procedure QDir_setFilter_Filter
    (Self : Internals.QDir_Access;
     Filters : Filter);
   pragma Import (C, QDir_setFilter_Filter, "__QtAda_QDir_setFilter_Filter");

   procedure QDir_setNameFilters_QStringListCR
    (Self : Internals.QDir_Access;
     Name_Filters : Qt4.String_Lists.Internals.QStringList_Access);
   pragma Import (C, QDir_setNameFilters_QStringListCR, "__QtAda_QDir_setNameFilters_QStringListCR");

   procedure QDir_setPath_QStringCR
    (Self : Internals.QDir_Access;
     Path : Qt4.Strings.Internals.QString_Access);
   pragma Import (C, QDir_setPath_QStringCR, "__QtAda_QDir_setPath_QStringCR");

   procedure QDir_addSearchPath_QStringCR_QStringCR
    (Prefix : in Qt4.Strings.Internals.QString_Access;
     Path : in Qt4.Strings.Internals.QString_Access);
   pragma Import (C, QDir_addSearchPath_QStringCR_QStringCR, "__QtAda_QDir_addSearchPath_QStringCR_QStringCR_S");

   procedure QDir_cleanPath_QStringCR
    (Returns : Qt4.Strings.Internals.QString_Access;
     Path : in Qt4.Strings.Internals.QString_Access);
   pragma Import (C, QDir_cleanPath_QStringCR, "__QtAda_QDir_cleanPath_QStringCR_S");

   procedure QDir_current
    (Returns : Internals.QDir_Access);
   pragma Import (C, QDir_current, "__QtAda_QDir_current_S");

   procedure QDir_currentPath
    (Returns : Qt4.Strings.Internals.QString_Access);
   pragma Import (C, QDir_currentPath, "__QtAda_QDir_currentPath_S");

   procedure QDir_fromNativeSeparators_QStringCR
    (Returns : Qt4.Strings.Internals.QString_Access;
     Path_Name : in Qt4.Strings.Internals.QString_Access);
   pragma Import (C, QDir_fromNativeSeparators_QStringCR, "__QtAda_QDir_fromNativeSeparators_QStringCR_S");

   procedure QDir_home
    (Returns : Internals.QDir_Access);
   pragma Import (C, QDir_home, "__QtAda_QDir_home_S");

   procedure QDir_homePath
    (Returns : Qt4.Strings.Internals.QString_Access);
   pragma Import (C, QDir_homePath, "__QtAda_QDir_homePath_S");

   function QDir_isAbsolutePath_QStringCR
    (Path : in Qt4.Strings.Internals.QString_Access)
       return Interfaces.C.unsigned;
   pragma Import (C, QDir_isAbsolutePath_QStringCR, "__QtAda_QDir_isAbsolutePath_QStringCR_S");

   function QDir_isRelativePath_QStringCR
    (Path : in Qt4.Strings.Internals.QString_Access)
       return Interfaces.C.unsigned;
   pragma Import (C, QDir_isRelativePath_QStringCR, "__QtAda_QDir_isRelativePath_QStringCR_S");

   function QDir_match_QStringCR_QStringCR
    (Filter : in Qt4.Strings.Internals.QString_Access;
     File_Name : in Qt4.Strings.Internals.QString_Access)
       return Interfaces.C.unsigned;
   pragma Import (C, QDir_match_QStringCR_QStringCR, "__QtAda_QDir_match_QStringCR_QStringCR_S");

   function QDir_match_QStringListCR_QStringCR
    (Filters : in Qt4.String_Lists.Internals.QStringList_Access;
     File_Name : in Qt4.Strings.Internals.QString_Access)
       return Interfaces.C.unsigned;
   pragma Import (C, QDir_match_QStringListCR_QStringCR, "__QtAda_QDir_match_QStringListCR_QStringCR_S");

   procedure QDir_root
    (Returns : Internals.QDir_Access);
   pragma Import (C, QDir_root, "__QtAda_QDir_root_S");

   procedure QDir_rootPath
    (Returns : Qt4.Strings.Internals.QString_Access);
   pragma Import (C, QDir_rootPath, "__QtAda_QDir_rootPath_S");

   procedure QDir_searchPaths_QStringCR
    (Returns : Qt4.String_Lists.Internals.QStringList_Access;
     Prefix : in Qt4.Strings.Internals.QString_Access);
   pragma Import (C, QDir_searchPaths_QStringCR, "__QtAda_QDir_searchPaths_QStringCR_S");

   procedure QDir_separator
    (Returns : Qt4.Chars.Internals.QChar_Access);
   pragma Import (C, QDir_separator, "__QtAda_QDir_separator_S");

   function QDir_setCurrent_QStringCR
    (Path : in Qt4.Strings.Internals.QString_Access)
       return Interfaces.C.unsigned;
   pragma Import (C, QDir_setCurrent_QStringCR, "__QtAda_QDir_setCurrent_QStringCR_S");

   procedure QDir_setSearchPaths_QStringCR_QStringListCR
    (Prefix : in Qt4.Strings.Internals.QString_Access;
     Search_Paths : in Qt4.String_Lists.Internals.QStringList_Access);
   pragma Import (C, QDir_setSearchPaths_QStringCR_QStringListCR, "__QtAda_QDir_setSearchPaths_QStringCR_QStringListCR_S");

   procedure QDir_temp
    (Returns : Internals.QDir_Access);
   pragma Import (C, QDir_temp, "__QtAda_QDir_temp_S");

   procedure QDir_tempPath
    (Returns : Qt4.Strings.Internals.QString_Access);
   pragma Import (C, QDir_tempPath, "__QtAda_QDir_tempPath_S");

   procedure QDir_toNativeSeparators_QStringCR
    (Returns : Qt4.Strings.Internals.QString_Access;
     Path_Name : in Qt4.Strings.Internals.QString_Access);
   pragma Import (C, QDir_toNativeSeparators_QStringCR, "__QtAda_QDir_toNativeSeparators_QStringCR_S");

   function eq_QDirCR
    (Self : Internals.QDir_Access;
     Dir : Internals.QDir_Access)
       return Interfaces.C.unsigned;
   pragma Import (C, eq_QDirCR, "__QtAda_QDir_eq_QDirCR_Q");

   ------------
   -- Adjust --
   ------------

   overriding
   procedure Adjust (Self : in out Q_Dir) is
   begin
      Self.Object := adjust_QDir (Self.Storage'Address, Self.Object);
      Self.Wrapper := False;
   end Adjust;

   --------------
   -- Finalize --
   --------------

   overriding
   procedure Finalize (Self : in out Q_Dir) is
   begin
      if not Self.Wrapper then
         finalize_QDir (Self.Object);
      end if;
   end Finalize;

   ----------------
   -- Initialize --
   ----------------

   overriding
   procedure Initialize (Self : in out Q_Dir) is
      use type Internals.QDir_Access;

   begin
      if Self.Object = null then
         Self.Object := initialize_QDir (Self.Storage'Address);
      end if;
   end Initialize;

   ------------
   -- Create --
   ------------

   function Create
    (Path : Qt4.Strings.Q_String'Class)
       return Q_Dir
   is
   begin
      return Self : Q_Dir
        := (Ada.Finalization.Controlled with others => <>)
      do
         Self.Object := initialize_QDir_QStringCR (Self.Storage'Address, Qt4.Strings.Internals.QString_View (Path));
      end return;
   end Create;

   ------------------------
   -- Absolute_File_Path --
   ------------------------

   function Absolute_File_Path
    (Self : Q_Dir'Class;
     File_Name : Qt4.Strings.Q_String'Class)
       return Qt4.Strings.Q_String
   is
   begin
      return Returns : Qt4.Strings.Q_String do
         QDir_absoluteFilePath_QStringCR (Qt4.Strings.Internals.QString_View (Returns), Self.Object, Qt4.Strings.Internals.QString_View (File_Name));
      end return;
   end Absolute_File_Path;

   -------------------
   -- Absolute_Path --
   -------------------

   function Absolute_Path
    (Self : Q_Dir'Class)
       return Qt4.Strings.Q_String
   is
   begin
      return Returns : Qt4.Strings.Q_String do
         QDir_absolutePath (Qt4.Strings.Internals.QString_View (Returns), Self.Object);
      end return;
   end Absolute_Path;

   --------------------
   -- Canonical_Path --
   --------------------

   function Canonical_Path
    (Self : Q_Dir'Class)
       return Qt4.Strings.Q_String
   is
   begin
      return Returns : Qt4.Strings.Q_String do
         QDir_canonicalPath (Qt4.Strings.Internals.QString_View (Returns), Self.Object);
      end return;
   end Canonical_Path;

   --------
   -- Cd --
   --------

   function Cd
    (Self : not null access Q_Dir'Class;
     Dir_Name : Qt4.Strings.Q_String'Class)
       return Boolean
   is
   begin
      return Interfaces.C."/=" (QDir_cd_QStringCR (Self.Object, Qt4.Strings.Internals.QString_View (Dir_Name)), 0);
   end Cd;

   -----------
   -- Cd_Up --
   -----------

   procedure Cd_Up
    (Self : in out Q_Dir'Class)
   is
   begin
      QDir_cdUp (Self.Object);
   end Cd_Up;

   -----------
   -- Count --
   -----------

   function Count
    (Self : Q_Dir'Class)
       return Qt4.Q_Unsigned_Integer
   is
   begin
      return QDir_count (Self.Object);
   end Count;

   --------------
   -- Dir_Name --
   --------------

   function Dir_Name
    (Self : Q_Dir'Class)
       return Qt4.Strings.Q_String
   is
   begin
      return Returns : Qt4.Strings.Q_String do
         QDir_dirName (Qt4.Strings.Internals.QString_View (Returns), Self.Object);
      end return;
   end Dir_Name;

   ------------
   -- Exists --
   ------------

   function Exists
    (Self : Q_Dir'Class;
     Name : Qt4.Strings.Q_String'Class)
       return Boolean
   is
   begin
      return Interfaces.C."/=" (QDir_exists_QStringCR (Self.Object, Qt4.Strings.Internals.QString_View (Name)), 0);
   end Exists;

   ------------
   -- Exists --
   ------------

   function Exists
    (Self : Q_Dir'Class)
       return Boolean
   is
   begin
      return Interfaces.C."/=" (QDir_exists (Self.Object), 0);
   end Exists;

   ---------------
   -- File_Path --
   ---------------

   function File_Path
    (Self : Q_Dir'Class;
     File_Name : Qt4.Strings.Q_String'Class)
       return Qt4.Strings.Q_String
   is
   begin
      return Returns : Qt4.Strings.Q_String do
         QDir_filePath_QStringCR (Qt4.Strings.Internals.QString_View (Returns), Self.Object, Qt4.Strings.Internals.QString_View (File_Name));
      end return;
   end File_Path;

   -----------------
   -- Is_Absolute --
   -----------------

   function Is_Absolute
    (Self : Q_Dir'Class)
       return Boolean
   is
   begin
      return Interfaces.C."/=" (QDir_isAbsolute (Self.Object), 0);
   end Is_Absolute;

   -----------------
   -- Is_Readable --
   -----------------

   function Is_Readable
    (Self : Q_Dir'Class)
       return Boolean
   is
   begin
      return Interfaces.C."/=" (QDir_isReadable (Self.Object), 0);
   end Is_Readable;

   -----------------
   -- Is_Relative --
   -----------------

   function Is_Relative
    (Self : Q_Dir'Class)
       return Boolean
   is
   begin
      return Interfaces.C."/=" (QDir_isRelative (Self.Object), 0);
   end Is_Relative;

   -------------
   -- Is_Root --
   -------------

   function Is_Root
    (Self : Q_Dir'Class)
       return Boolean
   is
   begin
      return Interfaces.C."/=" (QDir_isRoot (Self.Object), 0);
   end Is_Root;

   -------------------
   -- Make_Absolute --
   -------------------

   procedure Make_Absolute
    (Self : in out Q_Dir'Class)
   is
   begin
      QDir_makeAbsolute (Self.Object);
   end Make_Absolute;

   -----------
   -- Mkdir --
   -----------

   function Mkdir
    (Self : not null access Q_Dir'Class;
     Dir_Name : Qt4.Strings.Q_String'Class)
       return Boolean
   is
   begin
      return Interfaces.C."/=" (QDir_mkdir_QStringCR (Self.Object, Qt4.Strings.Internals.QString_View (Dir_Name)), 0);
   end Mkdir;

   ------------
   -- Mkpath --
   ------------

   function Mkpath
    (Self : not null access Q_Dir'Class;
     Dir_Path : Qt4.Strings.Q_String'Class)
       return Boolean
   is
   begin
      return Interfaces.C."/=" (QDir_mkpath_QStringCR (Self.Object, Qt4.Strings.Internals.QString_View (Dir_Path)), 0);
   end Mkpath;

   ------------------
   -- Name_Filters --
   ------------------

   function Name_Filters
    (Self : Q_Dir'Class)
       return Qt4.String_Lists.Q_String_List
   is
   begin
      return Returns : Qt4.String_Lists.Q_String_List do
         QDir_nameFilters (Qt4.String_Lists.Internals.QStringList_View (Returns), Self.Object);
      end return;
   end Name_Filters;

   ----------
   -- Path --
   ----------

   function Path
    (Self : Q_Dir'Class)
       return Qt4.Strings.Q_String
   is
   begin
      return Returns : Qt4.Strings.Q_String do
         QDir_path (Qt4.Strings.Internals.QString_View (Returns), Self.Object);
      end return;
   end Path;

   -------------
   -- Refresh --
   -------------

   procedure Refresh
    (Self : Q_Dir'Class)
   is
   begin
      QDir_refresh (Self.Object);
   end Refresh;

   ------------------------
   -- Relative_File_Path --
   ------------------------

   function Relative_File_Path
    (Self : Q_Dir'Class;
     File_Name : Qt4.Strings.Q_String'Class)
       return Qt4.Strings.Q_String
   is
   begin
      return Returns : Qt4.Strings.Q_String do
         QDir_relativeFilePath_QStringCR (Qt4.Strings.Internals.QString_View (Returns), Self.Object, Qt4.Strings.Internals.QString_View (File_Name));
      end return;
   end Relative_File_Path;

   ------------
   -- Remove --
   ------------

   function Remove
    (Self : not null access Q_Dir'Class;
     File_Name : Qt4.Strings.Q_String'Class)
       return Boolean
   is
   begin
      return Interfaces.C."/=" (QDir_remove_QStringCR (Self.Object, Qt4.Strings.Internals.QString_View (File_Name)), 0);
   end Remove;

   ------------
   -- Rename --
   ------------

   function Rename
    (Self : not null access Q_Dir'Class;
     Old_Name : Qt4.Strings.Q_String'Class;
     New_Name : Qt4.Strings.Q_String'Class)
       return Boolean
   is
   begin
      return Interfaces.C."/=" (QDir_rename_QStringCR_QStringCR (Self.Object, Qt4.Strings.Internals.QString_View (Old_Name), Qt4.Strings.Internals.QString_View (New_Name)), 0);
   end Rename;

   -----------
   -- Rmdir --
   -----------

   function Rmdir
    (Self : not null access Q_Dir'Class;
     Dir_Name : Qt4.Strings.Q_String'Class)
       return Boolean
   is
   begin
      return Interfaces.C."/=" (QDir_rmdir_QStringCR (Self.Object, Qt4.Strings.Internals.QString_View (Dir_Name)), 0);
   end Rmdir;

   ------------
   -- Rmpath --
   ------------

   function Rmpath
    (Self : not null access Q_Dir'Class;
     Dir_Path : Qt4.Strings.Q_String'Class)
       return Boolean
   is
   begin
      return Interfaces.C."/=" (QDir_rmpath_QStringCR (Self.Object, Qt4.Strings.Internals.QString_View (Dir_Path)), 0);
   end Rmpath;

   ----------------
   -- Set_Filter --
   ----------------

   procedure Set_Filter
    (Self : in out Q_Dir'Class;
     Filters : Filter)
   is
   begin
      QDir_setFilter_Filter (Self.Object, Filters);
   end Set_Filter;

   ----------------------
   -- Set_Name_Filters --
   ----------------------

   procedure Set_Name_Filters
    (Self : in out Q_Dir'Class;
     Name_Filters : Qt4.String_Lists.Q_String_List'Class)
   is
   begin
      QDir_setNameFilters_QStringListCR (Self.Object, Qt4.String_Lists.Internals.QStringList_View (Name_Filters));
   end Set_Name_Filters;

   --------------
   -- Set_Path --
   --------------

   procedure Set_Path
    (Self : in out Q_Dir'Class;
     Path : Qt4.Strings.Q_String'Class)
   is
   begin
      QDir_setPath_QStringCR (Self.Object, Qt4.Strings.Internals.QString_View (Path));
   end Set_Path;

   ---------------------
   -- Add_Search_Path --
   ---------------------

   procedure Add_Search_Path
    (Prefix : in Qt4.Strings.Q_String'Class;
     Path : in Qt4.Strings.Q_String'Class)
   is
   begin
      QDir_addSearchPath_QStringCR_QStringCR (Qt4.Strings.Internals.QString_View (Prefix), Qt4.Strings.Internals.QString_View (Path));
   end Add_Search_Path;

   ----------------
   -- Clean_Path --
   ----------------

   function Clean_Path
    (Path : in Qt4.Strings.Q_String'Class)
       return Qt4.Strings.Q_String
   is
   begin
      return Returns : Qt4.Strings.Q_String do
         QDir_cleanPath_QStringCR (Qt4.Strings.Internals.QString_View (Returns), Qt4.Strings.Internals.QString_View (Path));
      end return;
   end Clean_Path;

   -------------
   -- Current --
   -------------

   function Current
     return Q_Dir
   is
   begin
      return Returns : Q_Dir do
         QDir_current (Returns.Object);
      end return;
   end Current;

   ------------------
   -- Current_Path --
   ------------------

   function Current_Path
     return Qt4.Strings.Q_String
   is
   begin
      return Returns : Qt4.Strings.Q_String do
         QDir_currentPath (Qt4.Strings.Internals.QString_View (Returns));
      end return;
   end Current_Path;

   ----------------------------
   -- From_Native_Separators --
   ----------------------------

   function From_Native_Separators
    (Path_Name : in Qt4.Strings.Q_String'Class)
       return Qt4.Strings.Q_String
   is
   begin
      return Returns : Qt4.Strings.Q_String do
         QDir_fromNativeSeparators_QStringCR (Qt4.Strings.Internals.QString_View (Returns), Qt4.Strings.Internals.QString_View (Path_Name));
      end return;
   end From_Native_Separators;

   ----------
   -- Home --
   ----------

   function Home
     return Q_Dir
   is
   begin
      return Returns : Q_Dir do
         QDir_home (Returns.Object);
      end return;
   end Home;

   ---------------
   -- Home_Path --
   ---------------

   function Home_Path
     return Qt4.Strings.Q_String
   is
   begin
      return Returns : Qt4.Strings.Q_String do
         QDir_homePath (Qt4.Strings.Internals.QString_View (Returns));
      end return;
   end Home_Path;

   ----------------------
   -- Is_Absolute_Path --
   ----------------------

   function Is_Absolute_Path
    (Path : in Qt4.Strings.Q_String'Class)
       return Boolean
   is
   begin
      return Interfaces.C."/=" (QDir_isAbsolutePath_QStringCR (Qt4.Strings.Internals.QString_View (Path)), 0);
   end Is_Absolute_Path;

   ----------------------
   -- Is_Relative_Path --
   ----------------------

   function Is_Relative_Path
    (Path : in Qt4.Strings.Q_String'Class)
       return Boolean
   is
   begin
      return Interfaces.C."/=" (QDir_isRelativePath_QStringCR (Qt4.Strings.Internals.QString_View (Path)), 0);
   end Is_Relative_Path;

   -----------
   -- Match --
   -----------

   function Match
    (Filter : in Qt4.Strings.Q_String'Class;
     File_Name : in Qt4.Strings.Q_String'Class)
       return Boolean
   is
   begin
      return Interfaces.C."/=" (QDir_match_QStringCR_QStringCR (Qt4.Strings.Internals.QString_View (Filter), Qt4.Strings.Internals.QString_View (File_Name)), 0);
   end Match;

   -----------
   -- Match --
   -----------

   function Match
    (Filters : in Qt4.String_Lists.Q_String_List'Class;
     File_Name : in Qt4.Strings.Q_String'Class)
       return Boolean
   is
   begin
      return Interfaces.C."/=" (QDir_match_QStringListCR_QStringCR (Qt4.String_Lists.Internals.QStringList_View (Filters), Qt4.Strings.Internals.QString_View (File_Name)), 0);
   end Match;

   ----------
   -- Root --
   ----------

   function Root
     return Q_Dir
   is
   begin
      return Returns : Q_Dir do
         QDir_root (Returns.Object);
      end return;
   end Root;

   ---------------
   -- Root_Path --
   ---------------

   function Root_Path
     return Qt4.Strings.Q_String
   is
   begin
      return Returns : Qt4.Strings.Q_String do
         QDir_rootPath (Qt4.Strings.Internals.QString_View (Returns));
      end return;
   end Root_Path;

   ------------------
   -- Search_Paths --
   ------------------

   function Search_Paths
    (Prefix : in Qt4.Strings.Q_String'Class)
       return Qt4.String_Lists.Q_String_List
   is
   begin
      return Returns : Qt4.String_Lists.Q_String_List do
         QDir_searchPaths_QStringCR (Qt4.String_Lists.Internals.QStringList_View (Returns), Qt4.Strings.Internals.QString_View (Prefix));
      end return;
   end Search_Paths;

   ---------------
   -- Separator --
   ---------------

   function Separator
     return Qt4.Chars.Q_Char
   is
   begin
      return Returns : Qt4.Chars.Q_Char do
         QDir_separator (Qt4.Chars.Internals.QChar_View (Returns));
      end return;
   end Separator;

   -----------------
   -- Set_Current --
   -----------------

   function Set_Current
    (Path : in Qt4.Strings.Q_String'Class)
       return Boolean
   is
   begin
      return Interfaces.C."/=" (QDir_setCurrent_QStringCR (Qt4.Strings.Internals.QString_View (Path)), 0);
   end Set_Current;

   ----------------------
   -- Set_Search_Paths --
   ----------------------

   procedure Set_Search_Paths
    (Prefix : in Qt4.Strings.Q_String'Class;
     Search_Paths : in Qt4.String_Lists.Q_String_List'Class)
   is
   begin
      QDir_setSearchPaths_QStringCR_QStringListCR (Qt4.Strings.Internals.QString_View (Prefix), Qt4.String_Lists.Internals.QStringList_View (Search_Paths));
   end Set_Search_Paths;

   ----------
   -- Temp --
   ----------

   function Temp
     return Q_Dir
   is
   begin
      return Returns : Q_Dir do
         QDir_temp (Returns.Object);
      end return;
   end Temp;

   ---------------
   -- Temp_Path --
   ---------------

   function Temp_Path
     return Qt4.Strings.Q_String
   is
   begin
      return Returns : Qt4.Strings.Q_String do
         QDir_tempPath (Qt4.Strings.Internals.QString_View (Returns));
      end return;
   end Temp_Path;

   --------------------------
   -- To_Native_Separators --
   --------------------------

   function To_Native_Separators
    (Path_Name : in Qt4.Strings.Q_String'Class)
       return Qt4.Strings.Q_String
   is
   begin
      return Returns : Qt4.Strings.Q_String do
         QDir_toNativeSeparators_QStringCR (Qt4.Strings.Internals.QString_View (Returns), Qt4.Strings.Internals.QString_View (Path_Name));
      end return;
   end To_Native_Separators;

   ---------
   -- "=" --
   ---------

   overriding function "="
    (Self : Q_Dir;
     Dir : Q_Dir)
       return Boolean
   is
   begin
      return Interfaces.C."/=" (eq_QDirCR (Self.Object, Dir.Object), 0);
   end "=";

   ---------------
   -- Internals --
   ---------------

   package body Internals is

   ---------------
   -- QDir_View --
   ---------------

      function QDir_View
       (Item : Q_Dir'Class)
          return QDir_Access
      is
      begin
         return Item.Object;
      end QDir_View;

      package QDir_Conversions is
        new Standard.System.Address_To_Access_Conversions
             (QDir);

   --------------------
   -- QDirTo_Pointer --
   --------------------

      function To_Pointer
       (Address : Standard.System.Address)
          return QDir_Access
      is
      begin
         return
           QDir_Access
            (QDir_Conversions.To_Pointer
            (Address));
      end To_Pointer;

   --------------------
   -- QDirTo_Address --
   --------------------

      function To_Address
       (Pointer : QDir_Access)
          return Standard.System.Address
      is
      begin
         return
           QDir_Conversions.To_Address
            (QDir_Conversions.Object_Pointer
              (Pointer));
      end To_Address;

   --------------------
   -- Create_Wrapper --
   --------------------

      function Create_Wrapper
       (Item : Internals.QDir_Access)
          return Q_Dir
      is
      begin
         return Q_Dir'
          (Ada.Finalization.Controlled with
             Object  => Item,
             Wrapper => True,
             others  => <>);
      end Create_Wrapper;

   end Internals;

end Qt4.Dirs;
