diff options
Diffstat (limited to 'src/binder/inc/utils.hpp')
-rw-r--r-- | src/binder/inc/utils.hpp | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/src/binder/inc/utils.hpp b/src/binder/inc/utils.hpp new file mode 100644 index 0000000000..8b65fd8c12 --- /dev/null +++ b/src/binder/inc/utils.hpp @@ -0,0 +1,57 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. +// ============================================================ +// +// Utils.hpp +// + + +// +// Declares a bunch of binder auxilary functions +// +// ============================================================ + +#ifndef __BINDER_UTILS_HPP__ +#define __BINDER_UTILS_HPP__ + +#include "bindertypes.hpp" + +extern LocaleID g_lcid; + +namespace BINDER_SPACE +{ + inline BOOL EqualsCaseInsensitive(SString &a, SString &b) + { + return a.EqualsCaseInsensitive(b, g_lcid); + } + + inline ULONG HashCaseInsensitive(SString &string) + { + return string.HashCaseInsensitive(g_lcid); + } + + HRESULT FileOrDirectoryExists(PathString &path); + HRESULT FileOrDirectoryExistsLog(PathString &path); + + BOOL IsURL(SString &urlOrPath); + + void MutateUrlToPath(SString &urlOrPath); + void MutatePathToUrl(SString &pathOrUrl); + + // Mutates path + void PlatformPath(SString &path); + void CanonicalizePath(SString &path, BOOL fAppendPathSeparator = FALSE); + + // It is safe to use either A or B as CombinedPath. + void CombinePath(SString &pathA, + SString &pathB, + SString &combinedPath); + + HRESULT GetTokenFromPublicKey(SBuffer &publicKeyBLOB, + SBuffer &publicKeyTokenBLOB); + + BOOL IsFileNotFound(HRESULT hr); +}; + +#endif |