Rddc_txt_file (Class)

In: rddc_text_file.rb
Parent: Object

Class that will parse a config file and provide Methods to access the information.

Author:Hartwig Brandl
Copyright:Hartwig Brandl 2004
License:GPL2

Methods

[]   []=   dirname   get_array   get_hash   get_option   has_key?   new   set_file   set_option   to_a   to_hash   to_s   valid?   write  

Constants

Rddc_url = "http://rddc.sourceforge.net/config/"
  Where should I download missing config files?
Debug = 0
  Debug = 0 - no debug output; 1 - debug output; 2 - lots of output

Public Class methods

Public Instance methods

return the value found under the specified key

set the specified key with the specified value

warning: this will only set the hash. if you use to_a you won’t see the changes. all other methods should work.

return the directory in which the file is located

deprecated use to_a

deprecated use to_hash

deprecated use []

same as Hash#has_key?

Returns true if the given key is present in hash.

Set the path of the config file. You may use this method to copy a file. (Although there are better ways for doing this.)

return:none

depracted use []=

return the contents of the config file as an array.

example:

config file: foo=hugo bar=otto

returns: [[[foo][hugo]][[bar][otto]]]

return the contents of the config file as a hash.

return the config file as a string.

contents of each line sepearted by ;

Was the parsing of the config file successful?

return:boolean

write the values to the config file.

[Validate]