LibreOffice Module unotools (master) 1
confignode.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
23#include <osl/diagnose.h>
24#include <sal/log.hxx>
25#include <com/sun/star/configuration/theDefaultProvider.hpp>
26#include <com/sun/star/lang/XSingleServiceFactory.hpp>
27#include <com/sun/star/lang/XComponent.hpp>
28#include <com/sun/star/util/XChangesBatch.hpp>
29#include <com/sun/star/util/XStringEscape.hpp>
30#include <com/sun/star/lang/XServiceInfo.hpp>
31#include <com/sun/star/container/XNamed.hpp>
32#include <com/sun/star/container/XNameContainer.hpp>
33#include <com/sun/star/container/XHierarchicalNameAccess.hpp>
35
36namespace utl
37{
38
39 using namespace ::com::sun::star::uno;
40 using namespace ::com::sun::star::lang;
41 using namespace ::com::sun::star::util;
42 using namespace ::com::sun::star::beans;
43 using namespace ::com::sun::star::container;
44 using namespace ::com::sun::star::configuration;
45
46 //= OConfigurationNode
47
48 OConfigurationNode::OConfigurationNode(const Reference< XInterface >& _rxNode )
49 :m_bEscapeNames(false)
50 {
51 OSL_ENSURE(_rxNode.is(), "OConfigurationNode::OConfigurationNode: invalid node interface!");
52 if (_rxNode.is())
53 {
54 // collect all interfaces necessary
55 m_xHierarchyAccess.set(_rxNode, UNO_QUERY);
56 m_xDirectAccess.set(_rxNode, UNO_QUERY);
57
58 // reset _all_ interfaces if _one_ of them is not supported
59 if (!m_xHierarchyAccess.is() || !m_xDirectAccess.is())
60 {
61 m_xHierarchyAccess = nullptr;
62 m_xDirectAccess = nullptr;
63 }
64
65 // now for the non-critical interfaces
66 m_xReplaceAccess.set(_rxNode, UNO_QUERY);
67 m_xContainerAccess.set(_rxNode, UNO_QUERY);
68 }
69
70 Reference< XComponent > xConfigNodeComp(m_xDirectAccess, UNO_QUERY);
71 if (xConfigNodeComp.is())
72 startComponentListening(xConfigNodeComp);
73
74 if (isValid())
75 m_bEscapeNames = isSetNode() && Reference< XStringEscape >::query(m_xDirectAccess).is();
76 }
77
78 OConfigurationNode::OConfigurationNode(const OConfigurationNode& _rSource)
80 , m_xHierarchyAccess(_rSource.m_xHierarchyAccess)
81 , m_xDirectAccess(_rSource.m_xDirectAccess)
82 , m_xReplaceAccess(_rSource.m_xReplaceAccess)
83 , m_xContainerAccess(_rSource.m_xContainerAccess)
84 , m_bEscapeNames(_rSource.m_bEscapeNames)
85 {
86 Reference< XComponent > xConfigNodeComp(m_xDirectAccess, UNO_QUERY);
87 if (xConfigNodeComp.is())
88 startComponentListening(xConfigNodeComp);
89 }
90
93 , m_xHierarchyAccess(std::move(_rSource.m_xHierarchyAccess))
94 , m_xDirectAccess(std::move(_rSource.m_xDirectAccess))
95 , m_xReplaceAccess(std::move(_rSource.m_xReplaceAccess))
96 , m_xContainerAccess(std::move(_rSource.m_xContainerAccess))
97 , m_bEscapeNames(std::move(_rSource.m_bEscapeNames))
98 {
99 Reference< XComponent > xConfigNodeComp(m_xDirectAccess, UNO_QUERY);
100 if (xConfigNodeComp.is())
101 startComponentListening(xConfigNodeComp);
102 }
103
105 {
107
113
114 Reference< XComponent > xConfigNodeComp(m_xDirectAccess, UNO_QUERY);
115 if (xConfigNodeComp.is())
116 startComponentListening(xConfigNodeComp);
117
118 return *this;
119 }
120
122 {
124
125 m_xHierarchyAccess = std::move(_rSource.m_xHierarchyAccess);
126 m_xDirectAccess = std::move(_rSource.m_xDirectAccess);
127 m_xContainerAccess = std::move(_rSource.m_xContainerAccess);
128 m_xReplaceAccess = std::move(_rSource.m_xReplaceAccess);
129 m_bEscapeNames = std::move(_rSource.m_bEscapeNames);
130
131 Reference< XComponent > xConfigNodeComp(m_xDirectAccess, UNO_QUERY);
132 if (xConfigNodeComp.is())
133 startComponentListening(xConfigNodeComp);
134
135 return *this;
136 }
137
138 void OConfigurationNode::_disposing( const EventObject& _rSource )
139 {
140 Reference< XComponent > xDisposingSource(_rSource.Source, UNO_QUERY);
141 Reference< XComponent > xConfigNodeComp(m_xDirectAccess, UNO_QUERY);
142 if (xDisposingSource.get() == xConfigNodeComp.get())
143 clear();
144 }
145
147 {
148 OUString sLocalName;
149 try
150 {
151 Reference< XNamed > xNamed( m_xDirectAccess, UNO_QUERY_THROW );
152 sLocalName = xNamed->getName();
153 }
154 catch( const Exception& )
155 {
156 DBG_UNHANDLED_EXCEPTION("unotools");
157 }
158 return sLocalName;
159 }
160
161 OUString OConfigurationNode::normalizeName(const OUString& _rName, NAMEORIGIN _eOrigin) const
162 {
163 OUString sName(_rName);
164 if (m_bEscapeNames)
165 {
166 Reference< XStringEscape > xEscaper(m_xDirectAccess, UNO_QUERY);
167 if (xEscaper.is() && !sName.isEmpty())
168 {
169 try
170 {
171 if (NO_CALLER == _eOrigin)
172 sName = xEscaper->escapeString(sName);
173 else
174 sName = xEscaper->unescapeString(sName);
175 }
176 catch(Exception&)
177 {
178 DBG_UNHANDLED_EXCEPTION("unotools");
179 }
180 }
181 }
182 return sName;
183 }
184
186 {
187 OSL_ENSURE(m_xDirectAccess.is(), "OConfigurationNode::getNodeNames: object is invalid!");
188 Sequence< OUString > aReturn;
189 if (m_xDirectAccess.is())
190 {
191 try
192 {
193 aReturn = m_xDirectAccess->getElementNames();
194 // normalize the names
195 std::transform(std::cbegin(aReturn), std::cend(aReturn), aReturn.getArray(),
196 [this](const OUString& rName) -> OUString { return normalizeName(rName, NO_CONFIGURATION); });
197 }
198 catch(Exception&)
199 {
200 TOOLS_WARN_EXCEPTION( "unotools", "OConfigurationNode::getNodeNames");
201 }
202 }
203
204 return aReturn;
205 }
206
207 bool OConfigurationNode::removeNode(const OUString& _rName) const noexcept
208 {
209 OSL_ENSURE(m_xContainerAccess.is(), "OConfigurationNode::removeNode: object is invalid!");
210 if (m_xContainerAccess.is())
211 {
212 try
213 {
214 OUString sName = normalizeName(_rName, NO_CALLER);
215 m_xContainerAccess->removeByName(sName);
216 return true;
217 }
218 catch (NoSuchElementException&)
219 {
220 SAL_WARN( "unotools", "OConfigurationNode::removeNode: there is no element named: " << _rName );
221 }
222 catch(Exception&)
223 {
224 TOOLS_WARN_EXCEPTION( "unotools", "OConfigurationNode::removeNode");
225 }
226 }
227 return false;
228 }
229
230 OConfigurationNode OConfigurationNode::insertNode(const OUString& _rName,const Reference< XInterface >& _xNode) const noexcept
231 {
232 if(_xNode.is())
233 {
234 try
235 {
236 OUString sName = normalizeName(_rName, NO_CALLER);
237 m_xContainerAccess->insertByName(sName, Any(_xNode));
238 // if we're here, all was ok ...
239 return OConfigurationNode( _xNode );
240 }
241 catch(const Exception&)
242 {
243 DBG_UNHANDLED_EXCEPTION("unotools");
244 }
245
246 // dispose the child if it has already been created, but could not be inserted
247 Reference< XComponent > xChildComp(_xNode, UNO_QUERY);
248 if (xChildComp.is())
249 try { xChildComp->dispose(); } catch(Exception&) { }
250 }
251
252 return OConfigurationNode();
253 }
254
255 OConfigurationNode OConfigurationNode::createNode(const OUString& _rName) const noexcept
256 {
257 Reference< XSingleServiceFactory > xChildFactory(m_xContainerAccess, UNO_QUERY);
258 OSL_ENSURE(xChildFactory.is(), "OConfigurationNode::createNode: object is invalid or read-only!");
259
260 if (xChildFactory.is()) // implies m_xContainerAccess.is()
261 {
262 Reference< XInterface > xNewChild;
263 try
264 {
265 xNewChild = xChildFactory->createInstance();
266 }
267 catch(const Exception&)
268 {
269 DBG_UNHANDLED_EXCEPTION("unotools");
270 }
271 return insertNode(_rName,xNewChild);
272 }
273
274 return OConfigurationNode();
275 }
276
277 OConfigurationNode OConfigurationNode::openNode(const OUString& _rPath) const noexcept
278 {
279 OSL_ENSURE(m_xDirectAccess.is(), "OConfigurationNode::openNode: object is invalid!");
280 OSL_ENSURE(m_xHierarchyAccess.is(), "OConfigurationNode::openNode: object is invalid!");
281 try
282 {
283 OUString sNormalized = normalizeName(_rPath, NO_CALLER);
284
285 Reference< XInterface > xNode;
286 if (m_xDirectAccess.is() && m_xDirectAccess->hasByName(sNormalized))
287 {
288 xNode.set(
289 m_xDirectAccess->getByName(sNormalized), css::uno::UNO_QUERY);
290 if (!xNode.is())
291 OSL_FAIL("OConfigurationNode::openNode: could not open the node!");
292 }
293 else if (m_xHierarchyAccess.is())
294 {
295 xNode.set(
296 m_xHierarchyAccess->getByHierarchicalName(_rPath),
297 css::uno::UNO_QUERY);
298 if (!xNode.is())
299 OSL_FAIL("OConfigurationNode::openNode: could not open the node!");
300 }
301 if (xNode.is())
302 return OConfigurationNode( xNode );
303 }
304 catch(const NoSuchElementException&)
305 {
306 SAL_WARN( "unotools", "OConfigurationNode::openNode: there is no element named " << _rPath );
307 }
308 catch(Exception&)
309 {
310 TOOLS_WARN_EXCEPTION( "unotools", "OConfigurationNode::openNode: caught an exception while retrieving the node!");
311 }
312 return OConfigurationNode();
313 }
314
316 {
317 bool bIsSet = false;
318 Reference< XServiceInfo > xSI(m_xHierarchyAccess, UNO_QUERY);
319 if (xSI.is())
320 {
321 try { bIsSet = xSI->supportsService("com.sun.star.configuration.SetAccess"); }
322 catch(Exception&) { }
323 }
324 return bIsSet;
325 }
326
327 bool OConfigurationNode::hasByHierarchicalName( const OUString& _rName ) const noexcept
328 {
329 OSL_ENSURE( m_xHierarchyAccess.is(), "OConfigurationNode::hasByHierarchicalName: no hierarchy access!" );
330 try
331 {
332 if ( m_xHierarchyAccess.is() )
333 {
334 OUString sName = normalizeName( _rName, NO_CALLER );
335 return m_xHierarchyAccess->hasByHierarchicalName( sName );
336 }
337 }
338 catch(Exception&)
339 {
340 }
341 return false;
342 }
343
344 bool OConfigurationNode::hasByName(const OUString& _rName) const noexcept
345 {
346 OSL_ENSURE(m_xDirectAccess.is(), "OConfigurationNode::hasByName: object is invalid!");
347 try
348 {
349 OUString sName = normalizeName(_rName, NO_CALLER);
350 if (m_xDirectAccess.is())
351 return m_xDirectAccess->hasByName(sName);
352 }
353 catch(Exception&)
354 {
355 }
356 return false;
357 }
358
359 bool OConfigurationNode::setNodeValue(const OUString& _rPath, const Any& _rValue) const noexcept
360 {
361 bool bResult = false;
362
363 OSL_ENSURE(m_xReplaceAccess.is(), "OConfigurationNode::setNodeValue: object is invalid!");
364 if (m_xReplaceAccess.is())
365 {
366 try
367 {
368 // check if _rPath is a level-1 path
369 OUString sNormalizedName = normalizeName(_rPath, NO_CALLER);
370 if (m_xReplaceAccess->hasByName(sNormalizedName))
371 {
372 m_xReplaceAccess->replaceByName(sNormalizedName, _rValue);
373 bResult = true;
374 }
375
376 // check if the name refers to an indirect descendant
377 else if (m_xHierarchyAccess.is() && m_xHierarchyAccess->hasByHierarchicalName(_rPath))
378 {
379 OSL_ASSERT(!_rPath.isEmpty());
380
381 OUString sParentPath, sLocalName;
382
383 if ( splitLastFromConfigurationPath(_rPath, sParentPath, sLocalName) )
384 {
385 OConfigurationNode aParentAccess = openNode(sParentPath);
386 if (aParentAccess.isValid())
387 bResult = aParentAccess.setNodeValue(sLocalName, _rValue);
388 }
389 else
390 {
391 m_xReplaceAccess->replaceByName(sLocalName, _rValue);
392 bResult = true;
393 }
394 }
395
396 }
397 catch(Exception&)
398 {
399 TOOLS_WARN_EXCEPTION( "unotools", "OConfigurationNode::setNodeValue: could not replace the value");
400 }
401
402 }
403 return bResult;
404 }
405
406 Any OConfigurationNode::getNodeValue(const OUString& _rPath) const noexcept
407 {
408 OSL_ENSURE(m_xDirectAccess.is(), "OConfigurationNode::hasByName: object is invalid!");
409 OSL_ENSURE(m_xHierarchyAccess.is(), "OConfigurationNode::hasByName: object is invalid!");
410 Any aReturn;
411 try
412 {
413 OUString sNormalizedPath = normalizeName(_rPath, NO_CALLER);
414 if (m_xDirectAccess.is() && m_xDirectAccess->hasByName(sNormalizedPath) )
415 {
416 aReturn = m_xDirectAccess->getByName(sNormalizedPath);
417 }
418 else if (m_xHierarchyAccess.is())
419 {
420 aReturn = m_xHierarchyAccess->getByHierarchicalName(_rPath);
421 }
422 }
423 catch(const NoSuchElementException&)
424 {
425 DBG_UNHANDLED_EXCEPTION("unotools");
426 }
427 return aReturn;
428 }
429
431 {
432 m_xHierarchyAccess.clear();
433 m_xDirectAccess.clear();
434 m_xReplaceAccess.clear();
435 m_xContainerAccess.clear();
436 }
437
438 //= helper
439
440 namespace
441 {
442
443 Reference< XMultiServiceFactory > lcl_getConfigProvider( const Reference<XComponentContext> & i_rContext )
444 {
445 try
446 {
447 Reference< XMultiServiceFactory > xProvider = theDefaultProvider::get( i_rContext );
448 return xProvider;
449 }
450 catch ( const Exception& )
451 {
452 DBG_UNHANDLED_EXCEPTION("unotools");
453 }
454 return nullptr;
455 }
456
457 Reference< XInterface > lcl_createConfigurationRoot( const Reference< XMultiServiceFactory >& i_rxConfigProvider,
458 const OUString& i_rNodePath, const bool i_bUpdatable, const sal_Int32 i_nDepth )
459 {
460 ENSURE_OR_RETURN( i_rxConfigProvider.is(), "invalid provider", nullptr );
461 try
462 {
464 aArgs.put( "nodepath", i_rNodePath );
465 aArgs.put( "depth", i_nDepth );
466
467 OUString sAccessService( i_bUpdatable ?
468 OUString( "com.sun.star.configuration.ConfigurationUpdateAccess" ) :
469 OUString( "com.sun.star.configuration.ConfigurationAccess" ));
470
471 Reference< XInterface > xRoot(
472 i_rxConfigProvider->createInstanceWithArguments( sAccessService, aArgs.getWrappedPropertyValues() ),
473 UNO_SET_THROW
474 );
475 return xRoot;
476 }
477 catch ( const Exception& )
478 {
479 DBG_UNHANDLED_EXCEPTION("unotools");
480 }
481 return nullptr;
482 }
483 }
484
485 OConfigurationTreeRoot::OConfigurationTreeRoot( const Reference< XInterface >& _rxRootNode )
486 :OConfigurationNode( _rxRootNode )
487 ,m_xCommitter( _rxRootNode, UNO_QUERY )
488 {
489 }
490
491 OConfigurationTreeRoot::OConfigurationTreeRoot( const Reference<XComponentContext> & i_rContext, const OUString& i_rNodePath, const bool i_bUpdatable )
492 :OConfigurationNode( lcl_createConfigurationRoot( lcl_getConfigProvider( i_rContext ),
493 i_rNodePath, i_bUpdatable, -1 ) )
494 ,m_xCommitter()
495 {
496 if ( i_bUpdatable )
497 {
498 m_xCommitter.set( getUNONode(), UNO_QUERY );
499 OSL_ENSURE( m_xCommitter.is(), "OConfigurationTreeRoot::OConfigurationTreeRoot: could not create an updatable node!" );
500 }
501 }
502
504 {
506 m_xCommitter.clear();
507 }
508
509 bool OConfigurationTreeRoot::commit() const noexcept
510 {
511 OSL_ENSURE(isValid(), "OConfigurationTreeRoot::commit: object is invalid!");
512 if (!isValid())
513 return false;
514 OSL_ENSURE(m_xCommitter.is(), "OConfigurationTreeRoot::commit: I'm a readonly node!");
515 if (!m_xCommitter.is())
516 return false;
517
518 try
519 {
520 m_xCommitter->commitChanges();
521 return true;
522 }
523 catch(const Exception&)
524 {
525 DBG_UNHANDLED_EXCEPTION("unotools");
526 }
527 return false;
528 }
529
530 OConfigurationTreeRoot OConfigurationTreeRoot::createWithProvider(const Reference< XMultiServiceFactory >& _rxConfProvider, const OUString& _rPath, sal_Int32 _nDepth, CREATION_MODE _eMode)
531 {
532 Reference< XInterface > xRoot( lcl_createConfigurationRoot(
533 _rxConfProvider, _rPath, _eMode != CM_READONLY, _nDepth ) );
534 if ( xRoot.is() )
535 return OConfigurationTreeRoot( xRoot );
536 return OConfigurationTreeRoot();
537 }
538
539 OConfigurationTreeRoot OConfigurationTreeRoot::createWithComponentContext( const Reference< XComponentContext >& _rxContext, const OUString& _rPath, sal_Int32 _nDepth, CREATION_MODE _eMode )
540 {
541 return createWithProvider( lcl_getConfigProvider( _rxContext ), _rPath, _nDepth, _eMode );
542 }
543
545 const OUString& _rPath, sal_Int32 _nDepth , CREATION_MODE _eMode )
546 {
547 OSL_ENSURE( rxContext.is(), "OConfigurationTreeRoot::tryCreateWithComponentContext: invalid XComponentContext!" );
548 try
549 {
550 Reference< XMultiServiceFactory > xConfigFactory = theDefaultProvider::get( rxContext );
551 return createWithProvider( xConfigFactory, _rPath, _nDepth, _eMode );
552 }
553 catch(const Exception&)
554 {
555 // silence this, 'cause the contract of this method states "no assertions"
556 }
557 return OConfigurationTreeRoot();
558 }
559
560} // namespace utl
561
562/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
css::uno::Sequence< css::uno::Any > getWrappedPropertyValues() const
bool put(const OUString &_rValueName, const VALUE_TYPE &_rValue)
a small wrapper around a configuration node.
Definition: confignode.hxx:41
OUString normalizeName(const OUString &_rName, NAMEORIGIN _eOrigin) const
Definition: confignode.cxx:161
virtual void clear() noexcept
invalidate the object
Definition: confignode.cxx:430
OConfigurationNode insertNode(const OUString &_rName, const css::uno::Reference< css::uno::XInterface > &_xNode) const noexcept
escape names before accessing children ?
Definition: confignode.cxx:230
css::uno::Reference< css::container::XNameReplace > m_xReplaceAccess
accessing children (mandatory interface of our UNO object)
Definition: confignode.hxx:48
bool m_bEscapeNames
modifying set nodes (optional interface of our UNO object)
Definition: confignode.hxx:51
css::uno::Sequence< OUString > getNodeNames() const noexcept
return the names of the existing children
Definition: confignode.cxx:185
bool isValid() const
check if the objects represents a valid configuration node
Definition: confignode.hxx:152
css::uno::Any getNodeValue(const OUString &_rPath) const noexcept
retrieves the content of a descendant
Definition: confignode.cxx:406
OConfigurationNode()
constructs an empty and invalid node object
Definition: confignode.hxx:66
css::uno::Reference< css::container::XHierarchicalNameAccess > m_xHierarchyAccess
Definition: confignode.hxx:44
css::uno::Reference< css::container::XNameContainer > m_xContainerAccess
replacing child values
Definition: confignode.hxx:50
bool hasByName(const OUString &_rName) const noexcept
checks whether or not a direct child with a given name exists
Definition: confignode.cxx:344
bool hasByHierarchicalName(const OUString &_rName) const noexcept
checks whether or not a descendent (no matter if direct or indirect) with the given name exists
Definition: confignode.cxx:327
bool isSetNode() const
checks whether or not the object represents a set node.
Definition: confignode.cxx:315
bool removeNode(const OUString &_rName) const noexcept
remove an existent child nod
Definition: confignode.cxx:207
css::uno::Reference< css::container::XNameAccess > m_xDirectAccess
accessing children grandchildren (mandatory interface of our UNO object)
Definition: confignode.hxx:46
OUString getLocalName() const
returns the local name of the node
Definition: confignode.cxx:146
const css::uno::Reference< css::container::XNameAccess > & getUNONode() const
Definition: confignode.hxx:62
bool setNodeValue(const OUString &_rPath, const css::uno::Any &_rValue) const noexcept
write a node valueThe value given is written into the node specified by the given relative path.
virtual void _disposing(const css::lang::EventObject &_rSource) override
Definition: confignode.cxx:138
OConfigurationNode createNode(const OUString &_rName) const noexcept
create a new child node
Definition: confignode.cxx:255
OConfigurationNode & operator=(const OConfigurationNode &_rSource)
assignment
Definition: confignode.cxx:104
@ NO_CALLER
the name came from a configuration node
Definition: confignode.hxx:165
OConfigurationNode openNode(const OUString &_rPath) const noexcept
open a sub node
Definition: confignode.cxx:277
a specialized version of an OConfigurationNode, representing the root of a configuration sub treeOnly...
Definition: confignode.hxx:178
OConfigurationTreeRoot()
default ctorThe object constructed here is invalid (i.e.
Definition: confignode.hxx:201
static OConfigurationTreeRoot createWithComponentContext(const css::uno::Reference< css::uno::XComponentContext > &_rxContext, const OUString &_rPath, sal_Int32 _nDepth=-1, CREATION_MODE _eMode=CM_UPDATABLE)
open a new top-level configuration nodeopens a new node which is the root if an own configuration sub...
Definition: confignode.cxx:539
css::uno::Reference< css::util::XChangesBatch > m_xCommitter
Definition: confignode.hxx:180
virtual void clear() noexcept override
invalidate the object
Definition: confignode.cxx:503
static OConfigurationTreeRoot createWithProvider(const css::uno::Reference< css::lang::XMultiServiceFactory > &_rxConfProvider, const OUString &_rPath, sal_Int32 _nDepth, CREATION_MODE _eMode)
open a new top-level configuration node
Definition: confignode.cxx:530
CREATION_MODE
modes to use when creating a top-level node object
Definition: confignode.hxx:190
@ CM_READONLY
open the node (i.e. sub tree) for read access only
Definition: confignode.hxx:192
bool commit() const noexcept
commit all changes made on the subtree the object is the root forAll changes made on any OConfigurati...
Definition: confignode.cxx:509
static OConfigurationTreeRoot tryCreateWithComponentContext(const css::uno::Reference< css::uno::XComponentContext > &rxContext, const OUString &_rPath, sal_Int32 _nDepth=-1, CREATION_MODE _eMode=CM_UPDATABLE)
tolerant version of the <member>createWithServiceFactory</member>
Definition: confignode.cxx:544
base class for non-UNO dispose listeners
void startComponentListening(const css::uno::Reference< css::lang::XComponent > &_rxComp)
#define TOOLS_WARN_EXCEPTION(area, stream)
#define ENSURE_OR_RETURN(c, m, r)
#define DBG_UNHANDLED_EXCEPTION(...)
OUString sName
#define SAL_WARN(area, stream)
OUString get(TranslateId sContextAndId, const std::locale &loc)
Definition: resmgr.cxx:211
@ Exception
bool splitLastFromConfigurationPath(std::u16string_view _sInPath, OUString &_rsOutPath, OUString &_rsLocalName)
extract the local nodename and the parent nodepath from a configuration path.
Definition: configpaths.cxx:76