mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-05-28 05:34:11 -04:00
sysupdater: implement content meta mounting
This commit is contained in:
parent
28a6bb713c
commit
a6218ed814
7 changed files with 305 additions and 6 deletions
|
@ -78,6 +78,8 @@ namespace ams::fs {
|
|||
R_DEFINE_ERROR_RESULT(AllocationFailureInRomFsFileSystemA, 3247);
|
||||
R_DEFINE_ERROR_RESULT(AllocationFailureInRomFsFileSystemB, 3248);
|
||||
R_DEFINE_ERROR_RESULT(AllocationFailureInRomFsFileSystemC, 3249);
|
||||
R_DEFINE_ERROR_RESULT(AllocationFailureInFileSystemProxyCoreImplD, 3256);
|
||||
R_DEFINE_ERROR_RESULT(AllocationFailureInFileSystemProxyCoreImplE, 3257);
|
||||
R_DEFINE_ERROR_RESULT(AllocationFailureInPartitionFileSystemCreatorA, 3280);
|
||||
R_DEFINE_ERROR_RESULT(AllocationFailureInRomFileSystemCreatorA, 3281);
|
||||
R_DEFINE_ERROR_RESULT(AllocationFailureInStorageOnNcaCreatorA, 3288);
|
||||
|
|
|
@ -20,6 +20,54 @@
|
|||
|
||||
namespace ams::util {
|
||||
|
||||
template<typename T>
|
||||
constexpr T ToLower(T c) {
|
||||
return ('A' <= c && c <= 'Z') ? (c - 'A' + 'a') : c;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
constexpr T ToUpper(T c) {
|
||||
return ('a' <= c && c <= 'z') ? (c - 'a' + 'A') : c;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
int Strncmp(const T *lhs, const T *rhs, int count) {
|
||||
AMS_ASSERT(lhs != nullptr);
|
||||
AMS_ASSERT(rhs != nullptr);
|
||||
AMS_ABORT_UNLESS(count >= 0);
|
||||
|
||||
if (count == 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
T l, r;
|
||||
do {
|
||||
l = *(lhs++);
|
||||
r = *(rhs++);
|
||||
} while (l && (l == r) && (--count));
|
||||
|
||||
return l - r;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
int Strnicmp(const T *lhs, const T *rhs, int count) {
|
||||
AMS_ASSERT(lhs != nullptr);
|
||||
AMS_ASSERT(rhs != nullptr);
|
||||
AMS_ABORT_UNLESS(count >= 0);
|
||||
|
||||
if (count == 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
T l, r;
|
||||
do {
|
||||
l = ::ams::util::ToLower(*(lhs++));
|
||||
r = ::ams::util::ToLower(*(rhs++));
|
||||
} while (l && (l == r) && (--count));
|
||||
|
||||
return l - r;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
constexpr int Strlcpy(T *dst, const T *src, int count) {
|
||||
AMS_ASSERT(dst != nullptr);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue