View | Details | Raw Unified | Return to issue 64870
Collapse All | Expand All

(-)source/dbbe/Layer.cxx (-18 / +17 lines)
Lines 173-189 Link Here
173
        }
173
        }
174
174
175
175
176
        void BaseLayer::readData(backend::XLayer * pContext,
176
        void BaseLayer::doReadData(backend::XLayer * pContext,
177
                                 const uno::Reference<backend::XLayerHandler>& xHandler,
177
                                   const uno::Reference<backend::XLayerHandler>& xHandler,
178
                                 Database& aDb,
178
                                   Database& aDb,
179
                                 rtl::OString aKey)
179
                                   rtl::OString aKey)
180
            throw (backend::MalformedDataException, lang::NullPointerException, 
180
            throw (backend::MalformedDataException, lang::NullPointerException, 
181
                   lang::WrappedTargetException, uno::RuntimeException)
181
                   lang::WrappedTargetException, uno::RuntimeException)
182
        {
182
        {
183
            if (!xHandler.is())
183
            if (!xHandler.is())
184
            {
184
            {
185
                rtl::OUString const sMessage(RTL_CONSTASCII_USTRINGPARAM(
185
                rtl::OUString const sMessage(RTL_CONSTASCII_USTRINGPARAM(
186
                                                 "BaseLayer - Cannot readData: Handler is NULL."));
186
                                                 "BaseLayer - Cannot doReadData: Handler is NULL."));
187
187
188
                throw  lang::NullPointerException(sMessage,pContext);
188
                throw  lang::NullPointerException(sMessage,pContext);
189
            }
189
            }
Lines 216-222 Link Here
216
                    sMsg.appendAscii(aKey.getStr());
216
                    sMsg.appendAscii(aKey.getStr());
217
                    sMsg.appendAscii("\"\n");
217
                    sMsg.appendAscii("\"\n");
218
                    throw backend::BackendAccessException(sMsg.makeStringAndClear(), pContext, uno::Any());
218
                    throw backend::BackendAccessException(sMsg.makeStringAndClear(), pContext, uno::Any());
219
                    break;
220
            
219
            
221
            }
220
            }
222
        }
221
        }
Lines 278-284 Link Here
278
        Layer::Layer(
277
        Layer::Layer(
279
            const uno::Reference<lang::XMultiServiceFactory>& xFactory,
278
            const uno::Reference<lang::XMultiServiceFactory>& xFactory,
280
            Database& aDatabase,
279
            Database& aDatabase,
281
            const rtl::OString aKey)
280
            const rtl::OString& aKey)
282
            :BaseLayer(xFactory, aDatabase, aKey)
281
            :BaseLayer(xFactory, aDatabase, aKey)
283
        {
282
        {
284
        }
283
        }
Lines 294-300 Link Here
294
                    lang::WrappedTargetException, 
293
                    lang::WrappedTargetException, 
295
                    uno::RuntimeException)
294
                    uno::RuntimeException)
296
        {
295
        {
297
            BaseLayer::readData(this, xHandler, getDb(), getKey());
296
            doReadData(this, xHandler, getDb(), getKey());
298
        }
297
        }
299
298
300
        rtl::OUString Layer::getTimestamp() 
299
        rtl::OUString Layer::getTimestamp() 
Lines 309-315 Link Here
309
        UpdatableLayer::UpdatableLayer(
308
        UpdatableLayer::UpdatableLayer(
310
            const uno::Reference<lang::XMultiServiceFactory>& xFactory,
309
            const uno::Reference<lang::XMultiServiceFactory>& xFactory,
311
            Database& aDatabase,
310
            Database& aDatabase,
312
            const rtl::OString aKey)
311
            const rtl::OString& aKey)
313
            :BaseLayer(xFactory, aDatabase, aKey)
312
            :BaseLayer(xFactory, aDatabase, aKey)
314
        {
313
        {
315
        }
314
        }
Lines 325-331 Link Here
325
                    lang::WrappedTargetException, 
324
                    lang::WrappedTargetException, 
326
                    uno::RuntimeException)
325
                    uno::RuntimeException)
327
        {
326
        {
328
            BaseLayer::readData(this, xHandler, getDb(), getKey());
327
            doReadData(this, xHandler, getDb(), getKey());
329
        }
328
        }
330
329
331
        rtl::OUString UpdatableLayer::getTimestamp() 
330
        rtl::OUString UpdatableLayer::getTimestamp() 
Lines 411-417 Link Here
411
            findSubLayers(aKey);
410
            findSubLayers(aKey);
412
        }
411
        }
413
412
414
        void BaseCompositeLayer::readSubLayerData(
413
        void BaseCompositeLayer::doReadSubLayerData(
415
            backend::XCompositeLayer * pContext,
414
            backend::XCompositeLayer * pContext,
416
            const uno::Reference<backend::XLayerHandler>& xHandler,
415
            const uno::Reference<backend::XLayerHandler>& xHandler,
417
            const rtl::OUString& aSubLayerId) 
416
            const rtl::OUString& aSubLayerId) 
Lines 422-428 Link Here
422
            if (!xHandler.is())
