| Elliott Hughes | 338698e | 2021-07-13 17:15:19 -0700 | [diff] [blame] | 1 | /* | 
|  | 2 | * Copyright (C) 2005 The Android Open Source Project | 
|  | 3 | * | 
|  | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); | 
|  | 5 | * you may not use this file except in compliance with the License. | 
|  | 6 | * You may obtain a copy of the License at | 
|  | 7 | * | 
|  | 8 | *      http://www.apache.org/licenses/LICENSE-2.0 | 
|  | 9 | * | 
|  | 10 | * Unless required by applicable law or agreed to in writing, software | 
|  | 11 | * distributed under the License is distributed on an "AS IS" BASIS, | 
|  | 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 
|  | 13 | * See the License for the specific language governing permissions and | 
|  | 14 | * limitations under the License. | 
|  | 15 | */ | 
|  | 16 |  | 
|  | 17 | #pragma once | 
|  | 18 |  | 
|  | 19 | // This file contains cruft that used to be in libutils' String8, that's only | 
|  | 20 | // used for aapt. | 
|  | 21 |  | 
|  | 22 | #include <utils/String8.h> | 
|  | 23 |  | 
|  | 24 | // Converts all separators in this string to /, the default path | 
|  | 25 | // separator. | 
|  | 26 | // If the default OS separator is backslash, this converts all | 
|  | 27 | // backslashes to slashes, in-place. Otherwise it does nothing. | 
|  | 28 | void convertToResPath(android::String8&); | 
| Tomasz Wasilczyk | 804e819 | 2023-08-23 02:22:53 +0000 | [diff] [blame] | 29 |  | 
|  | 30 | /** | 
|  | 31 | * Retrieve the front (root dir) component.  Optionally also return the | 
|  | 32 | * remaining components. | 
|  | 33 | * | 
|  | 34 | * "/tmp/foo/bar.c" --> "tmp" (remain = "foo/bar.c") | 
|  | 35 | * "/tmp" --> "tmp" (remain = "") | 
|  | 36 | * "bar.c" --> "bar.c" (remain = "") | 
|  | 37 | */ | 
|  | 38 | android::String8 walkPath(const android::String8& path, android::String8* outRemains = nullptr); |