1*bae3752eSAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*bae3752eSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*bae3752eSAndrew Rist * or more contributor license agreements. See the NOTICE file 5*bae3752eSAndrew Rist * distributed with this work for additional information 6*bae3752eSAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*bae3752eSAndrew Rist * to you under the Apache License, Version 2.0 (the 8*bae3752eSAndrew Rist * "License"); you may not use this file except in compliance 9*bae3752eSAndrew Rist * with the License. You may obtain a copy of the License at 10*bae3752eSAndrew Rist * 11*bae3752eSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*bae3752eSAndrew Rist * 13*bae3752eSAndrew Rist * Unless required by applicable law or agreed to in writing, 14*bae3752eSAndrew Rist * software distributed under the License is distributed on an 15*bae3752eSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*bae3752eSAndrew Rist * KIND, either express or implied. See the License for the 17*bae3752eSAndrew Rist * specific language governing permissions and limitations 18*bae3752eSAndrew Rist * under the License. 19*bae3752eSAndrew Rist * 20*bae3752eSAndrew Rist *************************************************************/ 21*bae3752eSAndrew Rist 22*bae3752eSAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir #ifndef _UNOTOOLS_REGPATHHELPER_HXX_ 25cdf0e10cSrcweir #define _UNOTOOLS_REGPATHHELPER_HXX_ 26cdf0e10cSrcweir 27cdf0e10cSrcweir #include <rtl/ustring.hxx> 28cdf0e10cSrcweir 29cdf0e10cSrcweir namespace utl 30cdf0e10cSrcweir { 31cdf0e10cSrcweir 32cdf0e10cSrcweir /** 33cdf0e10cSrcweir * This function returns a path to the user registry file. 34cdf0e10cSrcweir * Search for the user registry using the following rules: 35cdf0e10cSrcweir * <dl> 36cdf0e10cSrcweir * <dt> 1. (for further use) search in sversion.ini (.sversionrc) for an entry 37cdf0e10cSrcweir * REGISTRY_VERSION_STRING (example: UserRegistry 5.0/505=test.rdb) in the section 38cdf0e10cSrcweir * [Registry]. If found, then take this value instead of the name "user.rdb". 39cdf0e10cSrcweir * <dt> 2. Search in the config directory of the user for a file "user.rdb". If 40cdf0e10cSrcweir * found return the full path and name of the file. If not found, retry this 41cdf0e10cSrcweir * step with a dot before ".user.rdb". 42cdf0e10cSrcweir * <dt> 3. If not found a new user registry with name "user.rdb" will be created in the user 43cdf0e10cSrcweir * config directory. 44cdf0e10cSrcweir * </dl> 45cdf0e10cSrcweir *<BR> 46cdf0e10cSrcweir * @author Juergen Schmidt 47cdf0e10cSrcweir */ 48cdf0e10cSrcweir ::rtl::OUString getPathToUserRegistry(); 49cdf0e10cSrcweir 50cdf0e10cSrcweir /** 51cdf0e10cSrcweir * This function returns a path to the system registry file. 52cdf0e10cSrcweir * The system registry will always be searched in the same directory of the 53cdf0e10cSrcweir * executable. The name of the system registry is "applicat.rdb". If the system 54cdf0e10cSrcweir * registry was not found, then the environment variable STAR_REGISTRY will be checked. 55cdf0e10cSrcweir * If this variable was set, it must contain a full path to a valid system registry. 56cdf0e10cSrcweir * Search for the user registry using the following rules: 57cdf0e10cSrcweir * 58cdf0e10cSrcweir *<BR> 59cdf0e10cSrcweir * @author Juergen Schmidt 60cdf0e10cSrcweir */ 61cdf0e10cSrcweir 62cdf0e10cSrcweir ::rtl::OUString getPathToSystemRegistry(); 63cdf0e10cSrcweir 64cdf0e10cSrcweir } 65cdf0e10cSrcweir 66cdf0e10cSrcweir #endif 67cdf0e10cSrcweir 68