421
            if (!xHandler.is())
423
            {
422
            {
424
                rtl::OUString const sMessage(RTL_CONSTASCII_USTRINGPARAM(
423
                rtl::OUString const sMessage(RTL_CONSTASCII_USTRINGPARAM(
425
                                                 "BaseCompositeLayer - Cannot readSubLayerData: Handler is NULL."));
424
                                                 "BaseCompositeLayer - Cannot doReadSubLayerData: Handler is NULL."));
426
425
427
                throw  lang::NullPointerException(sMessage,pContext);
426
                throw  lang::NullPointerException(sMessage,pContext);
428
            }
427
            }
Lines 447-453 Link Here
447
            }
446
            }
448
            if (mSubLayerKeys[i].getLength() != 0)
447
            if (mSubLayerKeys[i].getLength() != 0)
449
            {
448
            {
450
                BaseLayer::readData(pContext, xHandler, getDb(), mSubLayerKeys[i]) ;
449
                doReadData(pContext, xHandler, getDb(), mSubLayerKeys[i]) ;
451
            }
450
            }
452
            else
451
            else
453
            {
452
            {
Lines 538-544 Link Here
538
                   lang::WrappedTargetException, lang::IllegalArgumentException,
537
                   lang::WrappedTargetException, lang::IllegalArgumentException,
539
                   uno::RuntimeException)
538
                   uno::RuntimeException)
540
        {
539
        {
541
            return BaseCompositeLayer::readSubLayerData(this,xHandler,aSubLayerId);
540
            return doReadSubLayerData(this,xHandler,aSubLayerId);
542
        }
541
        }
543
542
544
543
Lines 560-566 Link Here
560
            throw (backend::MalformedDataException, lang::NullPointerException, 
559
            throw (backend::MalformedDataException, lang::NullPointerException, 
561
                   lang::WrappedTargetException, uno::RuntimeException)
560
                   lang::WrappedTargetException, uno::RuntimeException)
562
        {
561
        {
563
            BaseLayer::readData(static_cast<backend::XCompositeLayer*>(this),xHandler, getDb(), getKey());
562
            doReadData(static_cast<backend::XCompositeLayer*>(this),xHandler, getDb(), getKey());
564
        }
563
        }
565
564
566
        void SAL_CALL UpdatableCompositeLayer::replaceWith(
565
        void SAL_CALL UpdatableCompositeLayer::replaceWith(
Lines 630-636 Link Here
630
                   lang::WrappedTargetException, lang::IllegalArgumentException,
629
                   lang::WrappedTargetException, lang::IllegalArgumentException,
631
                   uno::RuntimeException)
630
                   uno::RuntimeException)
632
        {
631
        {
633
            return BaseCompositeLayer::readSubLayerData(this,xHandler,aSubLayerId);
632
            return doReadSubLayerData(this,xHandler,aSubLayerId);
634
        }
633
        }
635
634
636
        rtl::OUString SAL_CALL UpdatableCompositeLayer::getTimestamp() 
635
        rtl::OUString SAL_CALL UpdatableCompositeLayer::getTimestamp() 
Lines 640-644 Link Here
640
        }
639
        }
641
640
642
641
643
    }; //namespace dbbe
642
    } //namespace dbbe
644
}; //namespace configmgr
643
} //namespace configmgr
(-)source/dbbe/Layer.hxx (-9 / +9 lines)
Lines 96-102 Link Here
96
		    throw (uno::Exception);
96
		    throw (uno::Exception);
97
97
98
    virtual void SAL_CALL getFastPropertyValue( uno::Any& rValue, sal_Int32 nHandle ) const;
98
    virtual void SAL_CALL getFastPropertyValue( uno::Any& rValue, sal_Int32 nHandle ) const;
99
99
    using PropertySetHelper::getFastPropertyValue;
100
};
100
};
101
//end lift
101
//end lift
102
102
Lines 140-149 Link Here
140
       @throws com::sun::star::lang::WrappedTargetException
140
       @throws com::sun::star::lang::WrappedTargetException
141
       if an error occurs while accessing the data.
141
       if an error occurs while accessing the data.
142
    */
142
    */
143
    void readData(backend::XLayer * pContext,
143
    void doReadData(backend::XLayer * pContext,
144
                  const uno::Reference<backend::XLayerHandler>& xHandler,
144
                    const uno::Reference<backend::XLayerHandler>& xHandler,
145
                  Database& aDb,
145
                    Database& aDb,
146
                  rtl::OString aKey)
146
                    rtl::OString aKey)
147
        throw (backend::MalformedDataException, lang::NullPointerException, 
147
        throw (backend::MalformedDataException, lang::NullPointerException, 
148
               lang::WrappedTargetException, uno::RuntimeException);
148
               lang::WrappedTargetException, uno::RuntimeException);
149
    /**
149
    /**
Lines 184-190 Link Here
184
    Layer(
184
    Layer(
185
        const uno::Reference<lang::XMultiServiceFactory>& xFactory,
185
        const uno::Reference<lang::XMultiServiceFactory>& xFactory,
186
        Database& aDatabase,
186
        Database& aDatabase,
187
        rtl::OString aKey);
187
        const rtl::OString& aKey);
188
    
188
    
189
    /** Descructor */
