RetroArch
Public Member Functions | Private Member Functions | Private Attributes | List of all members
com.retroarch.browser.preferences.util.ConfigFile Class Reference
Collaboration diagram for com.retroarch.browser.preferences.util.ConfigFile:
[legend]

Public Member Functions

 ConfigFile ()
 
 ConfigFile (String filePath)
 
void append (InputStream stream) throws IOException
 
void open (String configPath) throws IOException
 
void clear ()
 
void write (String path) throws IOException
 
boolean keyExists (String key)
 
void setString (String key, String value)
 
void setBoolean (String key, boolean value)
 
void setInt (String key, int value)
 
void setDouble (String key, double value)
 
void setFloat (String key, float value)
 
String getString (String key)
 
int getInt (String key)
 
double getDouble (String key)
 
float getFloat (String key)
 
boolean getBoolean (String key)
 

Private Member Functions

void parseLine (String line)
 

Private Attributes

final HashMap< String, String > map = new HashMap<String, String>()
 

Detailed Description

Represents a configuration file that works off of a key-value pair in the form [key name] = "[value]".

Constructor & Destructor Documentation

◆ ConfigFile() [1/2]

com.retroarch.browser.preferences.util.ConfigFile.ConfigFile ( )
inline

Constructor

◆ ConfigFile() [2/2]

com.retroarch.browser.preferences.util.ConfigFile.ConfigFile ( String  filePath)
inline

Constructor

Parameters
filePathThe path to the configuration file to open.
Here is the call graph for this function:

Member Function Documentation

◆ append()

void com.retroarch.browser.preferences.util.ConfigFile.append ( InputStream  stream) throws IOException
inline

Parses a configuration file from the given stream and appends the parsed values to the key-value map.

Parameters
streamThe InputStream containing the configuration file to parse.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ clear()

void com.retroarch.browser.preferences.util.ConfigFile.clear ( )
inline

Clears the key-value map of all currently set keys and values.

Here is the caller graph for this function:

◆ getBoolean()

boolean com.retroarch.browser.preferences.util.ConfigFile.getBoolean ( String  key)
inline

Gets the boolean value associated with the given key.

Parameters
keyThe key to get the boolean value from.
Returns
the boolean value associated with the given key.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getDouble()

double com.retroarch.browser.preferences.util.ConfigFile.getDouble ( String  key)
inline

Gets the double value associated with the given key.

Parameters
keyThe key to get the double value from.
Returns
the double value associated with the given key.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getFloat()

float com.retroarch.browser.preferences.util.ConfigFile.getFloat ( String  key)
inline

Gets the float value associated with the given key.

Parameters
keyThe key to get the float value from.
Returns
the float value associated with the given key.
Here is the call graph for this function:

◆ getInt()

int com.retroarch.browser.preferences.util.ConfigFile.getInt ( String  key)
inline

Gets the Integer value associated with the given key.

Parameters
keyThe key to get the Integer value from.
Returns
the Integer value associated with the given key.
Here is the call graph for this function:

◆ getString()

String com.retroarch.browser.preferences.util.ConfigFile.getString ( String  key)
inline

Gets the String value associated with the given key.

Parameters
keyThe key to get the String value from.
Returns
the String object associated with the given key.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ keyExists()

boolean com.retroarch.browser.preferences.util.ConfigFile.keyExists ( String  key)
inline

Checks if a key exists in the HashMap backing this ConfigFile instance.

Parameters
keyThe key to check for.
Returns
true if the key exists in the HashMap backing this ConfigFile; false if it doesn't.
Here is the caller graph for this function:

◆ open()

void com.retroarch.browser.preferences.util.ConfigFile.open ( String  configPath) throws IOException
inline

Opens a configuration file given by configPath and parses all of its key-value pairs, adding them to the key-value map.

Parameters
configPathPath to the configuration file to parse.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ parseLine()

void com.retroarch.browser.preferences.util.ConfigFile.parseLine ( String  line)
inlineprivate
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setBoolean()

void com.retroarch.browser.preferences.util.ConfigFile.setBoolean ( String  key,
boolean  value 
)
inline

Sets a key to the given boolean value.

Parameters
keyThe key to set the boolean value to.
valueThe boolean value to set to the key.

◆ setDouble()

void com.retroarch.browser.preferences.util.ConfigFile.setDouble ( String  key,
double  value 
)
inline

Sets a key to the given double value.

Parameters
keyThe key to set the double value to.
valueThe double value to set to the key.

◆ setFloat()

void com.retroarch.browser.preferences.util.ConfigFile.setFloat ( String  key,
float  value 
)
inline

Sets a key to the given float value.

Parameters
keyThe key to set the float value to.
valueThe float value to set to the key.

◆ setInt()

void com.retroarch.browser.preferences.util.ConfigFile.setInt ( String  key,
int  value 
)
inline

Sets a key to the given Integer value.

Parameters
keyThe key to set the Integer value to.
valueThe Integer value to set to the key.

◆ setString()

void com.retroarch.browser.preferences.util.ConfigFile.setString ( String  key,
String  value 
)
inline

Sets a key to the given String value.

Parameters
keyThe key to set the String value to.
valueThe String value to set to the key.

◆ write()

void com.retroarch.browser.preferences.util.ConfigFile.write ( String  path) throws IOException
inline

Writes the currently set key-value pairs to

Parameters
pathThe path to save the
Exceptions
IOException
Here is the call graph for this function:

Member Data Documentation

◆ map

final HashMap<String, String> com.retroarch.browser.preferences.util.ConfigFile.map = new HashMap<String, String>()
private

The documentation for this class was generated from the following file: