Class Dir

java.lang.Object
org.jruby.util.Dir

public class Dir extends Object
This class exists as a counterpart to the dir.c file in MRI source. It contains many methods useful for File matching and Globbing.
  • Field Details

    • DOSISH

      public static final boolean DOSISH
    • CASEFOLD_FILESYSTEM

      public static final boolean CASEFOLD_FILESYSTEM
    • FNM_NOESCAPE

      public static final int FNM_NOESCAPE
      See Also:
    • FNM_PATHNAME

      public static final int FNM_PATHNAME
      See Also:
    • FNM_DOTMATCH

      public static final int FNM_DOTMATCH
      See Also:
    • FNM_CASEFOLD

      public static final int FNM_CASEFOLD
      See Also:
    • FNM_SYSCASE

      public static final int FNM_SYSCASE
    • FNM_NOMATCH

      public static final int FNM_NOMATCH
      See Also:
    • FNM_ERROR

      public static final int FNM_ERROR
      See Also:
    • EMPTY

      public static final byte[] EMPTY
    • SLASH

      public static final byte[] SLASH
    • STAR

      public static final byte[] STAR
    • DOUBLE_STAR

      public static final byte[] DOUBLE_STAR
    • push_pattern

      private static final Dir.GlobFunc<List<ByteList>> push_pattern
    • glob_caller

      private static final Dir.GlobFunc<Dir.GlobArgs> glob_caller
  • Constructor Details

    • Dir

      public Dir()
  • Method Details

    • isdirsep

      private static boolean isdirsep(int c)
    • isdirsep

      private static boolean isdirsep(byte c)
    • rb_path_next

      private static int rb_path_next(byte[] _s, int s, int send)
    • fnmatch

      public static int fnmatch(byte[] bytes, int pstart, int pend, byte[] string, int sstart, int send, int flags)
    • fnmatch

      public static int fnmatch(byte[] bytes, int pstart, int pend, byte[] string, int sstart, int send, int flags, org.jcodings.Encoding enc)
    • isDoubleStarAndSlash

      private static boolean isDoubleStarAndSlash(byte[] bytes, int pos)
    • nextSlashIndex

      private static int nextSlashIndex(byte[] bytes, int start, int end)
    • push_glob

      public static List<ByteList> push_glob(Ruby runtime, String cwd, ByteList globByteList, int flags)
    • push_braces

      private static int push_braces(Ruby runtime, String cwd, List<ByteList> result, Dir.GlobPattern pattern)
    • push_globs

      private static int push_globs(Ruby runtime, String cwd, List<ByteList> ary, ByteList pattern, int flags)
    • braces

      public static ArrayList<String> braces(String pattern, int flags, ArrayList<String> patterns)
    • has_magic

      private static boolean has_magic(byte[] bytes, int begin, int end, int flags)
    • remove_backslashes

      private static int remove_backslashes(byte[] bytes, int index, int end)
    • indexOf

      private static int indexOf(byte[] bytes, int begin, int end, byte ch)
    • extract_path

      private static byte[] extract_path(byte[] bytes, int begin, int end)
    • extract_elem

      private static byte[] extract_elem(byte[] bytes, int begin, int end)
    • beginsWithDriveLetter

      private static boolean beginsWithDriveLetter(byte[] path, int begin, int end)
    • isRoot

      private static boolean isRoot(byte[] base)
    • isAbsolutePath

      private static boolean isAbsolutePath(byte[] path, int begin, int length)
    • files

      private static String[] files(FileResource directory)
    • isSpecialFile

      private static boolean isSpecialFile(String name)
    • addToResultIfExists

      private static int addToResultIfExists(Ruby runtime, String cwd, byte[] bytes, int begin, int end, org.jcodings.Encoding enc, int flags, Dir.GlobFunc<Dir.GlobArgs> func, Dir.GlobArgs arg)
    • glob_helper

      private static int glob_helper(Ruby runtime, String cwd, ByteList path, int sub, int flags, Dir.GlobFunc<Dir.GlobArgs> func, Dir.GlobArgs arg)
    • glob_helper

      private static int glob_helper(Ruby runtime, String cwd, byte[] path, int begin, int end, org.jcodings.Encoding enc, int sub, int flags, Dir.GlobFunc<Dir.GlobArgs> func, Dir.GlobArgs arg)
    • getBytesInUTF8

      private static byte[] getBytesInUTF8(String str)
    • range

      @Deprecated public static int range(byte[] _pat, int pat, int pend, char test, int flags)
      Deprecated.
      No replacement; not intended to be made public