| Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
|---|---|
| License | LGPL-2.1 |
| Maintainer | Iñaki García Etxebarria (garetxe@gmail.com) |
| Safe Haskell | None |
| Language | Haskell2010 |
GI.GLib.Structs.KeyFile
Contents
- Exported types
- Methods
- errorQuark
- getBoolean
- getBooleanList
- getComment
- getDouble
- getDoubleList
- getGroups
- getInt64
- getInteger
- getIntegerList
- getKeys
- getLocaleString
- getLocaleStringList
- getStartGroup
- getString
- getStringList
- getUint64
- getValue
- hasGroup
- loadFromBytes
- loadFromData
- loadFromDataDirs
- loadFromDirs
- loadFromFile
- new
- removeComment
- removeGroup
- removeKey
- saveToFile
- setBoolean
- setBooleanList
- setComment
- setDouble
- setDoubleList
- setInt64
- setInteger
- setIntegerList
- setListSeparator
- setLocaleString
- setLocaleStringList
- setString
- setStringList
- setUint64
- setValue
- toData
- unref
Description
The GKeyFile struct contains only private data and should not be accessed directly.
- newtype KeyFile = KeyFile (ManagedPtr KeyFile)
- noKeyFile :: Maybe KeyFile
- keyFileErrorQuark :: (HasCallStack, MonadIO m) => m Word32
- data KeyFileGetBooleanMethodInfo
- keyFileGetBoolean :: (HasCallStack, MonadIO m) => KeyFile -> Text -> Text -> m ()
- data KeyFileGetBooleanListMethodInfo
- keyFileGetBooleanList :: (HasCallStack, MonadIO m) => KeyFile -> Text -> Text -> m [Bool]
- data KeyFileGetCommentMethodInfo
- keyFileGetComment :: (HasCallStack, MonadIO m) => KeyFile -> Maybe Text -> Text -> m Text
- data KeyFileGetDoubleMethodInfo
- keyFileGetDouble :: (HasCallStack, MonadIO m) => KeyFile -> Text -> Text -> m Double
- data KeyFileGetDoubleListMethodInfo
- keyFileGetDoubleList :: (HasCallStack, MonadIO m) => KeyFile -> Text -> Text -> m [Double]
- data KeyFileGetGroupsMethodInfo
- keyFileGetGroups :: (HasCallStack, MonadIO m) => KeyFile -> m ([Text], Word64)
- data KeyFileGetInt64MethodInfo
- keyFileGetInt64 :: (HasCallStack, MonadIO m) => KeyFile -> Text -> Text -> m Int64
- data KeyFileGetIntegerMethodInfo
- keyFileGetInteger :: (HasCallStack, MonadIO m) => KeyFile -> Text -> Text -> m Int32
- data KeyFileGetIntegerListMethodInfo
- keyFileGetIntegerList :: (HasCallStack, MonadIO m) => KeyFile -> Text -> Text -> m [Int32]
- data KeyFileGetKeysMethodInfo
- keyFileGetKeys :: (HasCallStack, MonadIO m) => KeyFile -> Text -> m ([Text], Word64)
- data KeyFileGetLocaleStringMethodInfo
- keyFileGetLocaleString :: (HasCallStack, MonadIO m) => KeyFile -> Text -> Text -> Maybe Text -> m Text
- data KeyFileGetLocaleStringListMethodInfo
- keyFileGetLocaleStringList :: (HasCallStack, MonadIO m) => KeyFile -> Text -> Text -> Maybe Text -> m ([Text], Word64)
- data KeyFileGetStartGroupMethodInfo
- keyFileGetStartGroup :: (HasCallStack, MonadIO m) => KeyFile -> m Text
- data KeyFileGetStringMethodInfo
- keyFileGetString :: (HasCallStack, MonadIO m) => KeyFile -> Text -> Text -> m Text
- data KeyFileGetStringListMethodInfo
- keyFileGetStringList :: (HasCallStack, MonadIO m) => KeyFile -> Text -> Text -> m ([Text], Word64)
- data KeyFileGetUint64MethodInfo
- keyFileGetUint64 :: (HasCallStack, MonadIO m) => KeyFile -> Text -> Text -> m Word64
- data KeyFileGetValueMethodInfo
- keyFileGetValue :: (HasCallStack, MonadIO m) => KeyFile -> Text -> Text -> m Text
- data KeyFileHasGroupMethodInfo
- keyFileHasGroup :: (HasCallStack, MonadIO m) => KeyFile -> Text -> m Bool
- data KeyFileLoadFromBytesMethodInfo
- keyFileLoadFromBytes :: (HasCallStack, MonadIO m) => KeyFile -> Bytes -> [KeyFileFlags] -> m ()
- data KeyFileLoadFromDataMethodInfo
- keyFileLoadFromData :: (HasCallStack, MonadIO m) => KeyFile -> Text -> Word64 -> [KeyFileFlags] -> m ()
- data KeyFileLoadFromDataDirsMethodInfo
- keyFileLoadFromDataDirs :: (HasCallStack, MonadIO m) => KeyFile -> [Char] -> [KeyFileFlags] -> m [Char]
- data KeyFileLoadFromDirsMethodInfo
- keyFileLoadFromDirs :: (HasCallStack, MonadIO m) => KeyFile -> [Char] -> [[Char]] -> [KeyFileFlags] -> m [Char]
- data KeyFileLoadFromFileMethodInfo
- keyFileLoadFromFile :: (HasCallStack, MonadIO m) => KeyFile -> [Char] -> [KeyFileFlags] -> m ()
- keyFileNew :: (HasCallStack, MonadIO m) => m KeyFile
- data KeyFileRemoveCommentMethodInfo
- keyFileRemoveComment :: (HasCallStack, MonadIO m) => KeyFile -> Maybe Text -> Maybe Text -> m ()
- data KeyFileRemoveGroupMethodInfo
- keyFileRemoveGroup :: (HasCallStack, MonadIO m) => KeyFile -> Text -> m ()
- data KeyFileRemoveKeyMethodInfo
- keyFileRemoveKey :: (HasCallStack, MonadIO m) => KeyFile -> Text -> Text -> m ()
- data KeyFileSaveToFileMethodInfo
- keyFileSaveToFile :: (HasCallStack, MonadIO m) => KeyFile -> Text -> m ()
- data KeyFileSetBooleanMethodInfo
- keyFileSetBoolean :: (HasCallStack, MonadIO m) => KeyFile -> Text -> Text -> Bool -> m ()
- data KeyFileSetBooleanListMethodInfo
- keyFileSetBooleanList :: (HasCallStack, MonadIO m) => KeyFile -> Text -> Text -> [Bool] -> m ()
- data KeyFileSetCommentMethodInfo
- keyFileSetComment :: (HasCallStack, MonadIO m) => KeyFile -> Maybe Text -> Maybe Text -> Text -> m ()
- data KeyFileSetDoubleMethodInfo
- keyFileSetDouble :: (HasCallStack, MonadIO m) => KeyFile -> Text -> Text -> Double -> m ()
- data KeyFileSetDoubleListMethodInfo
- keyFileSetDoubleList :: (HasCallStack, MonadIO m) => KeyFile -> Text -> Text -> [Double] -> m ()
- data KeyFileSetInt64MethodInfo
- keyFileSetInt64 :: (HasCallStack, MonadIO m) => KeyFile -> Text -> Text -> Int64 -> m ()
- data KeyFileSetIntegerMethodInfo
- keyFileSetInteger :: (HasCallStack, MonadIO m) => KeyFile -> Text -> Text -> Int32 -> m ()
- data KeyFileSetIntegerListMethodInfo
- keyFileSetIntegerList :: (HasCallStack, MonadIO m) => KeyFile -> Text -> Text -> [Int32] -> m ()
- data KeyFileSetListSeparatorMethodInfo
- keyFileSetListSeparator :: (HasCallStack, MonadIO m) => KeyFile -> Int8 -> m ()
- data KeyFileSetLocaleStringMethodInfo
- keyFileSetLocaleString :: (HasCallStack, MonadIO m) => KeyFile -> Text -> Text -> Text -> Text -> m ()
- data KeyFileSetLocaleStringListMethodInfo
- keyFileSetLocaleStringList :: (HasCallStack, MonadIO m) => KeyFile -> Text -> Text -> Text -> [Text] -> Word64 -> m ()
- data KeyFileSetStringMethodInfo
- keyFileSetString :: (HasCallStack, MonadIO m) => KeyFile -> Text -> Text -> Text -> m ()
- data KeyFileSetStringListMethodInfo
- keyFileSetStringList :: (HasCallStack, MonadIO m) => KeyFile -> Text -> Text -> [Text] -> Word64 -> m ()
- data KeyFileSetUint64MethodInfo
- keyFileSetUint64 :: (HasCallStack, MonadIO m) => KeyFile -> Text -> Text -> Word64 -> m ()
- data KeyFileSetValueMethodInfo
- keyFileSetValue :: (HasCallStack, MonadIO m) => KeyFile -> Text -> Text -> Text -> m ()
- data KeyFileToDataMethodInfo
- keyFileToData :: (HasCallStack, MonadIO m) => KeyFile -> m (Text, Word64)
- data KeyFileUnrefMethodInfo
- keyFileUnref :: (HasCallStack, MonadIO m) => KeyFile -> m ()
Exported types
Constructors
| KeyFile (ManagedPtr KeyFile) |
Instances
Methods
errorQuark
keyFileErrorQuark :: (HasCallStack, MonadIO m) => m Word32 #
No description available in the introspection data.
getBoolean
data KeyFileGetBooleanMethodInfo #
Instances
| ((~) * signature (Text -> Text -> m ()), MonadIO m) => MethodInfo * KeyFileGetBooleanMethodInfo KeyFile signature # | |
Arguments
| :: (HasCallStack, MonadIO m) | |
| => KeyFile |
|
| -> Text |
|
| -> Text |
|
| -> m () | (Can throw |
Returns the value associated with key under groupName as a
boolean.
If key cannot be found then False is returned and error is set
to G_KEY_FILE_ERROR_KEY_NOT_FOUND. Likewise, if the value
associated with key cannot be interpreted as a boolean then False
is returned and error is set to G_KEY_FILE_ERROR_INVALID_VALUE.
Since: 2.6
getBooleanList
data KeyFileGetBooleanListMethodInfo #
Instances
| ((~) * signature (Text -> Text -> m [Bool]), MonadIO m) => MethodInfo * KeyFileGetBooleanListMethodInfo KeyFile signature # | |
Arguments
| :: (HasCallStack, MonadIO m) | |
| => KeyFile |
|
| -> Text |
|
| -> Text |
|
| -> m [Bool] | Returns:
the values associated with the key as a list of booleans, or |
Returns the values associated with key under groupName as
booleans.
If key cannot be found then Nothing is returned and error is set to
G_KEY_FILE_ERROR_KEY_NOT_FOUND. Likewise, if the values associated
with key cannot be interpreted as booleans then Nothing is returned
and error is set to G_KEY_FILE_ERROR_INVALID_VALUE.
Since: 2.6
getComment
getDouble
data KeyFileGetDoubleMethodInfo #
Instances
| ((~) * signature (Text -> Text -> m Double), MonadIO m) => MethodInfo * KeyFileGetDoubleMethodInfo KeyFile signature # | |
Arguments
| :: (HasCallStack, MonadIO m) | |
| => KeyFile |
|
| -> Text |
|
| -> Text |
|
| -> m Double | Returns: the value associated with the key as a double, or
0.0 if the key was not found or could not be parsed. (Can throw |
Returns the value associated with key under groupName as a
double. If groupName is Nothing, the start_group is used.
If key cannot be found then 0.0 is returned and error is set to
G_KEY_FILE_ERROR_KEY_NOT_FOUND. Likewise, if the value associated
with key cannot be interpreted as a double then 0.0 is returned
and error is set to G_KEY_FILE_ERROR_INVALID_VALUE.
Since: 2.12
getDoubleList
data KeyFileGetDoubleListMethodInfo #
Instances
| ((~) * signature (Text -> Text -> m [Double]), MonadIO m) => MethodInfo * KeyFileGetDoubleListMethodInfo KeyFile signature # | |
Arguments
| :: (HasCallStack, MonadIO m) | |
| => KeyFile |
|
| -> Text |
|
| -> Text |
|
| -> m [Double] | Returns:
the values associated with the key as a list of doubles, or |
Returns the values associated with key under groupName as
doubles.
If key cannot be found then Nothing is returned and error is set to
G_KEY_FILE_ERROR_KEY_NOT_FOUND. Likewise, if the values associated
with key cannot be interpreted as doubles then Nothing is returned
and error is set to G_KEY_FILE_ERROR_INVALID_VALUE.
Since: 2.12
getGroups
data KeyFileGetGroupsMethodInfo #
Instances
| ((~) * signature (m ([Text], Word64)), MonadIO m) => MethodInfo * KeyFileGetGroupsMethodInfo KeyFile signature # | |
getInt64
data KeyFileGetInt64MethodInfo #
Instances
| ((~) * signature (Text -> Text -> m Int64), MonadIO m) => MethodInfo * KeyFileGetInt64MethodInfo KeyFile signature # | |
Arguments
| :: (HasCallStack, MonadIO m) | |
| => KeyFile | |
| -> Text |
|
| -> Text |
|
| -> m Int64 | Returns: the value associated with the key as a signed 64-bit integer, or
0 if the key was not found or could not be parsed. (Can throw |
Returns the value associated with key under groupName as a signed
64-bit integer. This is similar to keyFileGetInteger but can return
64-bit results without truncation.
Since: 2.26
getInteger
data KeyFileGetIntegerMethodInfo #
Instances
| ((~) * signature (Text -> Text -> m Int32), MonadIO m) => MethodInfo * KeyFileGetIntegerMethodInfo KeyFile signature # | |
Arguments
| :: (HasCallStack, MonadIO m) | |
| => KeyFile |
|
| -> Text |
|
| -> Text |
|
| -> m Int32 | Returns: the value associated with the key as an integer, or
0 if the key was not found or could not be parsed. (Can throw |
Returns the value associated with key under groupName as an
integer.
If key cannot be found then 0 is returned and error is set to
G_KEY_FILE_ERROR_KEY_NOT_FOUND. Likewise, if the value associated
with key cannot be interpreted as an integer, or is out of range
for a gint, then 0 is returned
and error is set to G_KEY_FILE_ERROR_INVALID_VALUE.
Since: 2.6
getIntegerList
data KeyFileGetIntegerListMethodInfo #
Instances
| ((~) * signature (Text -> Text -> m [Int32]), MonadIO m) => MethodInfo * KeyFileGetIntegerListMethodInfo KeyFile signature # | |
Arguments
| :: (HasCallStack, MonadIO m) | |
| => KeyFile |
|
| -> Text |
|
| -> Text |
|
| -> m [Int32] | Returns:
the values associated with the key as a list of integers, or |
Returns the values associated with key under groupName as
integers.
If key cannot be found then Nothing is returned and error is set to
G_KEY_FILE_ERROR_KEY_NOT_FOUND. Likewise, if the values associated
with key cannot be interpreted as integers, or are out of range for
gint, then Nothing is returned
and error is set to G_KEY_FILE_ERROR_INVALID_VALUE.
Since: 2.6
getKeys
data KeyFileGetKeysMethodInfo #
Instances
| ((~) * signature (Text -> m ([Text], Word64)), MonadIO m) => MethodInfo * KeyFileGetKeysMethodInfo KeyFile signature # | |
getLocaleString
Arguments
| :: (HasCallStack, MonadIO m) | |
| => KeyFile |
|
| -> Text |
|
| -> Text |
|
| -> Maybe Text |
|
| -> m Text | Returns: a newly allocated string or |
Returns the value associated with key under groupName
translated in the given locale if available. If locale is
Nothing then the current locale is assumed.
If key cannot be found then Nothing is returned and error is set
to G_KEY_FILE_ERROR_KEY_NOT_FOUND. If the value associated
with key cannot be interpreted or no suitable translation can
be found then the untranslated value is returned.
Since: 2.6
getLocaleStringList
Arguments
| :: (HasCallStack, MonadIO m) | |
| => KeyFile |
|
| -> Text |
|
| -> Text |
|
| -> Maybe Text |
|
| -> m ([Text], Word64) | Returns: a newly allocated |
Returns the values associated with key under groupName
translated in the given locale if available. If locale is
Nothing then the current locale is assumed.
If key cannot be found then Nothing is returned and error is set
to G_KEY_FILE_ERROR_KEY_NOT_FOUND. If the values associated
with key cannot be interpreted or no suitable translations
can be found then the untranslated values are returned. The
returned array is Nothing-terminated, so length may optionally
be Nothing.
Since: 2.6
getStartGroup
data KeyFileGetStartGroupMethodInfo #
Instances
| ((~) * signature (m Text), MonadIO m) => MethodInfo * KeyFileGetStartGroupMethodInfo KeyFile signature # | |
Arguments
| :: (HasCallStack, MonadIO m) | |
| => KeyFile |
|
| -> m Text | Returns: The start group of the key file. |
Returns the name of the start group of the file.
Since: 2.6
getString
data KeyFileGetStringMethodInfo #
Instances
| ((~) * signature (Text -> Text -> m Text), MonadIO m) => MethodInfo * KeyFileGetStringMethodInfo KeyFile signature # | |
Arguments
| :: (HasCallStack, MonadIO m) | |
| => KeyFile |
|
| -> Text |
|
| -> Text |
|
| -> m Text | Returns: a newly allocated string or |
Returns the string value associated with key under groupName.
Unlike keyFileGetValue, this function handles escape sequences
like \s.
In the event the key cannot be found, Nothing is returned and
error is set to G_KEY_FILE_ERROR_KEY_NOT_FOUND. In the
event that the groupName cannot be found, Nothing is returned
and error is set to G_KEY_FILE_ERROR_GROUP_NOT_FOUND.
Since: 2.6
getStringList
getUint64
data KeyFileGetUint64MethodInfo #
Instances
| ((~) * signature (Text -> Text -> m Word64), MonadIO m) => MethodInfo * KeyFileGetUint64MethodInfo KeyFile signature # | |
Arguments
| :: (HasCallStack, MonadIO m) | |
| => KeyFile | |
| -> Text |
|
| -> Text |
|
| -> m Word64 | Returns: the value associated with the key as an unsigned 64-bit integer,
or 0 if the key was not found or could not be parsed. (Can throw |
Returns the value associated with key under groupName as an unsigned
64-bit integer. This is similar to keyFileGetInteger but can return
large positive results without truncation.
Since: 2.26
getValue
data KeyFileGetValueMethodInfo #
Instances
| ((~) * signature (Text -> Text -> m Text), MonadIO m) => MethodInfo * KeyFileGetValueMethodInfo KeyFile signature # | |
Arguments
| :: (HasCallStack, MonadIO m) | |
| => KeyFile |
|
| -> Text |
|
| -> Text |
|
| -> m Text | Returns: a newly allocated string or |
Returns the raw value associated with key under groupName.
Use keyFileGetString to retrieve an unescaped UTF-8 string.
In the event the key cannot be found, Nothing is returned and
error is set to G_KEY_FILE_ERROR_KEY_NOT_FOUND. In the
event that the groupName cannot be found, Nothing is returned
and error is set to G_KEY_FILE_ERROR_GROUP_NOT_FOUND.
Since: 2.6
hasGroup
data KeyFileHasGroupMethodInfo #
Instances
| ((~) * signature (Text -> m Bool), MonadIO m) => MethodInfo * KeyFileHasGroupMethodInfo KeyFile signature # | |
Arguments
| :: (HasCallStack, MonadIO m) | |
| => KeyFile |
|
| -> Text |
|
| -> m Bool | Returns: |
Looks whether the key file has the group groupName.
Since: 2.6
loadFromBytes
data KeyFileLoadFromBytesMethodInfo #
Instances
| ((~) * signature (Bytes -> [KeyFileFlags] -> m ()), MonadIO m) => MethodInfo * KeyFileLoadFromBytesMethodInfo KeyFile signature # | |
Arguments
| :: (HasCallStack, MonadIO m) | |
| => KeyFile |
|
| -> Bytes |
|
| -> [KeyFileFlags] |
|
| -> m () | (Can throw |
Loads a key file from the data in bytes into an empty KeyFile structure.
If the object cannot be created then error is set to a KeyFileError.
Since: 2.50
loadFromData
data KeyFileLoadFromDataMethodInfo #
Instances
| ((~) * signature (Text -> Word64 -> [KeyFileFlags] -> m ()), MonadIO m) => MethodInfo * KeyFileLoadFromDataMethodInfo KeyFile signature # | |
Arguments
| :: (HasCallStack, MonadIO m) | |
| => KeyFile |
|
| -> Text |
|
| -> Word64 |
|
| -> [KeyFileFlags] |
|
| -> m () | (Can throw |
Loads a key file from memory into an empty KeyFile structure.
If the object cannot be created then error is set to a KeyFileError.
Since: 2.6
loadFromDataDirs
data KeyFileLoadFromDataDirsMethodInfo #
Instances
| ((~) * signature ([Char] -> [KeyFileFlags] -> m [Char]), MonadIO m) => MethodInfo * KeyFileLoadFromDataDirsMethodInfo KeyFile signature # | |
Arguments
| :: (HasCallStack, MonadIO m) | |
| => KeyFile |
|
| -> [Char] |
|
| -> [KeyFileFlags] |
|
| -> m [Char] | (Can throw |
This function looks for a key file named file in the paths
returned from getUserDataDir and getSystemDataDirs,
loads the file into keyFile and returns the file's full path in
fullPath. If the file could not be loaded then an error is
set to either a FileError or KeyFileError.
Since: 2.6
loadFromDirs
data KeyFileLoadFromDirsMethodInfo #
Instances
| ((~) * signature ([Char] -> [[Char]] -> [KeyFileFlags] -> m [Char]), MonadIO m) => MethodInfo * KeyFileLoadFromDirsMethodInfo KeyFile signature # | |
Arguments
| :: (HasCallStack, MonadIO m) | |
| => KeyFile |
|
| -> [Char] |
|
| -> [[Char]] |
|
| -> [KeyFileFlags] |
|
| -> m [Char] | (Can throw |
This function looks for a key file named file in the paths
specified in searchDirs, loads the file into keyFile and
returns the file's full path in fullPath.
If the file could not be found in any of the searchDirs,
KeyFileErrorNotFound is returned. If
the file is found but the OS returns an error when opening or reading the
file, a G_FILE_ERROR is returned. If there is a problem parsing the file, a
G_KEY_FILE_ERROR is returned.
Since: 2.14
loadFromFile
data KeyFileLoadFromFileMethodInfo #
Instances
| ((~) * signature ([Char] -> [KeyFileFlags] -> m ()), MonadIO m) => MethodInfo * KeyFileLoadFromFileMethodInfo KeyFile signature # | |
Arguments
| :: (HasCallStack, MonadIO m) | |
| => KeyFile |
|
| -> [Char] |
|
| -> [KeyFileFlags] |
|
| -> m () | (Can throw |
Loads a key file into an empty KeyFile structure.
If the OS returns an error when opening or reading the file, a
G_FILE_ERROR is returned. If there is a problem parsing the file, a
G_KEY_FILE_ERROR is returned.
This function will never return a KeyFileErrorNotFound error. If the
file is not found, FileErrorNoent is returned.
Since: 2.6
new
Arguments
| :: (HasCallStack, MonadIO m) | |
| => m KeyFile | Returns: an empty |
Creates a new empty KeyFile object. Use
keyFileLoadFromFile, keyFileLoadFromData,
keyFileLoadFromDirs or keyFileLoadFromDataDirs to
read an existing key file.
Since: 2.6
removeComment
removeGroup
data KeyFileRemoveGroupMethodInfo #
Instances
| ((~) * signature (Text -> m ()), MonadIO m) => MethodInfo * KeyFileRemoveGroupMethodInfo KeyFile signature # | |
Arguments
| :: (HasCallStack, MonadIO m) | |
| => KeyFile |
|
| -> Text |
|
| -> m () | (Can throw |
Removes the specified group, groupName,
from the key file.
Since: 2.6
removeKey
data KeyFileRemoveKeyMethodInfo #
Instances
| ((~) * signature (Text -> Text -> m ()), MonadIO m) => MethodInfo * KeyFileRemoveKeyMethodInfo KeyFile signature # | |
Arguments
| :: (HasCallStack, MonadIO m) | |
| => KeyFile |
|
| -> Text |
|
| -> Text |
|
| -> m () | (Can throw |
Removes key in groupName from the key file.
Since: 2.6
saveToFile
data KeyFileSaveToFileMethodInfo #
Instances
| ((~) * signature (Text -> m ()), MonadIO m) => MethodInfo * KeyFileSaveToFileMethodInfo KeyFile signature # | |
Arguments
| :: (HasCallStack, MonadIO m) | |
| => KeyFile |
|
| -> Text |
|
| -> m () | (Can throw |
Writes the contents of keyFile to filename using
fileSetContents.
This function can fail for any of the reasons that
fileSetContents may fail.
Since: 2.40
setBoolean
data KeyFileSetBooleanMethodInfo #
Instances
| ((~) * signature (Text -> Text -> Bool -> m ()), MonadIO m) => MethodInfo * KeyFileSetBooleanMethodInfo KeyFile signature # | |
Arguments
| :: (HasCallStack, MonadIO m) | |
| => KeyFile |
|
| -> Text |
|
| -> Text |
|
| -> Bool | |
| -> m () |
Associates a new boolean value with key under groupName.
If key cannot be found then it is created.
Since: 2.6
setBooleanList
data KeyFileSetBooleanListMethodInfo #
Instances
| ((~) * signature (Text -> Text -> [Bool] -> m ()), MonadIO m) => MethodInfo * KeyFileSetBooleanListMethodInfo KeyFile signature # | |
Arguments
| :: (HasCallStack, MonadIO m) | |
| => KeyFile |
|
| -> Text |
|
| -> Text |
|
| -> [Bool] |
|
| -> m () |
Associates a list of boolean values with key under groupName.
If key cannot be found then it is created.
If groupName is Nothing, the start_group is used.
Since: 2.6
setComment
setDouble
data KeyFileSetDoubleMethodInfo #
Instances
| ((~) * signature (Text -> Text -> Double -> m ()), MonadIO m) => MethodInfo * KeyFileSetDoubleMethodInfo KeyFile signature # | |
Arguments
| :: (HasCallStack, MonadIO m) | |
| => KeyFile |
|
| -> Text |
|
| -> Text |
|
| -> Double |
|
| -> m () |
Associates a new double value with key under groupName.
If key cannot be found then it is created.
Since: 2.12
setDoubleList
data KeyFileSetDoubleListMethodInfo #
Instances
| ((~) * signature (Text -> Text -> [Double] -> m ()), MonadIO m) => MethodInfo * KeyFileSetDoubleListMethodInfo KeyFile signature # | |
Arguments
| :: (HasCallStack, MonadIO m) | |
| => KeyFile |
|
| -> Text |
|
| -> Text |
|
| -> [Double] |
|
| -> m () |
Associates a list of double values with key under
groupName. If key cannot be found then it is created.
Since: 2.12
setInt64
data KeyFileSetInt64MethodInfo #
Instances
| ((~) * signature (Text -> Text -> Int64 -> m ()), MonadIO m) => MethodInfo * KeyFileSetInt64MethodInfo KeyFile signature # | |
Arguments
| :: (HasCallStack, MonadIO m) | |
| => KeyFile |
|
| -> Text |
|
| -> Text |
|
| -> Int64 |
|
| -> m () |
Associates a new integer value with key under groupName.
If key cannot be found then it is created.
Since: 2.26
setInteger
data KeyFileSetIntegerMethodInfo #
Instances
| ((~) * signature (Text -> Text -> Int32 -> m ()), MonadIO m) => MethodInfo * KeyFileSetIntegerMethodInfo KeyFile signature # | |
Arguments
| :: (HasCallStack, MonadIO m) | |
| => KeyFile |
|
| -> Text |
|
| -> Text |
|
| -> Int32 |
|
| -> m () |
Associates a new integer value with key under groupName.
If key cannot be found then it is created.
Since: 2.6
setIntegerList
data KeyFileSetIntegerListMethodInfo #
Instances
| ((~) * signature (Text -> Text -> [Int32] -> m ()), MonadIO m) => MethodInfo * KeyFileSetIntegerListMethodInfo KeyFile signature # | |
Arguments
| :: (HasCallStack, MonadIO m) | |
| => KeyFile |
|
| -> Text |
|
| -> Text |
|
| -> [Int32] |
|
| -> m () |
Associates a list of integer values with key under groupName.
If key cannot be found then it is created.
Since: 2.6
setListSeparator
data KeyFileSetListSeparatorMethodInfo #
Instances
| ((~) * signature (Int8 -> m ()), MonadIO m) => MethodInfo * KeyFileSetListSeparatorMethodInfo KeyFile signature # | |
Arguments
| :: (HasCallStack, MonadIO m) | |
| => KeyFile |
|
| -> Int8 |
|
| -> m () |
Sets the character which is used to separate values in lists. Typically ';' or ',' are used as separators. The default list separator is ';'.
Since: 2.6
setLocaleString
Arguments
| :: (HasCallStack, MonadIO m) | |
| => KeyFile |
|
| -> Text |
|
| -> Text |
|
| -> Text |
|
| -> Text |
|
| -> m () |
Associates a string value for key and locale under groupName.
If the translation for key cannot be found then it is created.
Since: 2.6
setLocaleStringList
Arguments
| :: (HasCallStack, MonadIO m) | |
| => KeyFile |
|
| -> Text |
|
| -> Text |
|
| -> Text |
|
| -> [Text] |
|
| -> Word64 |
|
| -> m () |
Associates a list of string values for key and locale under
groupName. If the translation for key cannot be found then
it is created.
Since: 2.6
setString
data KeyFileSetStringMethodInfo #
Instances
| ((~) * signature (Text -> Text -> Text -> m ()), MonadIO m) => MethodInfo * KeyFileSetStringMethodInfo KeyFile signature # | |
Arguments
| :: (HasCallStack, MonadIO m) | |
| => KeyFile |
|
| -> Text |
|
| -> Text |
|
| -> Text |
|
| -> m () |
Associates a new string value with key under groupName.
If key cannot be found then it is created.
If groupName cannot be found then it is created.
Unlike keyFileSetValue, this function handles characters
that need escaping, such as newlines.
Since: 2.6
setStringList
Arguments
| :: (HasCallStack, MonadIO m) | |
| => KeyFile |
|
| -> Text |
|
| -> Text |
|
| -> [Text] |
|
| -> Word64 |
|
| -> m () |
Associates a list of string values for key under groupName.
If key cannot be found then it is created.
If groupName cannot be found then it is created.
Since: 2.6
setUint64
data KeyFileSetUint64MethodInfo #
Instances
| ((~) * signature (Text -> Text -> Word64 -> m ()), MonadIO m) => MethodInfo * KeyFileSetUint64MethodInfo KeyFile signature # | |
Arguments
| :: (HasCallStack, MonadIO m) | |
| => KeyFile |
|
| -> Text |
|
| -> Text |
|
| -> Word64 |
|
| -> m () |
Associates a new integer value with key under groupName.
If key cannot be found then it is created.
Since: 2.26
setValue
data KeyFileSetValueMethodInfo #
Instances
| ((~) * signature (Text -> Text -> Text -> m ()), MonadIO m) => MethodInfo * KeyFileSetValueMethodInfo KeyFile signature # | |
Arguments
| :: (HasCallStack, MonadIO m) | |
| => KeyFile |
|
| -> Text |
|
| -> Text |
|
| -> Text |
|
| -> m () |
Associates a new value with key under groupName.
If key cannot be found then it is created. If groupName cannot
be found then it is created. To set an UTF-8 string which may contain
characters that need escaping (such as newlines or spaces), use
keyFileSetString.
Since: 2.6
toData
data KeyFileToDataMethodInfo #
Instances
| ((~) * signature (m (Text, Word64)), MonadIO m) => MethodInfo * KeyFileToDataMethodInfo KeyFile signature # | |
Arguments
| :: (HasCallStack, MonadIO m) | |
| => KeyFile |
|
| -> m (Text, Word64) | Returns: a newly allocated string holding
the contents of the |
This function outputs keyFile as a string.
Note that this function never reports an error,
so it is safe to pass Nothing as error.
Since: 2.6
unref
data KeyFileUnrefMethodInfo #
Instances
| ((~) * signature (m ()), MonadIO m) => MethodInfo * KeyFileUnrefMethodInfo KeyFile signature # | |
Arguments
| :: (HasCallStack, MonadIO m) | |
| => KeyFile |
|
| -> m () |
Decreases the reference count of keyFile by 1. If the reference count
reaches zero, frees the key file and all its allocated memory.
Since: 2.32