summaryrefslogtreecommitdiff
path: root/qadevOOo/runner/convwatch/IniFile.java
diff options
context:
space:
mode:
Diffstat (limited to 'qadevOOo/runner/convwatch/IniFile.java')
-rw-r--r--qadevOOo/runner/convwatch/IniFile.java54
1 files changed, 27 insertions, 27 deletions
diff --git a/qadevOOo/runner/convwatch/IniFile.java b/qadevOOo/runner/convwatch/IniFile.java
index fbcaaea0b33b..b41eac2fdb12 100644
--- a/qadevOOo/runner/convwatch/IniFile.java
+++ b/qadevOOo/runner/convwatch/IniFile.java
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -95,7 +95,7 @@ class IniFile
}
try
{
- aReader.close();
+ aReader.close();
}
catch (java.io.IOException ie)
{
@@ -115,18 +115,18 @@ class IniFile
}
// -----------------------------------------------------------------------------
-
+
boolean isRemark(String _sLine)
{
if ( ((_sLine.length() < 2) ) ||
- ( _sLine.startsWith("#")) ||
+ ( _sLine.startsWith("#")) ||
( _sLine.startsWith(";")) )
{
return true;
}
return false;
}
-
+
String getItem(int i)
{
return (String)m_aList.get(i);
@@ -141,7 +141,7 @@ class IniFile
{
return _sName.toLowerCase();
}
-
+
// return the number where this section starts
int findSection(String _sSection)
{
@@ -167,7 +167,7 @@ class IniFile
}
return -1;
}
-
+
// return the line number, where the key is found.
int findKey(String _sSection, String _sKey)
{
@@ -179,7 +179,7 @@ class IniFile
}
return findKeyFromKnownSection(i, _sKey);
}
-
+
// i must be the index in the list, where the well known section starts
int findKeyFromKnownSection(int _nSectionIndex, String _sKey)
{
@@ -187,18 +187,18 @@ class IniFile
for (int j=_nSectionIndex + 1; j<m_aList.size();j++)
{
String sLine = getItem(j).trim();
-
+
if (isRemark(sLine))
{
continue;
}
-
+
if (sLine.startsWith("[") /* && sLine.endsWith("]") */)
{
// found end.
break;
}
-
+
int nEqual = sLine.indexOf("=");
if (nEqual >= 0)
{
@@ -211,7 +211,7 @@ class IniFile
}
return -1;
}
-
+
// i must be the index in the list, where the well known section starts
int findLastKnownKeyIndex(int _nSectionIndex, String _sKey)
{
@@ -220,7 +220,7 @@ class IniFile
for (int j=i; j<m_aList.size();j++)
{
String sLine = getItem(j).trim();
-
+
if (isRemark(sLine))
{
continue;
@@ -231,7 +231,7 @@ class IniFile
// found end.
return j;
}
-
+
int nEqual = sLine.indexOf("=");
if (nEqual >= 0)
{
@@ -244,7 +244,7 @@ class IniFile
}
return i;
}
-
+
String getValue(int _nIndex)
{
String sLine = getItem(_nIndex).trim();
@@ -263,9 +263,9 @@ class IniFile
}
/**
- @param _sSection string
+ @param _sSection string
@param _sKey string
- @return the value found in the inifile which is given by the section and key parameter
+ @return the value found in the inifile which is given by the section and key parameter
*/
public String getValue(String _sSection, String _sKey)
{
@@ -278,21 +278,21 @@ class IniFile
}
sValue = getValue(i);
-
+
return sValue;
}
/**
write back the ini file to the disk, only if there exist changes
*/
- public void store()
+ public void store()
{
if (m_bListContainUnsavedChanges == false)
{
// nothing has changed, so no need to store
return;
}
-
+
File aFile = new File(m_sFilename);
if (aFile.exists())
{
@@ -321,7 +321,7 @@ class IniFile
}
aWriter.close();
}
-
+
catch (java.io.FileNotFoundException fne)
{
GlobalLogWriter.get().println("couldn't open file for writing " + m_sFilename);
@@ -335,9 +335,9 @@ class IniFile
// DebugHelper.exception(BasicErrorCode.SbERR_INTERNAL_ERROR, ie.getMessage());
}
}
-
-
-
+
+
+
/**
insert a value
there are 3 cases
@@ -345,7 +345,7 @@ class IniFile
2. section exist but key not, search section, search key, if key is -1 get last known key position and insert new key value pair there
3. section exist and key exist, remove the old key and insert the key value pair at the same position
*/
- public void insertValue(String _sSection, String _sKey, String _sValue)
+ public void insertValue(String _sSection, String _sKey, String _sValue)
{
int i = findSection(_sSection);
if (i == -1)
@@ -427,11 +427,11 @@ class IniFile
// }
// sLocalValue = replaceEvaluatedKey(_sSection, sLocalValue);
// sLocalValue = replaceEvaluatedKey("global", sLocalValue);
- //
+ //
// return sLocalValue;
// }
-
+
/**
* some tests for this class
*/