Package db2000.J.eXtrafunctions
Class fINI
- java.lang.Object
-
- db2000.J.eXtrafunctions.fINI
-
public class fINI extends Object
functions to manage INI Files
-
-
Field Summary
Fields Modifier and Type Field Description static Stringm_CommentStartMarkerstatic Stringm_FileNamestatic booleanm_KeysToUpperCasestatic Stringm_LineSeparator
-
Constructor Summary
Constructors Constructor Description fINI()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringGetCommentStartMarker()returns the start-marker character used in commentsstatic StringGetDateFormat()get the date format returns the DateFormat valuestatic StringGetFileName()get the INI file name being used returns the INI file namestatic booleanGetKeysToUpperCase()get the uppercase status assigned to key names returns uppercase statusstatic StringGetLineSeparator()returns the line separator currently in usestatic StringGetTimestampFormat()get the timestamp format returns the TimestampFormat valuestatic BooleanrdBoolean(String SectionName, String KeyName, Boolean DefaultValue)returns the boolean value assigned to the specific section and keystatic DaterdDate(String SectionName, String KeyName, Date DefaultValue)returns the date value assigned to the specific section and keystatic DoublerdDouble(String SectionName, String KeyName, Double DefaultValue)returns the double value assigned to the specific section and keystatic intrdInteger(String SectionName, String KeyName, int DefaultValue)returns the integer value assigned to the specific section and keystatic String[]rdKeyNames(String SectionName)returns a string array containing the names of all the keys under specified sectionstatic Map<String,db2000.J.eXtrafunctions.fINI.INIKey>rdKeys(String SectionName)returns a map containing all the keys under specified sectionstatic LongrdLong(String SectionName, String KeyName, Long DefaultValue)returns the long value assigned to the specific section and keystatic intrdNumberSections()returns the number of sections in INI filestatic db2000.J.eXtrafunctions.fINI.INISectionrdSection(String SectionName)returns the named section or null if named section does not existsstatic String[]rdSectionNames()returns a string array containing the names of all sections in INI filestatic StringrdString(String SectionName, String KeyName, String DefaultValue)returns the string value assigned to the specific section and keystatic DaterdTimestamp(String SectionName, String KeyName, Date DefaultValue)returns the timestamp value assigned to the specific section and keystatic voidrmKey(String SectionName, String KeyName)remove the specified key from the specified sectionstatic voidrmSection(String SectionName)remove the specified sectionstatic voidSetCommentStartMarker(String xStartMarker)set the row start-marker character for commentsstatic voidSetDateFormat(String DateFormat)set the date formatstatic voidSetFileName(String FileName)set the INI file to usestatic voidSetKeysToUpperCase(boolean UpperCase)set key names to uppercasestatic voidSetLineSeparator(String xLineSeparator)set line separatorstatic voidSetTimestampFormat(String TimestampFormat)set the timestamp formatstatic booleanUpDate()update the INI file, if the INI file does not exist it is createdstatic voidwrBoolean(String SectionName, String KeyName, boolean BooleanValue, String Comments)write the boolean value to the specific section and keystatic voidwrDate(String SectionName, String KeyName, Date DateValue, String Comments)write the date value to the specific section and keystatic voidwrDouble(String SectionName, String KeyName, double DoubleValue, String Comments)write the double value to the specific section and keystatic voidwrInteger(String SectionName, String KeyName, int IntegerValue, String Comments)write the integer value to the specific section and keystatic voidwrLong(String SectionName, String KeyName, long LongValue, String Comments)write the long value to the specific section and keystatic voidwrNewSection(String SectionName, String Comments)writes a new sectionstatic voidwrSection(String SectionName, String Comments)write/update a comments associated with a section (if the section does not exist will be created)static voidwrString(String SectionName, String KeyName, String StringValue, String Comments)write the string value to the specific section and keystatic voidwrTimestamp(String SectionName, String KeyName, Timestamp TimestampValue, String Comments)write the timestamp value to the specific section and key
-
-
-
Method Detail
-
SetDateFormat
public static void SetDateFormat(String DateFormat)
set the date format- Parameters:
DateFormat- the format string, if date format is not valid assumes by default "yyyy-MM-dd"
-
SetFileName
public static void SetFileName(String FileName)
set the INI file to use- Parameters:
FileName- the full path and name of the INI file
-
SetCommentStartMarker
public static void SetCommentStartMarker(String xStartMarker)
set the row start-marker character for comments- Parameters:
xStartMarker- = "#" (default) or ";", other characters are not allowed!
-
SetLineSeparator
public static void SetLineSeparator(String xLineSeparator)
set line separator- Parameters:
xLineSeparator- = "\r", "\n", "\r\n\", Chr(13), Chr(10), Chr(13) + Chr(10), or other... (default will be the line separator used by the operating system)
-
SetKeysToUpperCase
public static void SetKeysToUpperCase(boolean UpperCase)
set key names to uppercase- Parameters:
UpperCase- = 'True' (default) sets key names to uppercase, = 'False' no changes
-
SetTimestampFormat
public static void SetTimestampFormat(String TimestampFormat)
set the timestamp format- Parameters:
TimestampFormat- the format string, if timestamp format is not valid assumes by default "yyyy-MM-dd"
-
GetDateFormat
public static String GetDateFormat()
get the date format returns the DateFormat value
-
GetFileName
public static String GetFileName()
get the INI file name being used returns the INI file name
-
GetCommentStartMarker
public static String GetCommentStartMarker()
returns the start-marker character used in comments
-
GetLineSeparator
public static String GetLineSeparator()
returns the line separator currently in use
-
GetKeysToUpperCase
public static boolean GetKeysToUpperCase()
get the uppercase status assigned to key names returns uppercase status
-
GetTimestampFormat
public static String GetTimestampFormat()
get the timestamp format returns the TimestampFormat value
-
rdBoolean
public static Boolean rdBoolean(String SectionName, String KeyName, Boolean DefaultValue)
returns the boolean value assigned to the specific section and key- Parameters:
SectionName- the section nameKeyName- the key nameDefaultValue- the default value assigned is returned if the parameters are missing or not to find the key
-
rdDate
public static Date rdDate(String SectionName, String KeyName, Date DefaultValue)
returns the date value assigned to the specific section and key- Parameters:
SectionName- the section nameKeyName- the key nameDefaultValue- the default value assigned is returned if the parameters are missing or not to find the key
-
rdDouble
public static Double rdDouble(String SectionName, String KeyName, Double DefaultValue)
returns the double value assigned to the specific section and key- Parameters:
SectionName- the section nameKeyName- the key nameDefaultValue- the default value assigned is returned if the parameters are missing or not to find the key
-
rdInteger
public static int rdInteger(String SectionName, String KeyName, int DefaultValue)
returns the integer value assigned to the specific section and key- Parameters:
SectionName- the section nameKeyName- the key nameDefaultValue- the default value assigned is returned if the parameters are missing or not to find the key
-
rdLong
public static Long rdLong(String SectionName, String KeyName, Long DefaultValue)
returns the long value assigned to the specific section and key- Parameters:
SectionName- the section nameKeyName- the key nameDefaultValue- the default value assigned is returned if the parameters are missing or not to find the key
-
rdSection
public static db2000.J.eXtrafunctions.fINI.INISection rdSection(String SectionName)
returns the named section or null if named section does not exists- Parameters:
SectionName- the section name to be searched
-
rdString
public static String rdString(String SectionName, String KeyName, String DefaultValue)
returns the string value assigned to the specific section and key- Parameters:
SectionName- the section nameKeyName- the key nameDefaultValue- the default value assigned is returned if the parameters are missing or not to find the key
-
rdTimestamp
public static Date rdTimestamp(String SectionName, String KeyName, Date DefaultValue)
returns the timestamp value assigned to the specific section and key- Parameters:
SectionName- the section nameKeyName- the key nameDefaultValue- the default value assigned is returned if the parameters are missing or not to find the key
-
wrBoolean
public static void wrBoolean(String SectionName, String KeyName, boolean BooleanValue, String Comments)
write the boolean value to the specific section and key- Parameters:
SectionName- the section nameKeyName- the key namebooleanValue- the boolean valueComments- the comments
-
wrDate
public static void wrDate(String SectionName, String KeyName, Date DateValue, String Comments)
write the date value to the specific section and key- Parameters:
SectionName- the section nameKeyName- the key nameDateValue- the date valueComments- the comments
-
wrDouble
public static void wrDouble(String SectionName, String KeyName, double DoubleValue, String Comments)
write the double value to the specific section and key- Parameters:
SectionName- the section nameKeyName- the key nameDoubleValue- the double valueComments- the comments
-
wrInteger
public static void wrInteger(String SectionName, String KeyName, int IntegerValue, String Comments)
write the integer value to the specific section and key- Parameters:
SectionName- the section nameKeyName- the key nameIntegerValue- the integer valueComments- the comments
-
wrLong
public static void wrLong(String SectionName, String KeyName, long LongValue, String Comments)
write the long value to the specific section and key- Parameters:
SectionName- the section nameKeyName- the key nameLongValue- the long valueComments- the comments
-
wrNewSection
public static void wrNewSection(String SectionName, String Comments)
writes a new section- Parameters:
SectionName- the section nameComments- the comments
-
wrSection
public static void wrSection(String SectionName, String Comments)
write/update a comments associated with a section (if the section does not exist will be created)- Parameters:
SectionName- the section nameComments- the comments
-
wrString
public static void wrString(String SectionName, String KeyName, String StringValue, String Comments)
write the string value to the specific section and key- Parameters:
SectionName- the section nameKeyName- the key nameStringValue- the string valueComments- the comments
-
wrTimestamp
public static void wrTimestamp(String SectionName, String KeyName, Timestamp TimestampValue, String Comments)
write the timestamp value to the specific section and key- Parameters:
SectionName- the section nameKeyName- the key nameTimestampValue- the timestamp valueComments- the comments
-
UpDate
public static boolean UpDate()
update the INI file, if the INI file does not exist it is created
-
rmKey
public static void rmKey(String SectionName, String KeyName)
remove the specified key from the specified section- Parameters:
SectionName- the section nameKeyName- the key name
-
rmSection
public static void rmSection(String SectionName)
remove the specified section- Parameters:
SectionName- the section name
-
rdNumberSections
public static int rdNumberSections()
returns the number of sections in INI file
-
rdSectionNames
public static String[] rdSectionNames()
returns a string array containing the names of all sections in INI file
-
rdKeyNames
public static String[] rdKeyNames(String SectionName)
returns a string array containing the names of all the keys under specified section- Parameters:
SectionName- the name of the section for which names of properties is to be retrieved
-
-