LibreOffice Module sd (master) 1
|
This class gives access to the configuration. More...
#include <ConfigurationAccess.hxx>
Public Types | |
enum | WriteMode { READ_WRITE , READ_ONLY } |
typedef ::std::function< void(const OUString &, const std::vector< css::uno::Any > &) > | Functor |
This functor is typically called for every item in a set. More... | |
Public Member Functions | |
ConfigurationAccess (const OUString &rsRootName, const WriteMode eMode) | |
Create a new object to access the configuration entries below the given root. More... | |
css::uno::Any | GetConfigurationNode (const OUString &rsPathToNode) |
Return a configuration node below the root of the called object. More... | |
void | CommitChanges () |
Write any changes that have been made back to the configuration. More... | |
Static Public Member Functions | |
static css::uno::Any | GetConfigurationNode (const css::uno::Reference< css::container::XHierarchicalNameAccess > &rxNode, const OUString &rsPathToNode) |
Return a configuration node below the given node. More... | |
Private Member Functions | |
void | Initialize (const css::uno::Reference< css::lang::XMultiServiceFactory > &rxProvider, const OUString &rsRootName, const WriteMode eMode) |
Private Attributes | |
css::uno::Reference< css::uno::XInterface > | mxRoot |
This class gives access to the configuration.
Create an object of this class for one node of the configuration. This will be the root node. Its children are then accessible through the new ConfigurationAccess object.
Definition at line 40 of file ConfigurationAccess.hxx.
typedef ::std::function<void ( const OUString&, const std::vector<css::uno::Any>&) > sd::tools::ConfigurationAccess::Functor |
This functor is typically called for every item in a set.
Its two parameters are the name of key item (often of no further interest) and the value of the item.
Definition at line 93 of file ConfigurationAccess.hxx.
Enumerator | |
---|---|
READ_WRITE | |
READ_ONLY |
Definition at line 43 of file ConfigurationAccess.hxx.
ConfigurationAccess::ConfigurationAccess | ( | const OUString & | rsRootName, |
const WriteMode | eMode | ||
) |
Create a new object to access the configuration entries below the given root.
rsRootName | Name of the root. |
eMode | This flag specifies whether to give read-write or read-only access. |
Definition at line 36 of file ConfigurationAccess.cxx.
References eMode, and Initialize().
void ConfigurationAccess::CommitChanges | ( | ) |
Write any changes that have been made back to the configuration.
This call is ignored when the called ConfigurationAccess object was not create with read-write mode.
Definition at line 104 of file ConfigurationAccess.cxx.
References mxRoot.
Referenced by sd::sidebar::RecentlyUsedMasterPages::SavePersistentValues().
|
static |
Return a configuration node below the given node.
rxNode | The node that acts as root to the given relative path. |
rsPathToNode | The relative path from the given node to the requested node. |
Definition at line 82 of file ConfigurationAccess.cxx.
References Any, Exception, and TOOLS_WARN_EXCEPTION.
Any ConfigurationAccess::GetConfigurationNode | ( | const OUString & | rsPathToNode | ) |
Return a configuration node below the root of the called object.
rsPathToNode | The relative path from the root (as given the constructor) to the node. |
Definition at line 74 of file ConfigurationAccess.cxx.
References Any, GetConfigurationNode(), and mxRoot.
Referenced by GetConfigurationNode(), sd::sidebar::RecentlyUsedMasterPages::LoadPersistentValues(), and sd::sidebar::RecentlyUsedMasterPages::SavePersistentValues().
|
private |
Definition at line 45 of file ConfigurationAccess.cxx.
References Any, DBG_UNHANDLED_EXCEPTION, eMode, Exception, comphelper::InitAnyPropertySequence(), mxRoot, and READ_ONLY.
Referenced by ConfigurationAccess().
|
private |
Definition at line 96 of file ConfigurationAccess.hxx.
Referenced by CommitChanges(), GetConfigurationNode(), and Initialize().