Name
SPVM::File::Spec::Instance - Object-Oriented Version of File::Spec class
Description
File::Spec::Instance class in SPVM is the object-oriented version of File::Spec class.
Details
This class is an abstract class. The object of this class cannot be created.
Usage
use File::Spec::Instance;
my $spec = File::Spec::Instance->new;
my $file = $spec->catfile(["foo", "bar", "a.txt"]);
Class Methods
static method new : File::Spec::Instance ();
Create a new object of a child class of File::Spec::Instance class, and returns it.
If Sys::OS#is_windows method returns a true value, creates a File::Spec::Instance::Win32 object.
Otherwise, creates a File::Spec::Instance::Unix object.
Instance Methods
canonpath
static method canonpath : string ($path : string);
For case Unix-like OSs, see File::Spec::Instance::Unix#canonpath method.
For case Windows, see File::Spec::Instance::Win32#canonpath method.
catdir
static method catdir : string ($parts : string[]);
For case Unix-like OSs, see File::Spec::Instance::Unix#catdir method.
For case Windows, see File::Spec::Instance::Win32#catdir method.
catfile
static method catfile : string ($parts : string[]);
For case Unix-like OSs, see File::Spec::Instance::Unix#catfile method.
For case Windows, see File::Spec::Instance::Win32#catfile method.
curdir
static method curdir : string ();
For case Unix-like OSs, see File::Spec::Instance::Unix#curdir method.
For case Windows, see File::Spec::Instance::Win32#curdir method.
devnull
static method devnull : string ();
For case Unix-like OSs, see File::Spec::Instance::Unix#devnull method.
For case Windows, see File::Spec::Instance::Win32#devnull method.
rootdir
static method rootdir : string ();
For case Unix-like OSs, see File::Spec::Instance::Unix#rootdir method.
For case Windows, see File::Spec::Instance::Win32#rootdir method.
tmpdir
static method tmpdir : string ();
For case Unix-like OSs, see File::Spec::Instance::Unix#tmpdir method.
For case Windows, see File::Spec::Instance::Win32#tmpdir method.
updir
static method updir : string ();
For case Unix-like OSs, see File::Spec::Instance::Unix#updir method.
For case Windows, see File::Spec::Instance::Win32#updir method.
no_upwards
static method no_upwards : string[] ($parts : string[]);
For case Unix-like OSs, see File::Spec::Instance::Unix#updir method.
For case Windows, see File::Spec::Instance::Win32#updir method.
file_name_is_absolute
static method file_name_is_absolute : int ($path : string);
For case Unix-like OSs, see File::Spec::Instance::Unix#file_name_is_absolute method.
For case Windows, see File::Spec::Instance::Win32#file_name_is_absolute method.
path
static method path : string[] ();
For case Unix-like OSs, see File::Spec::Instance::Unix#path method.
For case Windows, see File::Spec::Instance::Win32#path method.
join
static method join : string ($parts : string[]);
For case Unix-like OSs, see File::Spec::Instance::Unix#join method.
For case Windows, see File::Spec::Instance::Win32#join method.
splitpath
static method splitpath : string[] ($path : string, $no_file : int = 0);
For case Unix-like OSs, see File::Spec::Instance::Unix#splitpath method.
For case Windows, see File::Spec::Instance::Win32#splitpath method.
splitdir
static method splitdir : string[] ($path : string);
For case Unix-like OSs, see File::Spec::Instance::Unix#splitdir method.
For case Windows, see File::Spec::Instance::Win32#splitdir method.
catpath
static method catpath : string ($volume : string, $dir : string, $file : string);
For case Unix-like OSs, see File::Spec::Instance::Unix#catpath method.
For case Windows, see File::Spec::Instance::Win32#catpath method.
abs2rel
static method abs2rel : string ($path : string, $base : string = undef);
For case Unix-like OSs, see File::Spec::Instance::Unix#abs2rel method.
For case Windows, see File::Spec::Instance::Win32#abs2rel method.
rel2abs
static method rel2abs : string ($path : string, $base : string = undef);
For case Unix-like OSs, see File::Spec::Instance::Unix#rel2abs method.
For case Windows, see File::Spec::Instance::Win32#rel2abs method.
Well Known Child Classes
Copyright & License
Copyright (c) 2023 Yuki Kimoto
MIT License