Package org.jruby.util
Class Dir
java.lang.Object
org.jruby.util.Dir
This class exists as a counterpart to the dir.c file in
MRI source. It contains many methods useful for
File matching and Globbing.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final class(package private) static classprivate static classprivate static interfaceprivate static class -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final booleanstatic final booleanstatic final byte[]static final byte[]static final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intprivate static final Dir.GlobFunc<Dir.GlobArgs>private static final Dir.GlobFunc<List<ByteList>>static final byte[]static final byte[] -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static intaddToResultIfExists(Ruby runtime, String cwd, byte[] bytes, int begin, int end, org.jcodings.Encoding enc, int flags, Dir.GlobFunc<Dir.GlobArgs> func, Dir.GlobArgs arg) private static booleanbeginsWithDriveLetter(byte[] path, int begin, int end) private static byte[]extract_elem(byte[] bytes, int begin, int end) private static byte[]extract_path(byte[] bytes, int begin, int end) private static String[]files(FileResource directory) static intfnmatch(byte[] bytes, int pstart, int pend, byte[] string, int sstart, int send, int flags) static intfnmatch(byte[] bytes, int pstart, int pend, byte[] string, int sstart, int send, int flags, org.jcodings.Encoding enc) private static byte[]getBytesInUTF8(String str) private static intglob_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) private static intglob_helper(Ruby runtime, String cwd, ByteList path, int sub, int flags, Dir.GlobFunc<Dir.GlobArgs> func, Dir.GlobArgs arg) private static booleanhas_magic(byte[] bytes, int begin, int end, int flags) private static intindexOf(byte[] bytes, int begin, int end, byte ch) private static booleanisAbsolutePath(byte[] path, int begin, int length) private static booleanisdirsep(byte c) private static booleanisdirsep(int c) private static booleanisDoubleStarAndSlash(byte[] bytes, int pos) private static booleanisRoot(byte[] base) private static booleanisSpecialFile(String name) private static intnextSlashIndex(byte[] bytes, int start, int end) private static intpush_braces(Ruby runtime, String cwd, List<ByteList> result, Dir.GlobPattern pattern) private static intstatic intrange(byte[] _pat, int pat, int pend, char test, int flags) Deprecated.No replacement; not intended to be made publicprivate static intrb_path_next(byte[] _s, int s, int send) private static intremove_backslashes(byte[] bytes, int index, int end)
-
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
-
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
-
push_braces
private static int push_braces(Ruby runtime, String cwd, List<ByteList> result, Dir.GlobPattern pattern) -
push_globs
-
braces
-
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
-
isSpecialFile
-
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
-
range
Deprecated.No replacement; not intended to be made public
-