diff options
-rw-r--r-- | configmgr/source/api2/confproviderimpl2.cxx | 14 | ||||
-rw-r--r-- | configmgr/source/api2/providerimpl.cxx | 19 | ||||
-rw-r--r-- | configmgr/source/inc/options.hxx | 40 | ||||
-rw-r--r-- | configmgr/source/inc/strdecl.hxx | 5 | ||||
-rw-r--r-- | configmgr/source/inc/treeactions.hxx | 22 | ||||
-rw-r--r-- | configmgr/source/misc/strimpl.cxx | 5 | ||||
-rw-r--r-- | configmgr/source/tree/cmtree.cxx | 115 | ||||
-rw-r--r-- | configmgr/source/tree/treeactions.cxx | 97 | ||||
-rw-r--r-- | configmgr/source/treemgr/treeimpl.cxx | 7 | ||||
-rw-r--r-- | configmgr/workben/apitest/cfgadmin.cxx | 10 | ||||
-rw-r--r-- | configmgr/workben/apitest/cfgapi.cxx | 27 | ||||
-rw-r--r-- | configmgr/workben/apitest/cfgupdate.cxx | 14 | ||||
-rw-r--r-- | configmgr/workben/local_io/cfgfile.cxx | 8 | ||||
-rw-r--r-- | configmgr/workben/local_io/makefile.mk | 66 | ||||
-rw-r--r-- | configmgr/workben/local_io/org.openoffice.test.xml | 60 | ||||
-rw-r--r-- | configmgr/workben/local_io/simpletest.cxx | 49 |
16 files changed, 311 insertions, 247 deletions
diff --git a/configmgr/source/api2/confproviderimpl2.cxx b/configmgr/source/api2/confproviderimpl2.cxx index a42ee7529d76..472b07e6ae20 100644 --- a/configmgr/source/api2/confproviderimpl2.cxx +++ b/configmgr/source/api2/confproviderimpl2.cxx @@ -2,9 +2,9 @@ * * $RCSfile: confproviderimpl2.cxx,v $ * - * $Revision: 1.8 $ + * $Revision: 1.9 $ * - * last change: $Author: dg $ $Date: 2000-11-13 16:02:38 $ + * last change: $Author: lla $ $Date: 2000-11-29 13:59:46 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -114,11 +114,14 @@ namespace configmgr // extract the args ::rtl::OUString sUser, sPath, sLocale; sal_Int32 nLevels; - OProviderImpl::FactoryArguments::extractArgs(aArgs, sPath, sUser, sLocale, nLevels); + sal_Bool bIsSetupMode = false; + + OProviderImpl::FactoryArguments::extractArgs(aArgs, sPath, sUser, sLocale, nLevels, bIsSetupMode); ::rtl::OUString sNodeAccessor = IConfigSession::composeNodeAccessor(sPath, sUser); // m_pConfiguration->setOptions(getOptions()); getOptions()->add("Locale", sLocale); + getOptions()->setSetupMode(bIsSetupMode); CFG_TRACE_INFO_NI("config provider: node accessor extracted from the args is %s", OUSTRING2ASCII(sNodeAccessor)); CFG_TRACE_INFO_NI("config provider: level depth extracted from the args is %i", nLevels); @@ -149,7 +152,9 @@ namespace configmgr // extract the args sal_Int32 nLevels; ::rtl::OUString sUser, sPath, sLocale; - OProviderImpl::FactoryArguments::extractArgs(aArgs, sPath, sUser, sLocale, nLevels); + sal_Bool bIsSetupMode = false; + + OProviderImpl::FactoryArguments::extractArgs(aArgs, sPath, sUser, sLocale, nLevels, bIsSetupMode); ::rtl::OUString sNodeAccessor = IConfigSession::composeNodeAccessor(sPath, sUser); CFG_TRACE_INFO_NI("config provider: node accessor extracted from the args is %s", OUSTRING2ASCII(sNodeAccessor)); @@ -157,6 +162,7 @@ namespace configmgr // m_pConfiguration->setOptions(getOptions()); getOptions()->add("Locale", sLocale); + getOptions()->setSetupMode(bIsSetupMode); // create the access object uno::Reference< uno::XInterface > xReturn; diff --git a/configmgr/source/api2/providerimpl.cxx b/configmgr/source/api2/providerimpl.cxx index a18a34bbe104..2fdacda3dc60 100644 --- a/configmgr/source/api2/providerimpl.cxx +++ b/configmgr/source/api2/providerimpl.cxx @@ -2,9 +2,9 @@ * * $RCSfile: providerimpl.cxx,v $ * - * $Revision: 1.6 $ + * $Revision: 1.7 $ * - * last change: $Author: jb $ $Date: 2000-11-20 01:30:48 $ + * last change: $Author: lla $ $Date: 2000-11-29 13:59:46 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -392,6 +392,7 @@ namespace configmgr rtl::OUString OProviderImpl::FactoryArguments::sNodePath(ASCII("nodepath")); rtl::OUString OProviderImpl::FactoryArguments::sDepth(ASCII("depth")); rtl::OUString OProviderImpl::FactoryArguments::sLocale(ASCII("locale")); + rtl::OUString OProviderImpl::FactoryArguments::sSetupMode(ASCII("setupmode")); #ifdef DBG_UTIL //----------------------------------------------------------------------------- @@ -405,6 +406,7 @@ namespace configmgr aArgs.insert(OProviderImpl::FactoryArguments::sNodePath); aArgs.insert(OProviderImpl::FactoryArguments::sDepth); aArgs.insert(OProviderImpl::FactoryArguments::sLocale); + aArgs.insert(OProviderImpl::FactoryArguments::sSetupMode); } HashSet::const_iterator it = aArgs.find(rName); @@ -447,10 +449,11 @@ namespace configmgr //----------------------------------------------------------------------------------- void OProviderImpl::FactoryArguments::extractArgs(const uno::Sequence<uno::Any>& _rArgs, - OUString& /* [out] */ _rNodeAccessor, - OUString& /* [out] */ _rUser, - OUString& /* [out] */ _rLocale, - sal_Int32& /* [out] */ _nLevels) + OUString& /* [out] */ _rNodeAccessor, + OUString& /* [out] */ _rUser, + OUString& /* [out] */ _rLocale, + sal_Int32& /* [out] */ _nLevels, + sal_Bool& /* [out] */ _bIsSetupMode) throw (lang::IllegalArgumentException) { @@ -458,6 +461,7 @@ namespace configmgr checkArgs(_rArgs); #endif ::rtl::OUString sUser, sPath, sLocale; + sal_Bool bSetupMode; sal_Int32 nLevelDepth = ITreeProvider::ALL_LEVELS; // the args have to be a sequence of property values, currently three property names are recognized @@ -477,6 +481,8 @@ namespace configmgr bExtractSuccess = (aCurrent.Value >>= nLevelDepth); else if (aCurrent.Name.equalsIgnoreCase(OProviderImpl::FactoryArguments::sLocale)) bExtractSuccess = (aCurrent.Value >>= sLocale); + else if (aCurrent.Name.equalsIgnoreCase(OProviderImpl::FactoryArguments::sSetupMode)) + bExtractSuccess = (aCurrent.Value >>= bSetupMode); /* #ifdef DBG_UTIL else @@ -525,6 +531,7 @@ namespace configmgr _nLevels = nLevelDepth; _rLocale = sLocale; _rUser = sUser; + _bIsSetupMode = bSetupMode; } } // namespace configmgr diff --git a/configmgr/source/inc/options.hxx b/configmgr/source/inc/options.hxx index 7697179213c1..f26c76118500 100644 --- a/configmgr/source/inc/options.hxx +++ b/configmgr/source/inc/options.hxx @@ -2,9 +2,9 @@ * * $RCSfile: options.hxx,v $ * - * $Revision: 1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: lla $ $Date: 2000-11-13 13:14:07 $ + * last change: $Author: lla $ $Date: 2000-11-29 13:59:48 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -66,6 +66,10 @@ #include <com/sun/star/uno/Any.hxx> #include "hashhelper.hxx" +#ifndef CONFIGMGR_TYPECONVERTER_HXX +#include "typeconverter.hxx" +#endif + #ifndef ASCII #define ASCII(x) OUString::createFromAscii(x) #endif @@ -76,6 +80,7 @@ namespace configmgr { namespace css = ::com::sun::star; namespace uno = css::uno; + namespace script = css::script; class OptionValue { rtl::OUString m_aName; @@ -106,8 +111,14 @@ namespace configmgr class OOptions : public vos::OReference { HashMapAny m_aHashMap; +#ifdef LLA_PRIVAT_DEBUG + rtl::OUString m_aLocale; +#endif + uno::Reference<script::XTypeConverter> m_aTypeConverter; + sal_Bool m_bIsSetupMode; public: OOptions() + :m_bIsSetupMode(false) {} void add(const rtl::OUString &_aName, const uno::Any& _aValue) @@ -125,6 +136,12 @@ namespace configmgr uno::Any aAny; aAny <<= _aValueAsString; m_aHashMap[ASCII(_pChar)] = aAny; +#ifdef LLA_PRIVAT_DEBUG + if (stricmp(_pChar, "Locale")) + { + m_aLocale = _aValueAsString; + } +#endif } rtl::OUString getLocale() @@ -139,6 +156,25 @@ namespace configmgr return ASCII("en-US"); // Fallback Language } + void setTypeConverter(const uno::Reference<script::XTypeConverter> &_aConverter) + { + m_aTypeConverter = _aConverter; + } + uno::Reference<script::XTypeConverter> getTypeConverter() + { + OSL_ENSHURE(m_aTypeConverter.is(), "Warning, no TypeConverter set in the options."); + return m_aTypeConverter; + } + + sal_Bool isSetupMode() + { + return m_bIsSetupMode; + } + void setSetupMode(sal_Bool _bMode) + { + m_bIsSetupMode = _bMode; + } + // vos::OReference implements acquire and release // ... }; diff --git a/configmgr/source/inc/strdecl.hxx b/configmgr/source/inc/strdecl.hxx index 218d052ec110..ccf652adbeaf 100644 --- a/configmgr/source/inc/strdecl.hxx +++ b/configmgr/source/inc/strdecl.hxx @@ -2,9 +2,9 @@ * * $RCSfile: strdecl.hxx,v $ * - * $Revision: 1.6 $ + * $Revision: 1.7 $ * - * last change: $Author: dg $ $Date: 2000-11-23 12:22:09 $ + * last change: $Author: lla $ $Date: 2000-11-29 13:59:48 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -110,6 +110,7 @@ namespace configmgr DECLARE_CONSTASCII_USTRING(ATTR_NULLABLE); DECLARE_CONSTASCII_USTRING(ATTR_STATE); DECLARE_CONSTASCII_USTRING(ATTR_WRITABLE); + DECLARE_CONSTASCII_USTRING(ATTR_VALUE_DEFAULT); DECLARE_CONSTASCII_USTRING(ATTR_VALUE_TRUE); DECLARE_CONSTASCII_USTRING(ATTR_VALUE_FALSE); diff --git a/configmgr/source/inc/treeactions.hxx b/configmgr/source/inc/treeactions.hxx index 53e022aa3aee..16049092a19a 100644 --- a/configmgr/source/inc/treeactions.hxx +++ b/configmgr/source/inc/treeactions.hxx @@ -2,9 +2,9 @@ * * $RCSfile: treeactions.hxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: dg $ $Date: 2000-11-23 13:00:05 $ + * last change: $Author: lla $ $Date: 2000-11-29 13:59:48 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -165,6 +165,24 @@ private: NameList aList; }; +// --------------------------------- TreeUpdate --------------------------------- + +class TreeUpdate : public ChangeTreeModification +{ + ISubtree* m_pCurrentSubtree; +#if DBUG + std::vector<OString> aLog; +#endif + +public: + TreeUpdate(ISubtree* pSubtree):m_pCurrentSubtree(pSubtree){} + + void handle(ValueChange& aValueNode); + void handle(AddNode& aAddNode); + void handle(RemoveNode& aRemoveNode); + void handle(SubtreeChange& aSubtree); +}; + //.......................................................................... } // namespace configmgr //.......................................................................... diff --git a/configmgr/source/misc/strimpl.cxx b/configmgr/source/misc/strimpl.cxx index 8a0389cd24ee..e7fb7dd8c9a9 100644 --- a/configmgr/source/misc/strimpl.cxx +++ b/configmgr/source/misc/strimpl.cxx @@ -2,9 +2,9 @@ * * $RCSfile: strimpl.cxx,v $ * - * $Revision: 1.6 $ + * $Revision: 1.7 $ * - * last change: $Author: dg $ $Date: 2000-11-23 11:59:25 $ + * last change: $Author: lla $ $Date: 2000-11-29 13:59:51 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -117,6 +117,7 @@ namespace configmgr IMPLEMENT_CONSTASCII_USTRING(ATTR_SEPARATOR, "cfg:separator"); IMPLEMENT_CONSTASCII_USTRING(ATTR_NULL, "xsi:null"); IMPLEMENT_CONSTASCII_USTRING(ATTR_NULLABLE, "cfg:nullable"); + IMPLEMENT_CONSTASCII_USTRING(ATTR_VALUE_DEFAULT, "default"); // boolean constants IMPLEMENT_CONSTASCII_USTRING(ATTR_VALUE_TRUE,"true"); diff --git a/configmgr/source/tree/cmtree.cxx b/configmgr/source/tree/cmtree.cxx index 28b5dcbb3269..48afad595405 100644 --- a/configmgr/source/tree/cmtree.cxx +++ b/configmgr/source/tree/cmtree.cxx @@ -2,9 +2,9 @@ * * $RCSfile: cmtree.cxx,v $ * - * $Revision: 1.10 $ + * $Revision: 1.11 $ * - * last change: $Author: dg $ $Date: 2000-11-23 16:37:16 $ + * last change: $Author: lla $ $Date: 2000-11-29 13:59:53 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -74,6 +74,7 @@ #include "cmtree.hxx" #include "confname.hxx" // Iterator for PathName scans #include "cmtreemodel.hxx" +#include "treeactions.hxx" #include <com/sun/star/uno/Any.hxx> @@ -427,116 +428,6 @@ namespace configmgr } }; - // --------------------------------- updateTree --------------------------------- - class TreeUpdate : public ChangeTreeModification - { - ISubtree* m_pCurrentSubtree; -#if DBUG - std::vector<OString> aLog; -#endif - - public: - TreeUpdate(ISubtree* pSubtree):m_pCurrentSubtree(pSubtree){} - - void handle(ValueChange& aValueNode); - void handle(AddNode& aAddNode); - void handle(RemoveNode& aRemoveNode); - void handle(SubtreeChange& aSubtree); - }; - - void TreeUpdate::handle(ValueChange& aValueNode) - { - // Change a Value - OSL_ENSURE(m_pCurrentSubtree,"Cannot apply ValueChange without subtree"); - - INode* pBaseNode = m_pCurrentSubtree ? m_pCurrentSubtree->getChild(aValueNode.getNodeName()) : 0; - OSL_ENSURE(pBaseNode,"Cannot apply Change: No node to change"); - - ValueNode* pValue = pBaseNode ? pBaseNode->asValueNode() : 0; - OSL_ENSURE(pValue,"Cannot apply ValueChange: Node is not a value"); - - if (pValue) - aValueNode.applyTo(*pValue); -#ifdef DBUG - else - { - ::rtl::OString aStr("TreeUpdate: Can't find value with name:="); - aStr += rtl::OUStringToOString(aValueNode.getNodeName(),RTL_TEXTENCODING_ASCII_US); - OSL_ENSHURE(pValue, aStr.getStr()); - aLog.push_back(aStr); - } -#endif - } - - void TreeUpdate::handle(AddNode& aAddNode) - { - // Add a new Value - if (m_pCurrentSubtree) - { - if (aAddNode.isReplacing()) - { - std::auto_ptr<INode> aOldNode = m_pCurrentSubtree->removeChild(aAddNode.getNodeName()); - -#ifdef DBUG - OSL_ENSHURE(aOldNode.get(), "TreeUpdate:AddNode: can't recover node being replaced"); - if (aOldNode.get() == NULL) - aLog.push_back(OString("TreeUpdate: can't recover node being replaced (for AddNode)")); -#endif - - aAddNode.takeReplacedNode( aOldNode ); - } - - m_pCurrentSubtree->addChild(aAddNode.releaseAddedNode()); - } -#ifdef DBUG - else - aLog.push_back(OString("TreeUpdate: no CurrentSubtree for AddNode")); -#endif - - } - - void TreeUpdate::handle(RemoveNode& aRemoveNode) - { - // remove a Value - if (m_pCurrentSubtree) - { - std::auto_ptr<INode> aOldNode = m_pCurrentSubtree->removeChild(aRemoveNode.getNodeName()); - - sal_Bool bOk = (NULL != aOldNode.get()); - aRemoveNode.takeRemovedNode( aOldNode ); - -#ifdef DBUG - if (!bOk) - { - ::rtl::OString aStr("TreeUpdate: Can't remove child with name:="); - aStr += rtl::OUStringToOString(aRemoveNode.getNodeName(),RTL_TEXTENCODING_ASCII_US); - OSL_ENSHURE(bOk, aStr.getStr()); - aLog.push_back(aStr); - } -#endif - } - } - - - void TreeUpdate::handle(SubtreeChange& aSubtree) - { - // handle traversion - ISubtree *pOldSubtree = m_pCurrentSubtree; - OSL_ENSHURE(m_pCurrentSubtree->getChild(aSubtree.getNodeName()), "TreeUpdate::handle : invalid subtree change ... this will crash !"); - m_pCurrentSubtree = m_pCurrentSubtree->getChild(aSubtree.getNodeName())->asISubtree(); - -#if DBUG - ::rtl::OString aStr("TreeUpdate: there is no Subtree for name:="); - aStr += rtl::OUStringToOString(aSubtree.getNodeName(),RTL_TEXTENCODING_ASCII_US); - OSL_ENSHURE(m_pCurrentSubtree, aStr.getStr()); - if (!m_pCurrentSubtree) - aLog.push_back(aStr); -#endif - - aSubtree.forEachChange(*this); - m_pCurrentSubtree = pOldSubtree; - } - //-------------------------------------------------------------------------- void Subtree::setLevel(sal_Int16 _nLevel) diff --git a/configmgr/source/tree/treeactions.cxx b/configmgr/source/tree/treeactions.cxx index e3fc24adb25a..35a9b3826523 100644 --- a/configmgr/source/tree/treeactions.cxx +++ b/configmgr/source/tree/treeactions.cxx @@ -2,9 +2,9 @@ * * $RCSfile: treeactions.cxx,v $ * - * $Revision: 1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: dg $ $Date: 2000-11-23 12:03:33 $ + * last change: $Author: lla $ $Date: 2000-11-29 13:59:53 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -297,6 +297,99 @@ void OCreateSubtreeAction::handle(AddNode& _rChange) m_pTree->addChild(aNewNode); } + // --------------------------------- updateTree --------------------------------- + void TreeUpdate::handle(ValueChange& aValueNode) + { + // Change a Value + OSL_ENSURE(m_pCurrentSubtree,"Cannot apply ValueChange without subtree"); + + INode* pBaseNode = m_pCurrentSubtree ? m_pCurrentSubtree->getChild(aValueNode.getNodeName()) : 0; + OSL_ENSURE(pBaseNode,"Cannot apply Change: No node to change"); + + ValueNode* pValue = pBaseNode ? pBaseNode->asValueNode() : 0; + OSL_ENSURE(pValue,"Cannot apply ValueChange: Node is not a value"); + + if (pValue) + aValueNode.applyTo(*pValue); +#ifdef DBUG + else + { + ::rtl::OString aStr("TreeUpdate: Can't find value with name:="); + aStr += rtl::OUStringToOString(aValueNode.getNodeName(),RTL_TEXTENCODING_ASCII_US); + OSL_ENSHURE(pValue, aStr.getStr()); + aLog.push_back(aStr); + } +#endif + } + + void TreeUpdate::handle(AddNode& aAddNode) + { + // Add a new Value + if (m_pCurrentSubtree) + { + if (aAddNode.isReplacing()) + { + std::auto_ptr<INode> aOldNode = m_pCurrentSubtree->removeChild(aAddNode.getNodeName()); + +#ifdef DBUG + OSL_ENSHURE(aOldNode.get(), "TreeUpdate:AddNode: can't recover node being replaced"); + if (aOldNode.get() == NULL) + aLog.push_back(OString("TreeUpdate: can't recover node being replaced (for AddNode)")); +#endif + + aAddNode.takeReplacedNode( aOldNode ); + } + + m_pCurrentSubtree->addChild(aAddNode.releaseAddedNode()); + } +#ifdef DBUG + else + aLog.push_back(OString("TreeUpdate: no CurrentSubtree for AddNode")); +#endif + + } + + void TreeUpdate::handle(RemoveNode& aRemoveNode) + { + // remove a Value + if (m_pCurrentSubtree) + { + std::auto_ptr<INode> aOldNode = m_pCurrentSubtree->removeChild(aRemoveNode.getNodeName()); + + sal_Bool bOk = (NULL != aOldNode.get()); + aRemoveNode.takeRemovedNode( aOldNode ); + +#ifdef DBUG + if (!bOk) + { + ::rtl::OString aStr("TreeUpdate: Can't remove child with name:="); + aStr += rtl::OUStringToOString(aRemoveNode.getNodeName(),RTL_TEXTENCODING_ASCII_US); + OSL_ENSHURE(bOk, aStr.getStr()); + aLog.push_back(aStr); + } +#endif + } + } + + + void TreeUpdate::handle(SubtreeChange& aSubtree) + { + // handle traversion + ISubtree *pOldSubtree = m_pCurrentSubtree; + OSL_ENSHURE(m_pCurrentSubtree->getChild(aSubtree.getNodeName()), "TreeUpdate::handle : invalid subtree change ... this will crash !"); + m_pCurrentSubtree = m_pCurrentSubtree->getChild(aSubtree.getNodeName())->asISubtree(); + +#if DBUG + ::rtl::OString aStr("TreeUpdate: there is no Subtree for name:="); + aStr += rtl::OUStringToOString(aSubtree.getNodeName(),RTL_TEXTENCODING_ASCII_US); + OSL_ENSHURE(m_pCurrentSubtree, aStr.getStr()); + if (!m_pCurrentSubtree) + aLog.push_back(aStr); +#endif + + aSubtree.forEachChange(*this); + m_pCurrentSubtree = pOldSubtree; + } //.......................................................................... } // namespace configmgr diff --git a/configmgr/source/treemgr/treeimpl.cxx b/configmgr/source/treemgr/treeimpl.cxx index 2f5ae2c55009..813432a9f272 100644 --- a/configmgr/source/treemgr/treeimpl.cxx +++ b/configmgr/source/treemgr/treeimpl.cxx @@ -2,9 +2,9 @@ * * $RCSfile: treeimpl.cxx,v $ * - * $Revision: 1.9 $ + * $Revision: 1.10 $ * - * last change: $Author: jb $ $Date: 2000-11-20 03:11:02 $ + * last change: $Author: lla $ $Date: 2000-11-29 13:59:55 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -311,7 +311,8 @@ void TreeImpl::build(NodeFactory& rFactory, INode& rCacheNode, TreeDepth nDepth, { OSL_ASSERT(m_aNodes.empty()); m_nDepth = nDepth; - TreeImplBuilder(aTemplateProvider, rFactory,*this).applyToNode(rCacheNode); + TreeImplBuilder a(aTemplateProvider, rFactory,*this); + a.applyToNode(rCacheNode); } //----------------------------------------------------------------------------- diff --git a/configmgr/workben/apitest/cfgadmin.cxx b/configmgr/workben/apitest/cfgadmin.cxx index b3ba70098267..d88db6c44557 100644 --- a/configmgr/workben/apitest/cfgadmin.cxx +++ b/configmgr/workben/apitest/cfgadmin.cxx @@ -2,9 +2,9 @@ * * $RCSfile: cfgadmin.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: dg $ $Date: 2000-11-17 08:30:26 $ + * last change: $Author: lla $ $Date: 2000-11-29 13:59:55 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -475,7 +475,7 @@ int _cdecl main( int argc, char * argv[] ) ); if (!xORB.is()) { - flush(cout); + ::flush(cout); cerr << "Could not create the service factory !\n\n"; return 1; } @@ -491,7 +491,7 @@ int _cdecl main( int argc, char * argv[] ) if (!xCfgProvider.is()) { - flush(cout); + ::flush(cout); cerr << "Could not create the configuration provider !\n\n"; return 3; } @@ -541,7 +541,7 @@ int _cdecl main( int argc, char * argv[] ) } catch (Exception& e) { - flush(cout); + ::flush(cout); cerr << "Caught exception: " << e.Message << endl; return 1; } diff --git a/configmgr/workben/apitest/cfgapi.cxx b/configmgr/workben/apitest/cfgapi.cxx index fd3512b66544..fb371b7a8c2c 100644 --- a/configmgr/workben/apitest/cfgapi.cxx +++ b/configmgr/workben/apitest/cfgapi.cxx @@ -2,9 +2,9 @@ * * $RCSfile: cfgapi.cxx,v $ * - * $Revision: 1.6 $ + * $Revision: 1.7 $ * - * last change: $Author: lla $ $Date: 2000-11-23 14:45:39 $ + * last change: $Author: lla $ $Date: 2000-11-29 13:59:55 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -317,12 +317,12 @@ int _cdecl main( int argc, char * argv[] ) cout << endl; - rtl::OUString sFilePath; rtl::OUString sUser; if (!sServerType.equalsIgnoreCase(ASCII("local"))) { - sFilePath = enterValue("Enter Server: ", "lautrec-3108:19205",false); + rtl::OUString sServer; + sServer = enterValue("Enter Server: ", "lautrec-3108:19205",false); cout << endl; sUser = enterValue(" Enter User: ", "lars", false); @@ -334,7 +334,7 @@ int _cdecl main( int argc, char * argv[] ) aCPArgs = createSequence(sUser, sPasswd); aCPArgs.realloc(aCPArgs.getLength() + 1); - aCPArgs[aCPArgs.getLength() - 1] <<= configmgr::createPropertyValue(ASCII("server"), sFilePath); + aCPArgs[aCPArgs.getLength() - 1] <<= configmgr::createPropertyValue(ASCII("server"), sServer); OUString sTimeout = ASCII("10000"); aCPArgs.realloc(aCPArgs.getLength() + 1); @@ -343,13 +343,19 @@ int _cdecl main( int argc, char * argv[] ) } else { - sFilePath = enterValue("Enter Filepath: ", "f:/local/613/SRC613/configmgr/workben/local_io",false); + rtl::OUString sSharePath, sUserPath; + // sFilePath = enterValue("Enter Filepath: ", "f:/local/613/SRC613/configmgr/workben/local_io",false); + sSharePath = enterValue("Enter Share Path: ", "f:/local/613/SRC613/configmgr/workben/local_io/share",false); + cout << endl; + sUserPath = enterValue("Enter User Path: ", "f:/local/613/SRC613/configmgr/workben/local_io",false); // sFilePath = enterValue("Enter Filepath: ", "d:/local/609/SRC609/configmgr/workben/local_io",false); // sFilePath = enterValue("Enter Filepath: ", "f:/office60/user/config/registry", false); cout << endl; aCPArgs.realloc(aCPArgs.getLength() + 1); - aCPArgs[aCPArgs.getLength() - 1] <<= configmgr::createPropertyValue(ASCII("rootpath"), sFilePath); + aCPArgs[aCPArgs.getLength() - 1] <<= configmgr::createPropertyValue(ASCII("sharepath"), sSharePath); + aCPArgs.realloc(aCPArgs.getLength() + 1); + aCPArgs[aCPArgs.getLength() - 1] <<= configmgr::createPropertyValue(ASCII("userpath"), sUserPath); } aCPArgs.realloc(aCPArgs.getLength() + 1); @@ -381,6 +387,8 @@ int _cdecl main( int argc, char * argv[] ) cout << endl; OUString sLocale = enterValue("Enter Locale: ", "de-DE", false); cout << endl; + OUString sSetup = enterValue("SetupMode: ", "true", false); + cout << endl; Sequence< Any > aArgs; aArgs = createSequence(sUser, ASCII("")); @@ -389,6 +397,11 @@ int _cdecl main( int argc, char * argv[] ) aArgs[aArgs.getLength() - 1] <<= configmgr::createPropertyValue(ASCII("nodepath"), sPath); aArgs.realloc(aArgs.getLength() + 1); aArgs[aArgs.getLength() - 1] <<= configmgr::createPropertyValue(ASCII("locale"), sLocale); + sal_Bool bSetupMode = false; + if (sSetup.equals(ASCII("true"))) + bSetupMode = true; + aArgs.realloc(aArgs.getLength() + 1); + aArgs[aArgs.getLength() - 1] <<= configmgr::createPropertyValue(ASCII("setupmode"), bSetupMode); /* #else OUString aStr = ASCII("String"); diff --git a/configmgr/workben/apitest/cfgupdate.cxx b/configmgr/workben/apitest/cfgupdate.cxx index cc03d616b3c9..6cfe0c9b6f9a 100644 --- a/configmgr/workben/apitest/cfgupdate.cxx +++ b/configmgr/workben/apitest/cfgupdate.cxx @@ -2,9 +2,9 @@ * * $RCSfile: cfgupdate.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: dg $ $Date: 2000-11-17 08:30:26 $ + * last change: $Author: lla $ $Date: 2000-11-29 13:59:55 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -359,7 +359,7 @@ void displayTree(Reference< XNameAccess > xIFace, sal_Int32 nLevel) cout << "<" << aNames[i] << "/>"; } - flush(cout); + ::flush(cout); } // ----------------------------------------------------------------------------- @@ -395,7 +395,7 @@ int _cdecl main( int argc, char * argv[] ) ); if (!xORB.is()) { - flush(cout); + ::flush(cout); cerr << "Could not create the service factory !\n\n"; return 1; } @@ -426,7 +426,7 @@ int _cdecl main( int argc, char * argv[] ) UNO_QUERY); if (!xCfgProvider.is()) { - flush(cout); + ::flush(cout); cerr << "Could not create the configuration provider !\n\n"; return 3; } @@ -459,13 +459,13 @@ int _cdecl main( int argc, char * argv[] ) } catch (Exception& e) { - flush(cout); + ::flush(cout); cerr << "Caught exception: " << e.Message << endl; } /* catch (...) { - flush(cout); + ::flush(cout); cerr << "BUG: Caught UNKNOWN exception (?) " << endl; } */ diff --git a/configmgr/workben/local_io/cfgfile.cxx b/configmgr/workben/local_io/cfgfile.cxx index 1662454eaf28..ead55030d169 100644 --- a/configmgr/workben/local_io/cfgfile.cxx +++ b/configmgr/workben/local_io/cfgfile.cxx @@ -2,9 +2,9 @@ * * $RCSfile: cfgfile.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: lla $ $Date: 2000-11-13 13:15:42 $ + * last change: $Author: lla $ $Date: 2000-11-29 13:59:56 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -87,6 +87,7 @@ namespace configmgr void classTest(); void hash_test(); void testRefs(); + void ConfigName(); } @@ -111,7 +112,8 @@ int main( int argc, char * argv[] ) // configmgr::hash_test(); - configmgr::testRefs(); + // configmgr::testRefs(); + configmgr::ConfigName(); return 0; } diff --git a/configmgr/workben/local_io/makefile.mk b/configmgr/workben/local_io/makefile.mk index 9d7914c565ef..a3c196207dd1 100644 --- a/configmgr/workben/local_io/makefile.mk +++ b/configmgr/workben/local_io/makefile.mk @@ -2,9 +2,9 @@ # # $RCSfile: makefile.mk,v $ # -# $Revision: 1.2 $ +# $Revision: 1.3 $ # -# last change: $Author: lla $ $Date: 2000-11-03 11:56:30 $ +# last change: $Author: lla $ $Date: 2000-11-29 13:59:56 $ # # The Contents of this file are made available subject to the terms of # either of the following licenses @@ -65,7 +65,7 @@ PRJINC=$(PRJ)$/source PRJNAME=configmgr -TARGET=cfglocal +TARGET=cfgfile TARGETTYPE=CUI LIBTARGET=NO @@ -99,7 +99,7 @@ APP1STDLIBS+=$(LIBCIMT) .ENDIF -APP1TARGET= cfgfile +APP1TARGET= $(TARGET) APP1OBJS= \ $(SLO)$/cfgfile.obj \ @@ -109,12 +109,12 @@ APP1OBJS= \ $(SLO)$/filehelper.obj \ $(SLO)$/simpletest.obj \ $(SLO)$/strimpl.obj \ + $(SLO)$/confname.obj \ # $(SLO)$/xmltreebuilder.obj \ # $(SLO)$/cmtree.obj \ # $(SLO)$/cmtreemodel.obj \ # $(SLO)$/typeconverter.obj \ -# $(SLO)$/confname.obj \ # $(SLO)$/changes.obj \ # $(SLO)$/xmlformater.obj \ # $(SLO)$/attributes.obj \ @@ -122,34 +122,34 @@ APP1OBJS= \ # ... common for all test executables .............................. -APP2STDLIBS = $(APPSTDLIBS) - -APP2STDLIBS+=$(STDLIBCPP) - -.IF "$(GUI)"=="WNT" -APP2STDLIBS+=$(LIBCIMT) -.ENDIF - -APP2TARGET= $(TARGET) -APP2OBJS= \ - $(SLO)$/cfglocal.obj \ - $(SLO)$/receivethread.obj \ - $(SLO)$/redirector.obj \ - $(SLO)$/socketstream.obj \ - $(SLO)$/attributes.obj \ - $(SLO)$/localsession.obj \ - $(SLO)$/saxtools.obj \ - $(SLO)$/mergeupdates.obj \ - $(SLO)$/oslstream.obj \ - $(SLO)$/configsession.obj \ - $(SLO)$/confname.obj \ - $(SLO)$/sessionstream.obj \ - $(SLO)$/filehelper.obj \ - $(SLO)$/tracer.obj \ - $(SLO)$/updatedom.obj \ - $(SLO)$/strconverter.obj \ - $(SLO)$/strimpl.obj \ - +# APP2STDLIBS = $(APPSTDLIBS) +# +# APP2STDLIBS+=$(STDLIBCPP) +# +# .IF "$(GUI)"=="WNT" +# APP2STDLIBS+=$(LIBCIMT) +# .ENDIF +# +# APP2TARGET= cfglocal +# APP2OBJS= \ +# $(SLO)$/cfglocal.obj \ +# $(SLO)$/receivethread.obj \ +# $(SLO)$/redirector.obj \ +# $(SLO)$/socketstream.obj \ +# $(SLO)$/attributes.obj \ +# $(SLO)$/localsession.obj \ +# $(SLO)$/saxtools.obj \ +# $(SLO)$/mergeupdates.obj \ +# $(SLO)$/oslstream.obj \ +# $(SLO)$/configsession.obj \ +# $(SLO)$/confname.obj \ +# $(SLO)$/sessionstream.obj \ +# $(SLO)$/filehelper.obj \ +# $(SLO)$/tracer.obj \ +# $(SLO)$/updatedom.obj \ +# $(SLO)$/strconverter.obj \ +# $(SLO)$/strimpl.obj \ +# .INCLUDE : target.mk diff --git a/configmgr/workben/local_io/org.openoffice.test.xml b/configmgr/workben/local_io/org.openoffice.test.xml index e1db3490dee0..5ecc2d71a198 100644 --- a/configmgr/workben/local_io/org.openoffice.test.xml +++ b/configmgr/workben/local_io/org.openoffice.test.xml @@ -1,55 +1,5 @@ -<?xml version='1.0' encoding='UTF-8'?> - -<org.openoffice.test -xmlns="http://openoffice.org/2000/registry/components/org.openoffice.Inet" -xmlns:cfg="http://openoffice.org/2000/registry/instance" -xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xml:lang="en-US"> - -<!-- long --> - <Long cfg:type="long">100000000000000</Long> - -<!-- double --> - <DoubleWithDot cfg:type="double">.787564</DoubleWithDot> - <EuroDM cfg:type="double">1.95583</EuroDM> - <ZeroDotZeroZeroOne cfg:type="double">0.001</ZeroDotZeroZeroOne> - <ZeroDotOne cfg:type="double">0.1</ZeroDotOne> - <NZeroDotOne cfg:type="double">-0.1</NZeroDotOne> - -<!-- binary --> - <Binary cfg:type="binary" cfg:nullable="true" xsi:null="true"/> - -<!-- Strings --> - <NullString cfg:type="string" xsi:null="true"/> - <String cfg:type="string">Identifier</String> - <StringList cfg:type="string" cfg:derivedBy="list">file:/ private:explorer private:help private:newmenu private:schedule private:searchfolder private:user</StringList> - <List cfg:type="string" cfg:derivedBy="list">NULL</List> - <PathAutoCorrect cfg:type="string" cfg:separator=":" cfg:derivedBy="list">$(inst)/share/autocorr:$(user)/autocorr</PathAutoCorrect> - <List2 cfg:type="string" cfg:derivedBy="list" cfg:separator="stupid" >NULLstupidFIRSTstupidSECONDstupid</List2> - <SeparatorKiller cfg:type="string" cfg:derivedBy="list" cfg:separator="." > .,.;.:.#.|.a._.!.$.%./.(.)=.?.+.*.#.~.'.\.{.}._</SeparatorKiller> - <LocaleString cfg:type="string" cfg:localized="true"> - <default:data xml:lang="en-US">This is a string</default:data> - <default:data xml:lang="de-DE">Dies ist ein String</default:data> - </LocaleString> - -<!-- boolean --> - <BoolFalse cfg:type="boolean">false</BoolFalse> - <BoolTrue cfg:type="boolean">true</BoolTrue> - <BoolNULL cfg:type="boolean" xsi:null="true"/> - -<!-- int --> - <Integer cfg:type="int">0</Integer> - <IntegerNullWithXsi cfg:type="int" xsi:null="true">10</IntegerNullWithXsi> - <IntegerNull cfg:type="int"/> - - <IntList cfg:type="int" cfg:derivedBy="list">224 226 222 223 5</IntList> - -<!-- short --> - <Short cfg:type="short">100</Short> - - <Inner> - <Inner2> - <IntList cfg:type="int" cfg:derivedBy="list">224 226 222 223 5</IntList> - </Inner2> - </Inner> - -</org.openoffice.test> +<?xml version="1.0" encoding="UTF-8"?> +<org.openoffice.test> + <first> + <BoolFalse cfg:type="boolean">true</BoolFalse></first> +</org.openoffice.test>
\ No newline at end of file diff --git a/configmgr/workben/local_io/simpletest.cxx b/configmgr/workben/local_io/simpletest.cxx index a7a7d7747810..19ade211f8ce 100644 --- a/configmgr/workben/local_io/simpletest.cxx +++ b/configmgr/workben/local_io/simpletest.cxx @@ -2,9 +2,9 @@ * * $RCSfile: simpletest.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: lla $ $Date: 2000-11-13 13:15:42 $ + * last change: $Author: lla $ $Date: 2000-11-29 13:59:56 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -172,6 +172,8 @@ #include "strdecl.hxx" #endif +#include "confname.hxx" + // ----------------------------------------------------------------------------- // --------------------------------- namespaces --------------------------------- // ----------------------------------------------------------------------------- @@ -718,4 +720,47 @@ void testRefs() cout << "Options from b : " << b.getOptions()->getValue() << endl; } + + +void ConfigName() +{ + // OUString aSubtreePath = ASCII("/org.openoffice.office.common/path/blah/blub"); + OUString aSubtreePath = ASCII("/org.openoffice.office.common"); + ConfigurationName aName(aSubtreePath); + OUString a = aName.localName(); + OUString b = aName.fullName(); + OUString c = aName.moduleName(); + ConfigurationName aParentName(aName.getParentName()); + OUString d = aParentName.fullName(); + + + { + ConfigurationName aName( ASCII("/" )); + + std::stack< rtl::OUString, std::vector<rtl::OUString> > m_aStringStack; + + if (aName.localName().getLength() != 0) + { + for (ConfigurationName::Iterator it = aName.begin(); + it != aName.end(); + ++it) + { + rtl::OUString aName = *it; + m_aStringStack.push(aName); + // m_xHandler->startElement(*it, rList); + volatile int dummy = 0; + } + } + + // bBack = writeChanges(); + + while(!m_aStringStack.empty()) + { + OUString aName = m_aStringStack.top(); + m_aStringStack.pop(); + } + } +} + + } // namespace configmgr |