The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

Name

SPVM::Builder::Config::Info - Config Information

Description

The SPVM::Builder::Config::Info class has methods to manipulate config information.

Usage

my $config_info = SPVM::Builder::Config::Info->new(class_name => "Foo");

Class Methods

new

my $config_info = SPVM::Builder::Config::Info->new(%options);

Creates an SPVM::Builder::Config::Info object given the class name $class_name and returns it.

The class specified by $class_name and classes loaded by the class are compiled and the runtime is generated.

The class_name option must be defined.

Options:

  • class_name

    A class name.

Exceptions:

The "class_name" option must be defined. Otherwise, an exception is thrown.

Instance Methods

get_class_names

my $class_names = $config_info->get_class_names;

Returns the all class and interface names except for anon classes and classes generated by anon methods loaded by the runtime.

has_config_file

my $has_config_file = $config_info->has_config_file($class_name);

If the class given by the class name has a config file, returns 1, otherwise returns 0.

Exceptions:

The class name $class_name must be defined. Otherwise, an exception is thrown.

is_resource_loader

my $is_resource_loader = $config_info->is_resource_loader($class_name);

If the class given by the class name $class_name is a class that load resources, returns 1, otherwise returns 0.

Exceptions:

The class name $class_name must be defined. Otherwise, an exception is thrown.

get_config_file

my $config_file = $config_info->get_config_file($class_name);

Returns the file path of the config for the class given by the class name $class_name.

Exceptions:

The class name $class_name must be defined. Otherwise, an exception is thrown.

The config file for the class "%s" is not found. Otherwise, an exception is thrown.

get_config_content

my $config_content = $config_info->get_config_content($class_name);

Returns the content of the config for the class given by the class name $class_name.

Exceptions:

Exceptions thrown by "get_config_file" method could be thrown.

get_config

my $config = $config_info->get_config($class_name);

Returns a config object for the class given by the class name $class_name.

Exceptions:

Exceptions thrown by "get_config_file" method could be thrown.

Copyright & License

Copyright (c) 2023 Yuki Kimoto

MIT License