189
    /** Descructor */
190
    ~Layer();
190
    ~Layer();
Lines 227-233 Link Here
227
    UpdatableLayer(
227
    UpdatableLayer(
228
        const uno::Reference<lang::XMultiServiceFactory>& xFactory,
228
        const uno::Reference<lang::XMultiServiceFactory>& xFactory,
229
        Database& aDatabase,
229
        Database& aDatabase,
230
        rtl::OString aKey);
230
        const rtl::OString & aKey);
231
    
231
    
232
    /** Descructor */
232
    /** Descructor */
233
    ~UpdatableLayer();
233
    ~UpdatableLayer();
Lines 292-298 Link Here
292
        throw (lang::WrappedTargetException, uno::RuntimeException)
292
        throw (lang::WrappedTargetException, uno::RuntimeException)
293
        { return mSubLayerIds; }
293
        { return mSubLayerIds; }
294
    
294
    
295
    void SAL_CALL readSubLayerData(
295
    void SAL_CALL doReadSubLayerData(
296
        backend::XCompositeLayer * pContext,
296
        backend::XCompositeLayer * pContext,
297
        const uno::Reference<backend::XLayerHandler>& xHandler,
297
        const uno::Reference<backend::XLayerHandler>& xHandler,
298
        const rtl::OUString& aSubLayerId) 
298
        const rtl::OUString& aSubLayerId) 
Lines 453-458 Link Here
453
    uno::Reference<backend::XLayerHandler> mLayerWriter ;
453
    uno::Reference<backend::XLayerHandler> mLayerWriter ;
454
};
454
};
455
455
456
}}; //configmgr::dbbe
456
}} //configmgr::dbbe
457
457
458
#endif //CONFIMGR_DBBE_LAYER_HXX_
458
#endif //CONFIMGR_DBBE_LAYER_HXX_
(-)source/dbbe/Record.cxx (-2 / +2 lines)
Lines 338-343 Link Here
338
            return ret;
338
            return ret;
339
        }
339
        }
340
        
340
        
341
    };
341
    }
342
}; //namespace
342
} //namespace
343
343
(-)source/dbbe/basestratum.cxx (-4 / +2 lines)
Lines 283-289 Link Here
283
                
283
                
284
                case Database::E_NOENT:
284
                case Database::E_NOENT:
285
                    return false;
285
                    return false;
286
                    break;
287
                                       
286
                                       
288
                default: //something bad happened
287
                default: //something bad happened
289
                    rtl::OUStringBuffer errbuf;
288
                    rtl::OUStringBuffer errbuf;
Lines 293-302 Link Here
293
                    errbuf.appendAscii("\" ");
292
                    errbuf.appendAscii("\" ");
294
                    rtl::OUString const errmsg = errbuf.makeStringAndClear();
293
                    rtl::OUString const errmsg = errbuf.makeStringAndClear();
295
                    throw backend::BackendAccessException(errmsg,*this,uno::Any());
294
                    throw backend::BackendAccessException(errmsg,*this,uno::Any());
296
                    break;
297
            }
295
            }
298
            return true;
296
            return true;
299
        }
297
        }
300
    
298
    
301
    }; //namespace dbbe
299
    } //namespace dbbe
302
}; //namespace configmgr
300
} //namespace configmgr
(-)source/dbbe/basestratum.hxx (-2 / +2 lines)
Lines 234-240 Link Here
234
                                    const rtl::OString &aSubLayer);
234
                                    const rtl::OString &aSubLayer);
235
       
235
       
236
        
236
        
237
    }; //namespace dbbe 
237
    } //namespace dbbe 
238
}; //namespace configmgr
238
} //namespace configmgr
239
239
240
#endif//CONFIMGR_DBBE_BASESTRATUM_HXX_
240
#endif//CONFIMGR_DBBE_BASESTRATUM_HXX_
(-)source/dbbe/database.cxx (-24 / +18 lines)
Lines 56-69 Link Here
56
#include <osl/process.h> 
56
#include <osl/process.h> 
57
#endif//_OSL_PROCESS_H_
57
#endif//_OSL_PROCESS_H_
58
58
59
#if   defined(FREEBSD) || defined(NETBSD) ||\
59
#if defined(FREEBSD) || defined(NETBSD) || defined(LINUX)
60
      defined(LINUX) || defined(SOLARIS)
61
#define HAVE_FADVISE
60
#define HAVE_FADVISE
62
#include <fcntl.h>
61
#include <fcntl.h>
63
#endif
62
#endif
64
63
65
#include <math.h>
64
#include <math.h>
66
65
66
extern "C"
67
{
68
    static void* malloc_wrapper(size_t size)
69
    {
70
        return rtl_allocateMemory(size);
71
    }
72
    static void* realloc_wrapper(void *ptr, size_t size)
73
    {
74
        return rtl_reallocateMemory(ptr, size);
75
    }
76
    static void free_wrapper(void *ptr)
77
    {
78
        rtl_freeMemory(ptr);
79
    }
80
}
67
81
68
namespace configmgr
82
namespace configmgr
69
{
83
{
Lines 135-153 Link Here
135
            }
149
            }
