015d90baa5
* The str parameter StartsWith function in libbase got changed
from std::string to std::string_view in later android versions [1].
* Create a shim that provides the older StartsWith function.
[1]: ef973cee17
Change-Id: I116a32a739d6fa34ecc0d1a4acf8b2e3756910ea
16 lines
337 B
C++
16 lines
337 B
C++
/*
|
|
* Copyright (C) 2023 The LineageOS Project
|
|
*
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
#include <string.h>
|
|
#include <string>
|
|
|
|
namespace android {
|
|
namespace base {
|
|
bool StartsWith(const std::string& s, const char* prefix) {
|
|
return strncmp(s.c_str(), prefix, strlen(prefix)) == 0;
|
|
}
|
|
} // namespace base
|
|
} // namespace android
|