Differences

This shows you the differences between two versions of the page.

Link to this comparison view

simple_configuration_file_reader_-_using_a_generic [2012/01/02 21:46]
thomaslocke [The Program]
simple_configuration_file_reader_-_using_a_generic [2012/04/15 07:03] (current)
thomaslocke [src/config_file_parser.adb]
Line 27: Line 27:
 **config_one.ini** **config_one.ini**
 <​code>​ <​code>​
-  - This is a comment. +This is a comment. 
--- This is also a comment. ​Both and -- are valid for comments.+-- This is also a comment. 
 +; And a third comment. Lines starting with #-- and ; are treated as comments.
  
-  - This config file only changes the Foo_Boolean parameter. For the remaining +#  ​This config file only changes the Foo_Boolean parameter. For the remaining 
-  ​parameters, the default values are used.+ ​parameters,​ the default values are used.
 Foo_Boolean True Foo_Boolean True
 </​code>​ </​code>​
Line 39: Line 40:
 **config_two.ini** **config_two.ini**
 <​code>​ <​code>​
-  - This is a comment. +This is a comment. 
--- This is also a comment. ​Both and -- are valid for comments.+-- This is also a comment. 
 +; And a third comment. Lines starting with #-- and ; are treated as comments.
  
-  - This config file only changes the Foo_Boolean parameter. For the remaining +#  ​This config file only changes the Foo_Boolean parameter. For the remaining 
-  ​parameters, the default values are used.+ ​parameters,​ the default values are used.
 Foo_Boolean True Foo_Boolean True
 </​code>​ </​code>​
Line 85: Line 87:
    ​package Ide is    ​package Ide is
  
-      for Compiler_Command ("​ada"​) use "/​usr/​gnat/​bin/​gnatmake";​+      for Compiler_Command ("​ada"​) use "​gnatmake";​
  
    end Ide;    end Ide;
Line 496: Line 498:
             if Line /= ""​             if Line /= ""​
               and then Line (1 .. 1) /= "#"​               and then Line (1 .. 1) /= "#"​
 +              and then Line (1 .. 1) /= ";"​
               and then Line (1 .. 2) /= "​--"​ then               and then Line (1 .. 2) /= "​--"​ then
                ​-- ​ Note that if a valid key is found in the file, and it has no                ​-- ​ Note that if a valid key is found in the file, and it has no

Navigation