136
        }
150
        }
137
        
151
        
138
        static inline void* malloc_wrapper(size_t size) 
139
        { 
140
            return rtl_allocateMemory(size); 
141
        }
142
        static inline void* realloc_wrapper(void *ptr, size_t size)
143
        { 
144
            return rtl_reallocateMemory(ptr, size); 
145
        }
146
        static inline void free_wrapper(void *ptr) 
147
        { 
148
            rtl_freeMemory(ptr); 
149
        }
150
151
        Database::RC Database::open(bool create)
152
        Database::RC Database::open(bool create)
152
        {
153
        {
153
            using namespace osl;
154
            using namespace osl;
Lines 274-280 Link Here
274
            {
275
            {
275
                case DB_NOTFOUND:
276
                case DB_NOTFOUND:
276
                    return E_NOENT;
277
                    return E_NOENT;
277
                    break;
278
278
279
                case 0:
279
                case 0:
280
                {           
280
                {           
Lines 284-294 Link Here
284
                    OSL_ASSERT(*ppRecord);
284
                    OSL_ASSERT(*ppRecord);
285
                    return E_None;
285
                    return E_None;
286
                }
286
                }
287
                break;
288
                
287
                
289
                default:
288
                default:
290
                    return E_invalidError;
289
                    return E_invalidError;
291
                    break;
292
            }
290
            }
293
            return E_invalidError; //control never reaches here
291
            return E_invalidError; //control never reaches here
294
        }
292
        }
Lines 412-419 Link Here
412
                    
410
                    
413
                    default:
411
                    default:
414
                        abort();
412
                        abort();
415
                        break;
416
417
                }
413
                }
418
            }
414
            }
419
            if (pCursor->c_close(pCursor))
415
            if (pCursor->c_close(pCursor))
Lines 441-451 Link Here
441
                    OSL_ASSERT(filenamep);
437
                    OSL_ASSERT(filenamep);
442
                    aPath= rtl::OString(filenamep);
438
                    aPath= rtl::OString(filenamep);
443
                    return E_None;
439
                    return E_None;
444
                    break;
445
                    
440
                    
446
                default:
441
                default:
447
                    return E_invalidError;
442
                    return E_invalidError;
448
                    break;
449
            }
443
            }
450
            return E_invalidError;
444
            return E_invalidError;
451
        }
445
        }
Lines 487-494 Link Here
487
            return E_invalidError;
481
            return E_invalidError;
488
        }
482
        }
489
483
490
    }; //dbbe
484
    } //dbbe
491
}; //configmgr
485
} //configmgr
492
486
493
487
494
488
(-)source/dbbe/factory.cxx (-2 / +2 lines)
Lines 86-92 Link Here
86
            return pDb;
86
            return pDb;
87
        }
87
        }
88
88
89
    };
89
    }
90
}; //namespaces
90
} //namespaces
91
91
92
#endif //CONFIGMGR_DBBE_FACTORY_HXX_
92
#endif //CONFIGMGR_DBBE_FACTORY_HXX_
(-)source/dbbe/factory.hxx (-2 / +2 lines)
Lines 92-98 Link Here
92
            DbHash mDbs;
92
            DbHash mDbs;
93
        };
93
        };
94
94
95
    };
95
    }
96
}; //namespace
96
} //namespace
97
97
98
#endif //CONFIGMGR_DBBE_FACTORY_HXX_
98
#endif //CONFIGMGR_DBBE_FACTORY_HXX_
(-)source/dbbe/multistratum.cxx (-4 / +2 lines)
Lines 117-123 Link Here
117
                
117
                
118
                case Database::E_NOENT:
118
                case Database::E_NOENT:
119
                    return uno::Sequence<rtl::OUString>();
119
                    return uno::Sequence<rtl::OUString>();
120
                    break;
121
                    
120
                    
122
                default: //something bad happened
121
                default: //something bad happened
123
                    rtl::OUStringBuffer errbuf;
122
                    rtl::OUStringBuffer errbuf;
Lines 127-133 Link Here
127
                    errbuf.appendAscii("\"\n");
126
                    errbuf.appendAscii("\"\n");
128
                    rtl::OUString const errmsg = errbuf.makeStringAndClear();
127
                    rtl::OUString const errmsg = errbuf.makeStringAndClear();
129
                    throw backend::BackendAccessException(errmsg,*this,uno::Any());
128
                    throw backend::BackendAccessException(errmsg,*this,uno::Any());
130
                    break;
131
            }
129
            }
132
            return uno::Sequence<rtl::OUString>(&aResult.front(), 
130
            return uno::Sequence<rtl::OUString>(&aResult.front(), 
133
                                                static_cast<sal_Int32>(aResult.size()));
131
                                                static_cast<sal_Int32>(aResult.size()));
Lines 250-254 Link Here
250
            return xResult; //should be NULL?
248
            return xResult; //should be NULL?
251
    }
249
    }
252
        
250
        
253
    }; //namespace dbbe
