Mercurial > octave
diff libinterp/corefcn/load-path.h @ 28953:dff830c84726
Add function "dir_encoding" to set a file encoding per directory (bug #49685).
* corefcn/load-path.h (load_path::read_dir_config): Add new function.
* corefcn/load-path.cc (load_path::read_dir_config): Add new function.
(load_path::add): Call read_dir_config on adding a new directory to the load
path.
* corefcn/input.h (input_system::dir_encoding, input_system::set_dir_encoding):
Add new functions. Add private unordered_map "m_dir_encoding".
* corefcn/input.cc (input_system::dir_encoding, input_system::set_dir_encoding):
Add new functions.
(base_reader, file_reader, input_reader): Add new constructors that accept an
encoding (use mfile_encoding by default). Add private property "m_encoding".
(load_path_dir): Static function to get the part of the directory that would
be added to the load path.
(Fdir_encoding): New function.
* corefcn/interpreter.cc (interpreter::chdir): Call load_path::read_dir_config.
* parse-tree/lex.h (lexer): Add new constructor that accepts an encoding.
* parse-tree/parse.h (parser): Add new constructor that accepts an encoding.
* parse-tree/oct-parse.yy (parse_fcn_file): Pass dir_encoding to parser.
* doc/interpreter/func.txi: Add docstring of function "dir_encoding" to manual.
author | Markus Mützel <markus.muetzel@gmx.de> |
---|---|
date | Fri, 18 Sep 2020 17:15:32 +0200 |
parents | 262cdfc6faf9 |
children | 7854d5752dd2 |
line wrap: on
line diff
--- a/libinterp/corefcn/load-path.h Sat Oct 17 02:13:39 2020 -0700 +++ b/libinterp/corefcn/load-path.h Fri Sep 18 17:15:32 2020 +0200 @@ -191,6 +191,8 @@ remove_hook = f; } + void read_dir_config (const std::string& dir) const; + void execute_pkg_add (const std::string& dir); void execute_pkg_del (const std::string& dir);