FBConfigFile Class Reference

FBConfigFile Class Reference

#include <mobu-python-api.h>

Class Description

Interface to the application config files.

This class allows client code to generate, modify and query configuration files. Config files will be automatically created when needed. They will be located in the /bin/config folder or an explicitly specified folder depending on the constructor used.

+ Inheritance diagram for FBConfigFile:

Public Member Functions

 __reduce__ ()
 
 __init__ (...)
 
 ClearFile (FBConfigFile arg1)
 Remove all content from the config file. More...
 
str Get (FBConfigFile arg1, str arg2, str arg3, str arg4)
 Get an item's value. More...
 
tuple GetOrSet (FBConfigFile arg1, str arg2, str arg3, str arg4, str arg5)
 Get a value from the config file and set it if it was not found. More...
 
bool Set (FBConfigFile arg1, str arg2, str arg3, str arg4, str arg5)
 Set an item's value. More...
 

Member Function Documentation

__init__ (   ...)

Python Docstring:

__init__( (object)arg1, (str)arg2 [, (object)arg3 [, (object)arg4]]) -> None

__init__( (object)arg1, (str)arg2, (str)arg3 [, (object)arg4 [, (object)arg5]]) -> None 

C++ Constructors:
The reference documentation for the following C++ symbols may contain additional relevant information.

__reduce__ ( )
ClearFile ( FBConfigFile  arg1)

Remove all content from the config file.

Python Docstring:

ClearFile( (FBConfigFile)arg1) -> None 

C++ Signature:

void ClearFile() 
str Get ( FBConfigFile  arg1,
str  arg2,
str  arg3,
str  arg4 
)

Get an item's value.

Python Docstring:

Get( (FBConfigFile)arg1, (str)arg2, (str)arg3 [, (str)arg4]) -> str 

C++ Signature:

const char * Get(const char * pSectionName, const char * pItemName, const char * pDefaultValue = 0) 

Get an item's value by looking inside a specific section of the config file.

Parameters
pSectionNameName of the section.
pItemNameName of the item.
pDefaultValueDefault value that will be returned if the item is not found.
Returns
The value assigned to the item in the specified section of the config file, or the default value if not found.
tuple GetOrSet ( FBConfigFile  arg1,
str  arg2,
str  arg3,
str  arg4,
str  arg5 
)

Get a value from the config file and set it if it was not found.

Python Docstring:

GetOrSet( (FBConfigFile)arg1, (str)arg2, (str)arg3, (str)arg4 [, (str)arg5]) -> tuple 

C++ Signature:

bool GetOrSet(const char * pSectionName, const char * pItemName, const char *& pValue, const char * pComment = 0) 
Parameters
pSectionNameName of the section.
pItemNameName of the item.
pValueReference the the string that will contain the value of the item. If the item is not found in the file, it will be added with the initial value in this string.
pCommentOptional parameter that can be used to add a comment.
Returns
true if the value was found or added, or false if the item was not found and could not be added to the file.
bool Set ( FBConfigFile  arg1,
str  arg2,
str  arg3,
str  arg4,
str  arg5 
)

Set an item's value.

Python Docstring:

Set( (FBConfigFile)arg1, (str)arg2, (str)arg3, (str)arg4 [, (str)arg5]) -> bool 

C++ Signature:

bool Set(const char * pSectionName, const char * pItemName, const char * pValue, const char * pComment = 0) 

Assign a value to an item in the config file. If the item does not exist, it will be created.

Parameters
pSectionNameName of the section.
pItemNameName of the item.
pValueValue assigned to the item.
pCommentOptional parameter that can be used to add a comment.
Returns
true if the item was written to the config file, false otherwise.