251
    } //namespace dbbe
254
}; //namespace configmgr
252
} //namespace configmgr
(-)source/dbbe/multistratum.hxx (-2 / +2 lines)
Lines 113-120 Link Here
113
            virtual const ServiceImplementationInfo * getServiceInfoData() const;
113
            virtual const ServiceImplementationInfo * getServiceInfoData() const;
114
        } ;
114
        } ;
115
                
115
                
116
    }; //namespace dbbe
116
    } //namespace dbbe
117
}; //namespace configmgr
117
} //namespace configmgr
118
118
119
119
120
#endif
120
#endif
(-)source/dbbe/singlestratum.cxx (-2 / +2 lines)
Lines 185-190 Link Here
185
        }
185
        }
186
186
187
        
187
        
188
    }; //namespace dbbe
188
    } //namespace dbbe
189
}; //namespace configmr
189
} //namespace configmr
190
190
(-)source/dbbe/singlestratum.hxx (-2 / +2 lines)
Lines 92-99 Link Here
92
            virtual const ServiceImplementationInfo * getServiceInfoData() const;
92
            virtual const ServiceImplementationInfo * getServiceInfoData() const;
93
93
94
        };        
94
        };        
95
    }; //dbbe
95
    } //dbbe
96
}; //configmgr
96
} //configmgr
97
97
98
#endif
98
#endif
99
    
99
    
(-)source/dbbe/util/argparse.cxx (-7 / +7 lines)
Lines 152-168 Link Here
152
        return 0;
152
        return 0;
153
    }
153
    }
154
    
154
    
155
    int optind= 1;
155
    int n= 1;
156
    while (optind < argc)
156
    while (n < argc)
157
    {
157
    {
158
        arg* match= argMatch(argv[optind]);
158
        arg* match= argMatch(argv[n]);
159
        if (match)
159
        if (match)
160
        {
160
        {
161
            OSL_ASSERT(match->flagStore);
161
            OSL_ASSERT(match->flagStore);
162
            *(match->flagStore)= true;
162
            *(match->flagStore)= true;
163
            if (match->hasValue)
163
            if (match->hasValue)
164
            {
164
            {
165
                char *equals= strstr(argv[optind], "=");
165
                char *equals= strstr(argv[n], "=");
166
                if (equals)
166
                if (equals)
167
                {
167
                {
168
                    OSL_ASSERT(match->valueStore);
168
                    OSL_ASSERT(match->valueStore);
Lines 170-181 Link Here
170
                    OSL_ASSERT(match->valueStore);
170
                    OSL_ASSERT(match->valueStore);
171
                }
171
                }
172
            }
172
            }
173
            optind++;
173
            n++;
174
        }
174
        }
175
        else
175
        else
176
            return optind;
176
            return n;
177
    }
177
    }
178
    return optind;
178
    return n;
179
}
179
}
180
180
181
bool argParser::mandatoryOptsSet() const
181
bool argParser::mandatoryOptsSet() const
(-)source/dbbe/util/argparse.hxx (-2 / +2 lines)
Lines 44-56 Link Here
44
 */
44
 */
45
struct arg
45
struct arg
46
{
46
{
47
    char*         argName;      //the name of the argument (foo, etc)
47
    char const*   argName;      //the name of the argument (foo, etc)
48
    char          shortName;    //the (f in -f, etc)
48
    char          shortName;    //the (f in -f, etc)
49
    bool          optional;     //true if optional false otherwise
49
    bool          optional;     //true if optional false otherwise
50
    bool          hasValue;     //true if this option has a value (-foo=bar)
50
    bool          hasValue;     //true if this option has a value (-foo=bar)
51
    bool*         flagStore;    //true is written here if option is set
51
    bool*         flagStore;    //true is written here if option is set
52
    char**        valueStore;   //string is copied here if option is set
52
    char**        valueStore;   //string is copied here if option is set
53
    char*         usageString;  //the string that explains this usage
53
    char const*   usageString;  //the string that explains this usage
54
                                //in the printUsage method
54
                                //in the printUsage method
55
};
55
};
56
56
(-)source/dbbe/util/graph.cxx (-2 / +2 lines)
Lines 177-183 Link Here
177
            out << "}" << endl;
177
            out << "}" << endl;
178
        }
178
        }
179
        
179
        
180
    }; //dbbe
180
    } //dbbe
181
}; //configmgr
181
} //configmgr
182
182
183
#endif //CONFIGMGR_DBBE_UTIL_GRAPH_HXX_
183
#endif //CONFIGMGR_DBBE_UTIL_GRAPH_HXX_
(-)source/dbbe/util/graph.hxx (-3 / +3 lines)
Lines 72-78 Link Here
72
72
73
        public:
73
        public:
74
            typedef std::hash_map<const sal_Char*, const configmgr::dbbe::Record*, std::hash<const sal_Char*>, eqstr> nodeHash;
74
            typedef std::hash_map<const sal_Char*, const configmgr::dbbe::Record*, std::hash<const sal_Char*>, eqstr> nodeHash;
75
            typedef std::hash_set<sal_Char*, std::hash<sal_Char*>, eqstr> keySet;
