NAME

Math::Formula::Config - load/save formulas to file

INHERITANCE

Math::Formula::Config is extended by
  Math::Formula::Config::INI
  Math::Formula::Config::JSON
  Math::Formula::Config::YAML

SYNOPSIS

my $saver = Math::Formula::Config::YAML->new(directory => $dir);
$saver->save($context);

DESCRIPTION

The extensions of this module can be used to export and import sets of expressions to and from a program.

The following serialization formats are supported:

At the moment, loading is not generally supported: it produces only satisfactory results for INI, but improvements are under way. That implementation will certainly impact the output format. The current version is ment for studying.

METHODS

Constructors

Math::Formula::Config->new(%options)
-Option   --Default
 directory  <required>
directory => DIRECTORY

In this directory, the output files will be made. For each context (fragment), a separate file is made.

Attributes

$obj->directory()

When the configuration files will be written, and are read.

$obj->path_for($file)

Constructs a filename, based on the configured directory(), the context's name, and the usual filename extensions.

Actions

$obj->load($name, %options)

Load a Math::Formula::Context for an ini file.

-Option  --Default
 filename  <directory/$name.ini>
filename => FILENAME
$obj->save($context, %args)

Serialize the $context into a file as storage or to be editted by hand. This is a usefull method when default configuration templates need to be generated.

SEE ALSO

This module is part of Math-Formula distribution version 0.15, built on March 06, 2023. Website: http://perl.overmeer.net/CPAN/

LICENSE

Copyrights 2023 by [Mark Overmeer <markov@cpan.org>]. For other contributors see ChangeLog.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See http://dev.perl.org/licenses/