# Copyright (c) 2023 Yuki Kimoto
# MIT License

class File::Spec {
  version "0.090";
  
  use File::Spec::Instance;
  
  our $SINGLETON : File::Spec::Instance;
  
  INIT {
    $SINGLETON = File::Spec::Instance->new;
  }
  
  # Class Methods
  static method canonpath : string ($path : string) {
    return $SINGLETON->canonpath($path);
  }
  
  static method catdir : string ($parts : string[]) {
    return $SINGLETON->catdir($parts);
  }
  
  static method catfile : string ($parts : string[]) {
    return $SINGLETON->catfile($parts);
  }
  
  static method curdir : string () {
    return $SINGLETON->curdir;
  }
  
  static method devnull : string () {
    return $SINGLETON->devnull;
  }
  
  static method rootdir : string () {
    return $SINGLETON->rootdir;
  }
  
  static method tmpdir : string () {
    return $SINGLETON->tmpdir;
  }
  
  static method updir : string () {
    return $SINGLETON->updir;
  }
  
  static method no_upwards : string[] ($parts : string[]) {
    return $SINGLETON->no_upwards($parts);
  }
  
  static method file_name_is_absolute : int ($path : string) {
    return $SINGLETON->file_name_is_absolute($path);
  }
  
  static method path : string[] () {
    return $SINGLETON->path;
  }
  
  static method join : string ($parts : string[]) {
    return $SINGLETON->join($parts);
  }
  
  static method splitpath : string[] ($path : string, $no_file : int = 0) {
    return $SINGLETON->splitpath($path, $no_file);
  }
  
  static method splitdir : string[] ($path : string) {
    return $SINGLETON->splitdir($path);
  }
   
  static method catpath : string ($volume : string, $dir : string, $file : string) {
    return $SINGLETON->catpath($volume, $dir, $file);
  }
  
  static method abs2rel : string ($path : string, $base : string = undef) {
    return $SINGLETON->abs2rel($path, $base);
  }
  
  static method rel2abs : string ($path : string, $base : string = undef) {
    return $SINGLETON->rel2abs($path, $base);
  }
}