75
            typedef std::hash_set<const sal_Char*, std::hash<const sal_Char*>, eqstr> keySet;
76
//            typedef std::set<sal_Char*, eqstr> keySet;
76
//            typedef std::set<sal_Char*, eqstr> keySet;
77
//            typedef std::hash_map<sal_Char*, configmgr::dbbe::Record, std::hash<sal_Char*>, eqstr> nodeHash;
77
//            typedef std::hash_map<sal_Char*, configmgr::dbbe::Record, std::hash<sal_Char*>, eqstr> nodeHash;
78
//            typedef std::hash_set<sal_Char*, std::hash<sal_Char*>, eqstr> keySet;
78
//            typedef std::hash_set<sal_Char*, std::hash<sal_Char*>, eqstr> keySet;
Lines 188-195 Link Here
188
//             };            
188
//             };            
189
189
190
            };
190
            };
191
    };
191
    }
192
};
192
}
193
193
194
194
195
#endif
195
#endif
(-)source/dbbe/util/main.cxx (-29 / +26 lines)
Lines 151-157 Link Here
151
            {0, 0, 0, 0, 0, 0, 0}
151
            {0, 0, 0, 0, 0, 0, 0}
152
        };
152
        };
153
    argParser aParser(argc, argv, args, summary);
153
    argParser aParser(argc, argv, args, summary);
154
    int optind= aParser.parseArgs();
154
    int n= aParser.parseArgs();
155
    if (helpFlag)
155
    if (helpFlag)
