我有以下代码片段
with GNAT.Command_Line; use GNAT.Command_Line;
with GNAT.Strings; use GNAT.Strings;
....
Define_Switch
(Config => Config, Output => File_Name'Access,
Long_Switch => "--file=", Switch => "-f=",
Help => "File with Composition");
....
Getopt
Run Code Online (Sandbox Code Playgroud)
通过 Getopt 解析命令行后,我可以访问指向实际文件名的对象,我想将此名称复制到定义为的 Ada.String.Fixed 字符串
File_Name : String(1 .. 256);
Run Code Online (Sandbox Code Playgroud)
我可以从 File_Name'Access 打印到控制台数据
Put_Line(File_Name.all);
Run Code Online (Sandbox Code Playgroud)
我想我应该提供诸如复制操作之类的东西,然后自由访问对象。我该怎么做?
谢谢。亚历克斯