configpathes.cxx (b5088357) configpathes.cxx (30acf5e8)
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 107 unchanged lines hidden (view full) ---

116 nStart = nPos + 1;
117 }
118
119 OSL_ENSURE(nPos >= 0 && _sInPath[nPos] == '[', "Invalid config path: unmatched quotes or brackets");
120 if (nPos >= 0 && _sInPath[nPos] == '[')
121 {
122 nPos = _sInPath.lastIndexOf('/',nPos);
123 }
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 107 unchanged lines hidden (view full) ---

116 nStart = nPos + 1;
117 }
118
119 OSL_ENSURE(nPos >= 0 && _sInPath[nPos] == '[', "Invalid config path: unmatched quotes or brackets");
120 if (nPos >= 0 && _sInPath[nPos] == '[')
121 {
122 nPos = _sInPath.lastIndexOf('/',nPos);
123 }
124 else // defined behavior for invalid pathes
124 else // defined behavior for invalid paths
125 {
126 nStart = 0, nEnd = _sInPath.getLength();
127 nPos = -1;
128 }
129
130 }
131 else
132 {

--- 64 unchanged lines hidden (view full) ---

197// find the position after the prefix in the nested path
198static inline
199sal_Int32 lcl_findPrefixEnd(OUString const& _sNestedPath, OUString const& _sPrefixPath)
200{
201 // TODO: currently handles only exact prefix matches
202 sal_Int32 nPrefixLength = _sPrefixPath.getLength();
203
204 OSL_ENSURE(nPrefixLength == 0 || _sPrefixPath[nPrefixLength-1] != '/',
125 {
126 nStart = 0, nEnd = _sInPath.getLength();
127 nPos = -1;
128 }
129
130 }
131 else
132 {

--- 64 unchanged lines hidden (view full) ---

197// find the position after the prefix in the nested path
198static inline
199sal_Int32 lcl_findPrefixEnd(OUString const& _sNestedPath, OUString const& _sPrefixPath)
200{
201 // TODO: currently handles only exact prefix matches
202 sal_Int32 nPrefixLength = _sPrefixPath.getLength();
203
204 OSL_ENSURE(nPrefixLength == 0 || _sPrefixPath[nPrefixLength-1] != '/',
205 "Cannot handle slash-terminated prefix pathes");
205 "Cannot handle slash-terminated prefix paths");
206
207 sal_Bool bIsPrefix;
208 if (_sNestedPath.getLength() > nPrefixLength)
209 {
210 bIsPrefix = _sNestedPath[nPrefixLength] == '/' &&
211 _sNestedPath.compareTo(_sPrefixPath,nPrefixLength) == 0;
212 ++nPrefixLength;
213 }

--- 91 unchanged lines hidden ---
206
207 sal_Bool bIsPrefix;
208 if (_sNestedPath.getLength() > nPrefixLength)
209 {
210 bIsPrefix = _sNestedPath[nPrefixLength] == '/' &&
211 _sNestedPath.compareTo(_sPrefixPath,nPrefixLength) == 0;
212 ++nPrefixLength;
213 }

--- 91 unchanged lines hidden ---