156
    {
156
    {
157
        aParser.printUsage(NULL, footer);
157
        aParser.printUsage(NULL, footer);
Lines 160-166 Link Here
160
    if (!aParser.mandatoryOptsSet())
160
    if (!aParser.mandatoryOptsSet())
161
    {
161
    {
162
        aParser.printUsage(NULL, footer);
162
        aParser.printUsage(NULL, footer);
163
        abort();
163
        exit(1);
164
    }
164
    }
165
165
166
    /* modes */
166
    /* modes */
Lines 174-187 Link Here
174
    {
174
    {
175
        std::cerr << "No database file specified!" << std::endl << std::endl;
175
        std::cerr << "No database file specified!" << std::endl << std::endl;
176
        aParser.printUsage(NULL, footer);
176
        aParser.printUsage(NULL, footer);
177
        abort();
177
        exit(1);
178
    }
178
    }
179
179
180
    if (optind < argc)
180
    if (n < argc)
181
    {
181
    {
182
        DatabaseSanityChecker* pDatabaseSanityChecker= new DatabaseSanityChecker(db_path);
182
        DatabaseSanityChecker* pDatabaseSanityChecker= new DatabaseSanityChecker(db_path);
183
        OSL_ASSERT(pDatabaseSanityChecker);
183
        OSL_ASSERT(pDatabaseSanityChecker);
184
        if (!strcmp(argv[optind], sanity_check))
184
        if (!strcmp(argv[n], sanity_check))
185
        {
185
        {
186
            
186
            
187
            OSL_VERIFY(Database::E_None == pDatabaseSanityChecker->open());
187
            OSL_VERIFY(Database::E_None == pDatabaseSanityChecker->open());
Lines 195-228 Link Here
195
                std::cerr << "Errors detected in database!" << std::endl;
195
                std::cerr << "Errors detected in database!" << std::endl;
196
                abort();
196
                abort();
197
            }
197
            }
198
            delete pDatabaseSanityChecker;
199
        }
198
        }
200
        else if(!strcmp(argv[optind], stat))
199
        else if(!strcmp(argv[n], stat))
201
        {
200
        {
202
            Database *pDatabase= new Database(db_path);
201
            Database *pDatabase= new Database(db_path);
203
            OSL_ASSERT(pDatabase);
202
            OSL_ASSERT(pDatabase);
204
            OSL_VERIFY(Database::E_None == pDatabase->open());
203
            OSL_VERIFY(Database::E_None == pDatabase->open());
205
            optind++;
204
            n++;
206
            char* graphFile= NULL;
205
            char* graphFile= NULL;
207
            if (optind < argc)
206
            if (n < argc)
208
            {
207
            {
209
                graphFile= argv[optind];
208
                graphFile= argv[n];
210
            }
209
            }
211
            configmgr::dbbe::Stat(*pDatabase, graphFile);
210
            configmgr::dbbe::Stat(*pDatabase, graphFile);
212
            delete pDatabase;
211
            delete pDatabase;
213
            exit(0);
212
            exit(0);
214
            
213
            
215
        }
214
        }
216
        else if(!strcmp(argv[optind], import))
215
        else if(!strcmp(argv[n], import))
217
        {
216
        {
218
            Database *pDatabase= new Database(db_path);
217
            Database *pDatabase= new Database(db_path);
219
            OSL_ASSERT(pDatabase);
218
            OSL_ASSERT(pDatabase);
220
            OSL_VERIFY(Database::E_None == pDatabase->open(true));
219
            OSL_VERIFY(Database::E_None == pDatabase->open(true));
221
            configmgr::dbbe::databaseLoadStore aDatabaseLoadStore(*pDatabase, db_path);
220
            configmgr::dbbe::databaseLoadStore aDatabaseLoadStore(*pDatabase, db_path);
222
            optind++;
221
            n++;
223
            if (optind < argc)
222
            if (n < argc)
224
            {
223
            {
225
                aDatabaseLoadStore.importPath(argv[optind++], code, purgeFlag);
224
                aDatabaseLoadStore.importPath(argv[n++], code, purgeFlag);
226
                if (pDatabase)
225
                if (pDatabase)
227
                {
226
                {
228
                    delete pDatabase;
227
                    delete pDatabase;
Lines 236-254 Link Here
236
                {
235
                {
237
                    delete pDatabase;
236
                    delete pDatabase;
238
                }
237
                }
239
                abort();
238
                exit(1);
240
            }
239
            }
241
        }
240
        }
242
        else if (!strcmp(argv[optind], xport))
241
        else if (!strcmp(argv[n], xport))
243
        {
242
        {
244
            Database *pDatabase= new Database(db_path);
243
            Database *pDatabase= new Database(db_path);
245
            OSL_ASSERT(pDatabase);
244
            OSL_ASSERT(pDatabase);
246
            OSL_VERIFY(Database::E_None == pDatabase->open());
245
            OSL_VERIFY(Database::E_None == pDatabase->open());
247
            configmgr::dbbe::databaseLoadStore aDatabaseLoadStore(*pDatabase, db_path);
246
            configmgr::dbbe::databaseLoadStore aDatabaseLoadStore(*pDatabase, db_path);
248
            optind++;
247
            n++;
249
            if (optind < argc)
248
            if (n < argc)
250
            {
249
            {
251
                aDatabaseLoadStore.exportNamespace(argv[optind++], argv[optind++], code);
250
                aDatabaseLoadStore.exportNamespace(argv[n++], argv[n++], code);
252
                if (pDatabase)
251
                if (pDatabase)
253
                {
252
                {
254
                    delete pDatabase;
253
                    delete pDatabase;
Lines 262-280 Link Here
262
                {
261
                {
263
                    delete pDatabase;
262
                    delete pDatabase;
264
                }
263
                }
265
                abort();                
264
                exit(1);
266
            }
265
            }
267
        }
266
        }
268
        else if (!strcmp(argv[optind], remove))
267
        else if (!strcmp(argv[n], remove))
269
        {
268
        {
270
            Database *pDatabase= new Database(db_path);
269
            Database *pDatabase= new Database(db_path);
271
            OSL_ASSERT(pDatabase);
270
            OSL_ASSERT(pDatabase);
272
            OSL_VERIFY(Database::E_None == pDatabase->open());
271
            OSL_VERIFY(Database::E_None == pDatabase->open());
273
            configmgr::dbbe::databaseLoadStore aDatabaseLoadStore(*pDatabase, db_path);
272
            configmgr::dbbe::databaseLoadStore aDatabaseLoadStore(*pDatabase, db_path);
274
            optind++;
273
            n++;
275
            if (optind < argc)
274
            if (n < argc)
276
            {
275
            {
277
                aDatabaseLoadStore.purgeKey(argv[optind++]);
276
                aDatabaseLoadStore.purgeKey(argv[n++]);
278
                exit(0);
277
                exit(0);
279
            }
278
            }
280
            else
279
            else
Lines 284-297 Link Here
284
                {
283
                {
285
                    delete pDatabase;
284
                    delete pDatabase;
286
                }
285
                }
287
                abort(); 
286
                exit(1);
288
            }
287
            }
289
        }
288
        }
290
        aParser.printUsage(NULL, footer);
289
        aParser.printUsage(NULL, footer);
291
        abort();
290
        exit(1);
292
    }
291
    }
293
    aParser.printUsage(NULL, footer);
292
    aParser.printUsage(NULL, footer);
294
    abort();
293
    return 1;
295
    
296
    return 0;
297
}
294
}
(-)source/dbbe/util/major.cxx (-11 / +6 lines)
Lines 138-144 Link Here
138
                    default:
138
                    default:
139
                        std::cerr << "Encountered illegal conversion char: " << code[c] << std::endl;
139
                        std::cerr << "Encountered illegal conversion char: " << code[c] << std::endl;
140
                        abort();
140
                        abort();
141
                        break;
142
                }
141
                }
143
            }
142
            }
144
143
Lines 222-228 Link Here
222
                    default:
221
                    default:
223
                        std::cerr << "Encountered illegal conversion char: " << code[i] << std::endl;
222
                        std::cerr << "Encountered illegal conversion char: " << code[i] << std::endl;
224
                        abort();
223
                        abort();
225
                        break;
226
                }
224
                }
227
            }
225
            }
228
            fileUrl= URLbuf.makeStringAndClear();
226
            fileUrl= URLbuf.makeStringAndClear();
