[Android] in ConfigFile.java do not add [<sectionless!>]
This commit is contained in:
parent
628a0d769d
commit
e76cc73671
|
@ -28,9 +28,6 @@ import android.util.Log;
|
||||||
|
|
||||||
public class ConfigFile
|
public class ConfigFile
|
||||||
{
|
{
|
||||||
/** The name we use for the untitled section (preamble) of the config file. */
|
|
||||||
public static final String SECTIONLESS_NAME = "[<sectionless!>]";
|
|
||||||
|
|
||||||
/** Name of the config file. */
|
/** Name of the config file. */
|
||||||
private final String mFilename;
|
private final String mFilename;
|
||||||
|
|
||||||
|
@ -144,16 +141,12 @@ public class ConfigFile
|
||||||
DataInputStream in = new DataInputStream( fstream );
|
DataInputStream in = new DataInputStream( fstream );
|
||||||
BufferedReader br = new BufferedReader( new InputStreamReader( in ) );
|
BufferedReader br = new BufferedReader( new InputStreamReader( in ) );
|
||||||
|
|
||||||
String sectionName = SECTIONLESS_NAME;
|
ConfigSection section = new ConfigSection( "", br ); // section
|
||||||
ConfigSection section = new ConfigSection( sectionName, br ); // Read the 'sectionless'
|
|
||||||
// section
|
|
||||||
mConfigMap.put( sectionName, section ); // Save the data to 'configMap'
|
|
||||||
|
|
||||||
// Loop through reading the remaining sections
|
// Loop through reading the remaining sections
|
||||||
while( !TextUtils.isEmpty( section.nextName ) )
|
while( !TextUtils.isEmpty( section.nextName ) )
|
||||||
{
|
{
|
||||||
// Get the next section name
|
// Get the next section name
|
||||||
sectionName = section.nextName;
|
String sectionName = section.nextName;
|
||||||
|
|
||||||
// Load the next section
|
// Load the next section
|
||||||
section = new ConfigSection( sectionName, br );
|
section = new ConfigSection( sectionName, br );
|
||||||
|
@ -265,9 +258,10 @@ public class ConfigFile
|
||||||
parameters = new HashMap<String, ConfigParameter>();
|
parameters = new HashMap<String, ConfigParameter>();
|
||||||
lines = new LinkedList<ConfigLine>();
|
lines = new LinkedList<ConfigLine>();
|
||||||
|
|
||||||
if( !TextUtils.isEmpty( sectionName ) && !sectionName.equals( SECTIONLESS_NAME ) )
|
if( !TextUtils.isEmpty( sectionName ))
|
||||||
|
{
|
||||||
lines.add( new ConfigLine( ConfigLine.LINE_SECTION, "[" + sectionName + "]\n", null ) );
|
lines.add( new ConfigLine( ConfigLine.LINE_SECTION, "[" + sectionName + "]\n", null ) );
|
||||||
|
}
|
||||||
name = sectionName;
|
name = sectionName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -286,9 +280,10 @@ public class ConfigFile
|
||||||
parameters = new HashMap<String, ConfigParameter>();
|
parameters = new HashMap<String, ConfigParameter>();
|
||||||
lines = new LinkedList<ConfigLine>();
|
lines = new LinkedList<ConfigLine>();
|
||||||
|
|
||||||
if( !TextUtils.isEmpty( sectionName ) && !sectionName.equals( SECTIONLESS_NAME ) )
|
if( !TextUtils.isEmpty( sectionName ))
|
||||||
|
{
|
||||||
lines.add( new ConfigLine( ConfigLine.LINE_SECTION, "[" + sectionName + "]\n", null ) );
|
lines.add( new ConfigLine( ConfigLine.LINE_SECTION, "[" + sectionName + "]\n", null ) );
|
||||||
|
}
|
||||||
name = sectionName;
|
name = sectionName;
|
||||||
|
|
||||||
// No file to read from. Quit.
|
// No file to read from. Quit.
|
||||||
|
|
Loading…
Reference in New Issue