org.csource.common
Class IniFileReader

java.lang.Object
  extended by org.csource.common.IniFileReader

public class IniFileReader
extends java.lang.Object

ini file reader / parser

Version:
Version 1.0
Author:
Happy Fish / YuQing

Constructor Summary
IniFileReader(java.lang.String conf_filename)
           
 
Method Summary
 boolean getBoolValue(java.lang.String name, boolean default_value)
          get boolean value from config file
 java.lang.String getConfFilename()
          get the config filename
 int getIntValue(java.lang.String name, int default_value)
          get int value from config file
 java.lang.String getStrValue(java.lang.String name)
          get string value from config file
 java.lang.String[] getValues(java.lang.String name)
          get all values from config file
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IniFileReader

public IniFileReader(java.lang.String conf_filename)
              throws java.io.FileNotFoundException,
                     java.io.IOException
Parameters:
conf_filename - config filename
Throws:
java.io.FileNotFoundException
java.io.IOException
Method Detail

getConfFilename

public java.lang.String getConfFilename()
get the config filename

Returns:
config filename

getStrValue

public java.lang.String getStrValue(java.lang.String name)
get string value from config file

Parameters:
name - item name in config file
Returns:
string value

getIntValue

public int getIntValue(java.lang.String name,
                       int default_value)
get int value from config file

Parameters:
name - item name in config file
default_value - the default value
Returns:
int value

getBoolValue

public boolean getBoolValue(java.lang.String name,
                            boolean default_value)
get boolean value from config file

Parameters:
name - item name in config file
default_value - the default value
Returns:
boolean value

getValues

public java.lang.String[] getValues(java.lang.String name)
get all values from config file

Parameters:
name - item name in config file
Returns:
string values (array)