Lines 265-274 Link Here
265
        {
263
        {
266
            const char* asciiSep= "::";
264
            const char* asciiSep= "::";
267
265
268
            char* nsSep= strstr(key.getStr(), asciiSep);
266
            char const * nsSep= strstr(key.getStr(), asciiSep);
269
            OSL_ASSERT(nsSep);
267
            OSL_ASSERT(nsSep);
270
            nsSep+= strlen(asciiSep);
268
            nsSep+= strlen(asciiSep);
271
            char *subSep= strstr(nsSep, asciiSep);
269
            char const *subSep= strstr(nsSep, asciiSep);
272
            OSL_ASSERT(subSep);
270
            OSL_ASSERT(subSep);
273
            if (!(*subSep))
271
            if (!(*subSep))
274
            {
272
            {
Lines 281-290 Link Here
281
        {
279
        {
282
            const char* asciiSep= "::";
280
            const char* asciiSep= "::";
283
281
284
            char *nsSep= strstr(key.getStr(), asciiSep);
282
            char const *nsSep= strstr(key.getStr(), asciiSep);
285
            OSL_ASSERT(nsSep);
283
            OSL_ASSERT(nsSep);
286
            nsSep+= strlen(asciiSep);
284
            nsSep+= strlen(asciiSep);
287
            char *subSep= strstr(nsSep, asciiSep);
285
            char const *subSep= strstr(nsSep, asciiSep);
288
            OSL_ASSERT(subSep);
286
            OSL_ASSERT(subSep);
289
            subSep+= strlen(asciiSep);
287
            subSep+= strlen(asciiSep);
290
            if (!(*subSep))
288
            if (!(*subSep))
Lines 351-357 Link Here
351
                    std::cerr << "Error when trying to set \"" << aChildKey.getStr();
349
                    std::cerr << "Error when trying to set \"" << aChildKey.getStr();
352
                    std::cerr << "\" as a child of \"" << aParentKey.getStr() << "\"" << std::endl;
350
                    std::cerr << "\" as a child of \"" << aParentKey.getStr() << "\"" << std::endl;
353
                    abort();
351
                    abort();
354
                    break;
355
            }     
352
            }     
356
        }
353
        }
357
354
Lines 459-465 Link Here
459
                        
456
                        
460
                        default:
457
                        default:
461
                            abort();
458
                            abort();
462
                            break;
463
                    }
459
                    }
464
                }
460
                }
465
                else
461
                else
Lines 551-557 Link Here
551
                    default:
547
                    default:
552
                        cerr << "Getting an unknown error" << endl;
548
                        cerr << "Getting an unknown error" << endl;
553
                        abort();
549
                        abort();
554
                        break;
555
                }
550
                }
556
                nIndex= aDirURL.indexOf('/', nIndex);
551
                nIndex= aDirURL.indexOf('/', nIndex);
557
            }  while (nIndex >= 0 && nIndex < aDirURL.getLength());            
552
            }  while (nIndex >= 0 && nIndex < aDirURL.getLength());            
Lines 746-750 Link Here
746
            }
741
            }
747
            
742
            
748
        }
743
        }
749
    };
744
    }
750
};
745
}
(-)source/dbbe/util/major.hxx (-2 / +2 lines)
Lines 318-325 Link Here
318
318
319
            friend class graph;
319
            friend class graph;
320
        };
320
        };
321
    };
321
    }
322
};
322
}
323
323
324
324
325
#endif
325
#endif
(-)source/dbbe/util/minor.cxx (-2 / +2 lines)
Lines 212-216 Link Here
212
             }
212
             }
213
            return sal_True;
213
            return sal_True;
214
        }
214
        }
215
    }; //dbbe
215
    } //dbbe
216
}; //configmgr
216
} //configmgr
(-)source/dbbe/util/minor.hxx (-2 / +2 lines)
Lines 113-118 Link Here
113
        */
113
        */
114
        void Stat(Database& aDatabase, const sal_Char* graphFile);
114
        void Stat(Database& aDatabase, const sal_Char* graphFile);
115
        
115
        
116
    }; //dbbe
116
    } //dbbe
117
}; //configmgr
117
} //configmgr
118
#endif//CONFIGMGR_DBBE_UTIL_MINOR_HXX_
118
#endif//CONFIGMGR_DBBE_UTIL_MINOR_HXX_
(-)source/inc/Record.hxx (-2 / +2 lines)
Lines 158-164 Link Here
158
            friend class RecordTester;
158
            friend class RecordTester;
159
#endif
159
#endif
160
        };
160
        };
161
    };
161
    }
162
}; //namespace
162
} //namespace
163
163
164
#endif //CONFIGMGR_DBBE_RECORD_HXX_
164
#endif //CONFIGMGR_DBBE_RECORD_HXX_
(-)source/inc/database.hxx (-2 / +2 lines)
Lines 220-227 Link Here
220
            /** Assignment not allowed */
220
            /** Assignment not allowed */
221
            Database & operator= (const Database&);
221
            Database & operator= (const Database&);
222
        };
222
        };
223
    }; //dbbe
223
    } //dbbe
224
}; //configmgr
224
} //configmgr
225
225
226
226
227
#endif //CONFIGMGR_DBBE_DATABASE_HXX_
227
#endif //CONFIGMGR_DBBE_DATABASE_HXX_

Return to issue 64870