forked from mirrors/gecko-dev
Bug 1875312 - Move ./gfx/vr/service/openvr to mach vendor r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D198964
This commit is contained in:
parent
46d4e4667e
commit
9901e70871
10 changed files with 698 additions and 107 deletions
|
|
@ -1,13 +1,13 @@
|
||||||
OpenVR SDK
|
OpenVR SDK
|
||||||
---
|
---
|
||||||
|
|
||||||
OpenVR is an API and runtime that allows access to VR hardware from multiple
|
OpenVR is an API and runtime that allows access to VR hardware from multiple
|
||||||
vendors without requiring that applications have specific knowledge of the
|
vendors without requiring that applications have specific knowledge of the
|
||||||
hardware they are targeting. This repository is an SDK that contains the API
|
hardware they are targeting. This repository is an SDK that contains the API
|
||||||
and samples. The runtime is under SteamVR in Tools on Steam.
|
and samples. The runtime is under SteamVR in Tools on Steam.
|
||||||
|
|
||||||
### Documentation
|
### Documentation
|
||||||
|
|
||||||
Documentation for the API is available on the [Github Wiki](https://github.com/ValveSoftware/openvr/wiki/API-Documentation)
|
Documentation for the API is available on the [Github Wiki](https://github.com/ValveSoftware/openvr/wiki/API-Documentation)
|
||||||
|
|
||||||
More information on OpenVR and SteamVR can be found on http://steamvr.com
|
More information on OpenVR and SteamVR can be found on http://steamvr.com
|
||||||
|
|
|
||||||
|
|
@ -1,80 +0,0 @@
|
||||||
This directory contains files from the OpenVR SDK, version 1.11.11.
|
|
||||||
|
|
||||||
This SDK contains the OpenVR API interface headers and functions to load the
|
|
||||||
OpenVR runtime libraries which actually implement the functionality. The
|
|
||||||
loading functions parse a .json file in a pre-defined location on the
|
|
||||||
end-user's machine to get details used to bind the correct runtime library.
|
|
||||||
The OpenVR implementation ensures forward and backwards compatibility as of
|
|
||||||
the current version.
|
|
||||||
|
|
||||||
Updated versions of the OpenVR SDK are available on Github:
|
|
||||||
|
|
||||||
https://github.com/ValveSoftware/openvr
|
|
||||||
|
|
||||||
|
|
||||||
We only use some files from the SDK:
|
|
||||||
|
|
||||||
- We strip out files such as C# headers, plain C API versions, and files
|
|
||||||
needed only when implementing OpenVR drivers.
|
|
||||||
|
|
||||||
- CMake related files, such as CMakeLists.txt are skipped as we use moz.build
|
|
||||||
files to configure the library.
|
|
||||||
|
|
||||||
- The "src/jsoncpp.cpp" file and the "src/json" directory can be skipped. OpenVR
|
|
||||||
uses the jsoncpp library, which we have already imported elsewhere. If
|
|
||||||
warnings about using deprecated jsoncpp classes show up during compilation
|
|
||||||
you might need to reapply the patch in bug 1598288. It replaces uses of the
|
|
||||||
`Json::Reader` and `Json::StyledWriter` classes with the more modern
|
|
||||||
`Json::CharReaderBuilder` and `Json::StreamWriterBuilder`.
|
|
||||||
|
|
||||||
|
|
||||||
Steps to update the library:
|
|
||||||
|
|
||||||
- Copy "README.md" from the root of the openvr repo to the "gfx/vr/service/openvr"
|
|
||||||
directory.
|
|
||||||
|
|
||||||
- Copy "headers/openvr.h" to "gfx/vr/service/openvr/headers" directory. The other files
|
|
||||||
in this directory can be ignored.
|
|
||||||
|
|
||||||
- The rest of the files in the "src" directory and the "src/vrcommon" are copied
|
|
||||||
to the "gfx/vr/service/openvr/src" directory.
|
|
||||||
|
|
||||||
- Update "gfx/vr/service/openvr/moz.build" when files are added or removed.
|
|
||||||
|
|
||||||
- Update the "strtools_public.h" and "strtools_public.cpp" files, commenting out
|
|
||||||
the "Uint64ToString", "wcsncpy_s", and "strncpy_s" functions.
|
|
||||||
The "Uint64ToString" function name conflicts with another used in Gecko and
|
|
||||||
the "errno_t" return type returned by the other functions is not defined in
|
|
||||||
Mozilla's macOS continuous integration build environments. Fortunately, the
|
|
||||||
OpenVR SDK does not use these functions.
|
|
||||||
|
|
||||||
- Replace the #define VR_INTERFACE in openvr.h to avoid extern'ing the functions.
|
|
||||||
Unlike the usual OpenVR API builds, we are not building a separate dll.
|
|
||||||
|
|
||||||
- Add explicit in CVRSettingHelper constructor.
|
|
||||||
|
|
||||||
- In strtools_public.cpp/.h, ensure that UTF16to8 and UTF8to16 are only
|
|
||||||
compiled under
|
|
||||||
#if defined( _WIN32 )
|
|
||||||
and redefine those functions to use ::WideCharToMultiByte and
|
|
||||||
MultiByteToWideChar, respectively. These are modified because the original
|
|
||||||
implementations contain unsupported try-catch.
|
|
||||||
|
|
||||||
- In strtools_public.cpp, remove the definition of convert_type.
|
|
||||||
|
|
||||||
- In strtools_public.cpp, remove the include of <codecvt>, as this causes
|
|
||||||
problems in compiling on Linux.
|
|
||||||
|
|
||||||
- In pathtools_public.cpp/.h, comment out Path_UrlToFilePath and
|
|
||||||
Path_FilePathToUrl to avoid a compile error because 'alloca' isn't defined.
|
|
||||||
|
|
||||||
- In vrpathregistry_public.cpp, CVRPathRegistry_Public::BLoadFromFile contains
|
|
||||||
a try-catch, which is not permitted. This code is simply commented out, but
|
|
||||||
Bug 1640068 - OpenVR code can fail JSON parsing and raise exceptions
|
|
||||||
is filed to address a safe fallback in the error condition.
|
|
||||||
|
|
||||||
- Update this README.mozilla file with the new OpenVR SDK version and any
|
|
||||||
additional steps needed for newer versions.
|
|
||||||
|
|
||||||
- Ensure that any changes made within the OpenVR files have comments including
|
|
||||||
the string "Mozilla" and reference this file for easy identification.
|
|
||||||
|
|
@ -1934,7 +1934,7 @@ struct ImuSample_t
|
||||||
|
|
||||||
#define VR_INTERFACE
|
#define VR_INTERFACE
|
||||||
|
|
||||||
// Mozilla: see README.mozilla for more details
|
// Mozilla: see mozilla.patch for more details
|
||||||
// figure out how to import from the VR API dll
|
// figure out how to import from the VR API dll
|
||||||
// #if defined(_WIN32)
|
// #if defined(_WIN32)
|
||||||
|
|
||||||
|
|
@ -2560,7 +2560,7 @@ namespace vr
|
||||||
{
|
{
|
||||||
IVRSettings *m_pSettings;
|
IVRSettings *m_pSettings;
|
||||||
public:
|
public:
|
||||||
// Mozilla: see README.mozilla for more details
|
// Mozilla: see mozilla.patch for more details
|
||||||
explicit CVRSettingHelper( IVRSettings *pSettings )
|
explicit CVRSettingHelper( IVRSettings *pSettings )
|
||||||
{
|
{
|
||||||
m_pSettings = pSettings;
|
m_pSettings = pSettings;
|
||||||
|
|
|
||||||
50
gfx/vr/service/openvr/moz.yaml
Normal file
50
gfx/vr/service/openvr/moz.yaml
Normal file
|
|
@ -0,0 +1,50 @@
|
||||||
|
schema: 1
|
||||||
|
|
||||||
|
bugzilla:
|
||||||
|
product: Core
|
||||||
|
component: WebVR
|
||||||
|
|
||||||
|
origin:
|
||||||
|
name: openvr
|
||||||
|
description: OpenVR API interface
|
||||||
|
|
||||||
|
url: https://github.com/ValveSoftware/openvr
|
||||||
|
|
||||||
|
release: v1.11.11 (2020-04-23T17:06:49-08:00).
|
||||||
|
revision: v1.11.11
|
||||||
|
|
||||||
|
license: BSD-3-Clause
|
||||||
|
|
||||||
|
vendoring:
|
||||||
|
url: https://github.com/ValveSoftware/openvr
|
||||||
|
source-hosting: github
|
||||||
|
tracking: tag
|
||||||
|
|
||||||
|
exclude:
|
||||||
|
- "**"
|
||||||
|
|
||||||
|
include:
|
||||||
|
- LICENSE
|
||||||
|
- README.md
|
||||||
|
- headers/openvr.h
|
||||||
|
- src/README
|
||||||
|
- src/*.h
|
||||||
|
- src/*.cpp
|
||||||
|
- src/vrcommon
|
||||||
|
|
||||||
|
update-actions:
|
||||||
|
- action: move-dir
|
||||||
|
from: '{vendor_dir}/src/vrcommon'
|
||||||
|
to: '{vendor_dir}/src'
|
||||||
|
|
||||||
|
# The "src/jsoncpp.cpp" file and the "src/json" directory can be skipped. OpenVR
|
||||||
|
# uses the jsoncpp library, which we have already imported elsewhere. If
|
||||||
|
# warnings about using deprecated jsoncpp classes show up during compilation
|
||||||
|
# you might need to reapply the patch in bug 1598288. It replaces uses of the
|
||||||
|
# `Json::Reader` and `Json::StyledWriter` classes with the more modern
|
||||||
|
# `Json::CharReaderBuilder` and `Json::StreamWriterBuilder`.
|
||||||
|
- action: delete-path
|
||||||
|
path: '{vendor_dir}/src/jsoncpp.cpp'
|
||||||
|
|
||||||
|
patches:
|
||||||
|
- "mozilla.patch"
|
||||||
621
gfx/vr/service/openvr/mozilla.patch
Normal file
621
gfx/vr/service/openvr/mozilla.patch
Normal file
|
|
@ -0,0 +1,621 @@
|
||||||
|
Legacy steps to update the library:
|
||||||
|
|
||||||
|
- Update the "strtools_public.h" and "strtools_public.cpp" files, commenting out
|
||||||
|
the "Uint64ToString", "wcsncpy_s", and "strncpy_s" functions.
|
||||||
|
The "Uint64ToString" function name conflicts with another used in Gecko and
|
||||||
|
the "errno_t" return type returned by the other functions is not defined in
|
||||||
|
Mozilla's macOS continuous integration build environments. Fortunately, the
|
||||||
|
OpenVR SDK does not use these functions.
|
||||||
|
|
||||||
|
- Replace the #define VR_INTERFACE in openvr.h to avoid extern'ing the functions.
|
||||||
|
Unlike the usual OpenVR API builds, we are not building a separate dll.
|
||||||
|
|
||||||
|
- Add explicit in CVRSettingHelper constructor.
|
||||||
|
|
||||||
|
- In strtools_public.cpp/.h, ensure that UTF16to8 and UTF8to16 are only
|
||||||
|
compiled under
|
||||||
|
#if defined( _WIN32 )
|
||||||
|
and redefine those functions to use ::WideCharToMultiByte and
|
||||||
|
MultiByteToWideChar, respectively. These are modified because the original
|
||||||
|
implementations contain unsupported try-catch.
|
||||||
|
|
||||||
|
- In strtools_public.cpp, remove the definition of convert_type.
|
||||||
|
|
||||||
|
- In strtools_public.cpp, remove the include of <codecvt>, as this causes
|
||||||
|
problems in compiling on Linux.
|
||||||
|
|
||||||
|
- In pathtools_public.cpp/.h, comment out Path_UrlToFilePath and
|
||||||
|
Path_FilePathToUrl to avoid a compile error because 'alloca' isn't defined.
|
||||||
|
|
||||||
|
- In vrpathregistry_public.cpp, CVRPathRegistry_Public::BLoadFromFile contains
|
||||||
|
a try-catch, which is not permitted. This code is simply commented out, but
|
||||||
|
Bug 1640068 - OpenVR code can fail JSON parsing and raise exceptions
|
||||||
|
is filed to address a safe fallback in the error condition.
|
||||||
|
|
||||||
|
diff --git a/headers/openvr.h b/headers/openvr.h
|
||||||
|
index ec26ef41564b9..b95fb1db7e0fe 100644
|
||||||
|
--- a/headers/openvr.h
|
||||||
|
+++ b/headers/openvr.h
|
||||||
|
@@ -1932,30 +1932,33 @@ struct ImuSample_t
|
||||||
|
|
||||||
|
#pragma pack( pop )
|
||||||
|
|
||||||
|
+#define VR_INTERFACE
|
||||||
|
+
|
||||||
|
+// Mozilla: see mozilla.patch for more details
|
||||||
|
// figure out how to import from the VR API dll
|
||||||
|
-#if defined(_WIN32)
|
||||||
|
-
|
||||||
|
- #if !defined(OPENVR_BUILD_STATIC)
|
||||||
|
- #ifdef VR_API_EXPORT
|
||||||
|
- #define VR_INTERFACE extern "C" __declspec( dllexport )
|
||||||
|
- #else
|
||||||
|
- #define VR_INTERFACE extern "C" __declspec( dllimport )
|
||||||
|
- #endif
|
||||||
|
- #else
|
||||||
|
- #define VR_INTERFACE extern "C"
|
||||||
|
- #endif
|
||||||
|
-
|
||||||
|
-#elif defined(__GNUC__) || defined(COMPILER_GCC) || defined(__APPLE__)
|
||||||
|
-
|
||||||
|
-#ifdef VR_API_EXPORT
|
||||||
|
- #define VR_INTERFACE extern "C" __attribute__((visibility("default")))
|
||||||
|
-#else
|
||||||
|
- #define VR_INTERFACE extern "C"
|
||||||
|
-#endif
|
||||||
|
+// #if defined(_WIN32)
|
||||||
|
|
||||||
|
-#else
|
||||||
|
- #error "Unsupported Platform."
|
||||||
|
-#endif
|
||||||
|
+// #if !defined(OPENVR_BUILD_STATIC)
|
||||||
|
+// #ifdef VR_API_EXPORT
|
||||||
|
+// #define VR_INTERFACE extern "C" __declspec( dllexport )
|
||||||
|
+// #else
|
||||||
|
+// #define VR_INTERFACE extern "C" __declspec( dllimport )
|
||||||
|
+// #endif
|
||||||
|
+// #else
|
||||||
|
+// #define VR_INTERFACE extern "C"
|
||||||
|
+// #endif
|
||||||
|
+
|
||||||
|
+// #elif defined(__GNUC__) || defined(COMPILER_GCC) || defined(__APPLE__)
|
||||||
|
+
|
||||||
|
+// #ifdef VR_API_EXPORT
|
||||||
|
+// #define VR_INTERFACE extern "C" __attribute__((visibility("default")))
|
||||||
|
+// #else
|
||||||
|
+// #define VR_INTERFACE extern "C"
|
||||||
|
+// #endif
|
||||||
|
+
|
||||||
|
+// #else
|
||||||
|
+// #error "Unsupported Platform."
|
||||||
|
+// #endif
|
||||||
|
|
||||||
|
|
||||||
|
#if defined( _WIN32 )
|
||||||
|
@@ -2557,7 +2560,8 @@ namespace vr
|
||||||
|
{
|
||||||
|
IVRSettings *m_pSettings;
|
||||||
|
public:
|
||||||
|
- CVRSettingHelper( IVRSettings *pSettings )
|
||||||
|
+ // Mozilla: see mozilla.patch for more details
|
||||||
|
+ explicit CVRSettingHelper( IVRSettings *pSettings )
|
||||||
|
{
|
||||||
|
m_pSettings = pSettings;
|
||||||
|
}
|
||||||
|
diff --git a/src/pathtools_public.cpp b/src/pathtools_public.cpp
|
||||||
|
index eb1373a57b1a5..e7f6d6ca1bf45 100644
|
||||||
|
--- a/src/pathtools_public.cpp
|
||||||
|
+++ b/src/pathtools_public.cpp
|
||||||
|
@@ -798,52 +798,54 @@ bool Path_WriteStringToTextFileAtomic( const std::string &strFilename, const cha
|
||||||
|
#define FILE_URL_PREFIX "file://"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
+// Mozilla: see mozilla.patch for more details
|
||||||
|
// ----------------------------------------------------------------------------------------------------------------------------
|
||||||
|
// Purpose: Turns a path to a file on disk into a URL (or just returns the value if it's already a URL)
|
||||||
|
// ----------------------------------------------------------------------------------------------------------------------------
|
||||||
|
-std::string Path_FilePathToUrl( const std::string & sRelativePath, const std::string & sBasePath )
|
||||||
|
-{
|
||||||
|
- if ( StringHasPrefix( sRelativePath, "http://" )
|
||||||
|
- || StringHasPrefix( sRelativePath, "https://" )
|
||||||
|
- || StringHasPrefix( sRelativePath, "vr-input-workshop://" )
|
||||||
|
- || StringHasPrefix( sRelativePath, "file://" )
|
||||||
|
- )
|
||||||
|
- {
|
||||||
|
- return sRelativePath;
|
||||||
|
- }
|
||||||
|
- else
|
||||||
|
- {
|
||||||
|
- std::string sAbsolute = Path_MakeAbsolute( sRelativePath, sBasePath );
|
||||||
|
- if ( sAbsolute.empty() )
|
||||||
|
- return sAbsolute;
|
||||||
|
- sAbsolute = Path_FixSlashes( sAbsolute, '/' );
|
||||||
|
-
|
||||||
|
- size_t unBufferSize = sAbsolute.length() * 3;
|
||||||
|
- char *pchBuffer = (char *)alloca( unBufferSize );
|
||||||
|
- V_URLEncodeFullPath( pchBuffer, (int)unBufferSize, sAbsolute.c_str(), (int)sAbsolute.length() );
|
||||||
|
-
|
||||||
|
- return std::string( FILE_URL_PREFIX ) + pchBuffer;
|
||||||
|
- }
|
||||||
|
-}
|
||||||
|
-
|
||||||
|
+// std::string Path_FilePathToUrl( const std::string & sRelativePath, const std::string & sBasePath )
|
||||||
|
+// {
|
||||||
|
+// if ( StringHasPrefix( sRelativePath, "http://" )
|
||||||
|
+// || StringHasPrefix( sRelativePath, "https://" )
|
||||||
|
+// || StringHasPrefix( sRelativePath, "vr-input-workshop://" )
|
||||||
|
+// || StringHasPrefix( sRelativePath, "file://" )
|
||||||
|
+// )
|
||||||
|
+// {
|
||||||
|
+// return sRelativePath;
|
||||||
|
+// }
|
||||||
|
+// else
|
||||||
|
+// {
|
||||||
|
+// std::string sAbsolute = Path_MakeAbsolute( sRelativePath, sBasePath );
|
||||||
|
+// if ( sAbsolute.empty() )
|
||||||
|
+// return sAbsolute;
|
||||||
|
+// sAbsolute = Path_FixSlashes( sAbsolute, '/' );
|
||||||
|
+
|
||||||
|
+// size_t unBufferSize = sAbsolute.length() * 3;
|
||||||
|
+// char *pchBuffer = (char *)alloca( unBufferSize );
|
||||||
|
+// V_URLEncodeFullPath( pchBuffer, (int)unBufferSize, sAbsolute.c_str(), (int)sAbsolute.length() );
|
||||||
|
+
|
||||||
|
+// return std::string( FILE_URL_PREFIX ) + pchBuffer;
|
||||||
|
+// }
|
||||||
|
+// }
|
||||||
|
+
|
||||||
|
+// Mozilla: see mozilla.patch for more details
|
||||||
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
// Purpose: Strips off file:// off a URL and returns the path. For other kinds of URLs an empty string is returned
|
||||||
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
-std::string Path_UrlToFilePath( const std::string & sFileUrl )
|
||||||
|
-{
|
||||||
|
- if ( !strnicmp( sFileUrl.c_str(), FILE_URL_PREFIX, strlen( FILE_URL_PREFIX ) ) )
|
||||||
|
- {
|
||||||
|
- char *pchBuffer = (char *)alloca( sFileUrl.length() );
|
||||||
|
- V_URLDecodeNoPlusForSpace( pchBuffer, (int)sFileUrl.length(),
|
||||||
|
- sFileUrl.c_str() + strlen( FILE_URL_PREFIX ), (int)( sFileUrl.length() - strlen( FILE_URL_PREFIX ) ) );
|
||||||
|
-
|
||||||
|
- return Path_FixSlashes( pchBuffer );
|
||||||
|
- }
|
||||||
|
- else
|
||||||
|
- {
|
||||||
|
- return "";
|
||||||
|
- }
|
||||||
|
-}
|
||||||
|
+// std::string Path_UrlToFilePath( const std::string & sFileUrl )
|
||||||
|
+// {
|
||||||
|
+// if ( !strnicmp( sFileUrl.c_str(), FILE_URL_PREFIX, strlen( FILE_URL_PREFIX ) ) )
|
||||||
|
+// {
|
||||||
|
+// char *pchBuffer = (char *)alloca( sFileUrl.length() );
|
||||||
|
+// V_URLDecodeNoPlusForSpace( pchBuffer, (int)sFileUrl.length(),
|
||||||
|
+// sFileUrl.c_str() + strlen( FILE_URL_PREFIX ), (int)( sFileUrl.length() - strlen( FILE_URL_PREFIX ) ) );
|
||||||
|
+
|
||||||
|
+// return Path_FixSlashes( pchBuffer );
|
||||||
|
+// }
|
||||||
|
+// else
|
||||||
|
+// {
|
||||||
|
+// return "";
|
||||||
|
+// }
|
||||||
|
+// }
|
||||||
|
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
diff --git a/src/pathtools_public.h b/src/pathtools_public.h
|
||||||
|
index 9a120f43d6a57..33688fba2f4ad 100644
|
||||||
|
--- a/src/pathtools_public.h
|
||||||
|
+++ b/src/pathtools_public.h
|
||||||
|
@@ -98,8 +98,9 @@ std::string Path_ReadTextFile( const std::string &strFilename );
|
||||||
|
bool Path_WriteStringToTextFile( const std::string &strFilename, const char *pchData );
|
||||||
|
bool Path_WriteStringToTextFileAtomic( const std::string &strFilename, const char *pchData );
|
||||||
|
|
||||||
|
+// Mozilla: see mozilla.patch for more details
|
||||||
|
/** Returns a file:// url for paths, or an http or https url if that's what was provided */
|
||||||
|
-std::string Path_FilePathToUrl( const std::string & sRelativePath, const std::string & sBasePath );
|
||||||
|
+// std::string Path_FilePathToUrl( const std::string & sRelativePath, const std::string & sBasePath );
|
||||||
|
|
||||||
|
/** Strips off file:// off a URL and returns the path. For other kinds of URLs an empty string is returned */
|
||||||
|
std::string Path_UrlToFilePath( const std::string & sFileUrl );
|
||||||
|
diff --git a/src/strtools_public.cpp b/src/strtools_public.cpp
|
||||||
|
index f9ce0fd5ea799..f52f8e9004982 100644
|
||||||
|
--- a/src/strtools_public.cpp
|
||||||
|
+++ b/src/strtools_public.cpp
|
||||||
|
@@ -4,11 +4,12 @@
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <sstream>
|
||||||
|
-#include <codecvt>
|
||||||
|
+// Mozilla: see mozilla.patch for more details
|
||||||
|
+// #include <codecvt>
|
||||||
|
#include <iostream>
|
||||||
|
#include <functional>
|
||||||
|
#include <locale>
|
||||||
|
-#include <codecvt>
|
||||||
|
+// #include <codecvt>
|
||||||
|
|
||||||
|
#if defined( _WIN32 )
|
||||||
|
#include <windows.h>
|
||||||
|
@@ -57,40 +58,74 @@ bool StringHasSuffixCaseSensitive( const std::string &sString, const std::string
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// Purpose:
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
-typedef std::codecvt_utf8< wchar_t > convert_type;
|
||||||
|
+// Mozilla: see mozilla.patch for more details
|
||||||
|
+//typedef std::codecvt_utf8< wchar_t > convert_type;
|
||||||
|
|
||||||
|
+// Mozilla: see mozilla.patch for more details
|
||||||
|
+#if defined( _WIN32 )
|
||||||
|
std::string UTF16to8(const wchar_t * in)
|
||||||
|
{
|
||||||
|
- static std::wstring_convert< convert_type, wchar_t > s_converter; // construction of this can be expensive (or even serialized) depending on locale
|
||||||
|
-
|
||||||
|
- try
|
||||||
|
- {
|
||||||
|
- return s_converter.to_bytes( in );
|
||||||
|
- }
|
||||||
|
- catch ( ... )
|
||||||
|
+ int retLength = ::WideCharToMultiByte(CP_UTF8, 0, in, -1, nullptr, 0, nullptr, nullptr);
|
||||||
|
+ if (retLength == 0)
|
||||||
|
{
|
||||||
|
return std::string();
|
||||||
|
}
|
||||||
|
+
|
||||||
|
+ char* retString = new char[retLength];
|
||||||
|
+ ::WideCharToMultiByte(CP_UTF8, 0, in, -1, retString, retLength, nullptr, nullptr);
|
||||||
|
+
|
||||||
|
+ std::string retStringValue(retString);
|
||||||
|
+
|
||||||
|
+ delete[] retString;
|
||||||
|
+
|
||||||
|
+ return retStringValue;
|
||||||
|
+
|
||||||
|
+ // static std::wstring_convert< convert_type, wchar_t > s_converter; // construction of this can be expensive (or even serialized) depending on locale
|
||||||
|
+
|
||||||
|
+ // try
|
||||||
|
+ // {
|
||||||
|
+ // return s_converter.to_bytes( in );
|
||||||
|
+ // }
|
||||||
|
+ // catch ( ... )
|
||||||
|
+ // {
|
||||||
|
+ // return std::string();
|
||||||
|
+ // }
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string UTF16to8( const std::wstring & in ) { return UTF16to8( in.c_str() ); }
|
||||||
|
|
||||||
|
-
|
||||||
|
+// Mozilla: see mozilla.patch for more details
|
||||||
|
std::wstring UTF8to16(const char * in)
|
||||||
|
{
|
||||||
|
- static std::wstring_convert< convert_type, wchar_t > s_converter; // construction of this can be expensive (or even serialized) depending on locale
|
||||||
|
-
|
||||||
|
- try
|
||||||
|
- {
|
||||||
|
- return s_converter.from_bytes( in );
|
||||||
|
- }
|
||||||
|
- catch ( ... )
|
||||||
|
+ int retLength = ::MultiByteToWideChar(CP_UTF8, 0, in, -1, nullptr, 0);
|
||||||
|
+ if (retLength == 0)
|
||||||
|
{
|
||||||
|
return std::wstring();
|
||||||
|
}
|
||||||
|
+
|
||||||
|
+ wchar_t* retString = new wchar_t[retLength];
|
||||||
|
+ ::MultiByteToWideChar(CP_UTF8, 0, in, -1, retString, retLength);
|
||||||
|
+
|
||||||
|
+ std::wstring retStringValue(retString);
|
||||||
|
+
|
||||||
|
+ delete[] retString;
|
||||||
|
+
|
||||||
|
+ return retStringValue;
|
||||||
|
+
|
||||||
|
+ //static std::wstring_convert< convert_type, wchar_t > s_converter; // construction of this can be expensive (or even serialized) depending on locale
|
||||||
|
+
|
||||||
|
+ //try
|
||||||
|
+ //{
|
||||||
|
+ // return s_converter.from_bytes( in );
|
||||||
|
+ //}
|
||||||
|
+ //catch ( ... )
|
||||||
|
+ //{
|
||||||
|
+ // return std::wstring();
|
||||||
|
+ //}
|
||||||
|
}
|
||||||
|
|
||||||
|
std::wstring UTF8to16( const std::string & in ) { return UTF8to16( in.c_str() ); }
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
|
||||||
|
#if defined( _WIN32 )
|
||||||
|
@@ -173,16 +208,17 @@ uint32_t ReturnStdString( const std::string & sValue, char *pchBuffer, uint32_t
|
||||||
|
|
||||||
|
|
||||||
|
/** Returns a std::string from a uint64_t */
|
||||||
|
-std::string Uint64ToString( uint64_t ulValue )
|
||||||
|
-{
|
||||||
|
- char buf[ 22 ];
|
||||||
|
-#if defined( _WIN32 )
|
||||||
|
- sprintf_s( buf, "%llu", ulValue );
|
||||||
|
-#else
|
||||||
|
- snprintf( buf, sizeof( buf ), "%llu", (long long unsigned int ) ulValue );
|
||||||
|
-#endif
|
||||||
|
- return buf;
|
||||||
|
-}
|
||||||
|
+// Mozilla: see mozilla.patch for more details
|
||||||
|
+// std::string Uint64ToString( uint64_t ulValue )
|
||||||
|
+// {
|
||||||
|
+// char buf[ 22 ];
|
||||||
|
+// #if defined( _WIN32 )
|
||||||
|
+// sprintf_s( buf, "%llu", ulValue );
|
||||||
|
+// #else
|
||||||
|
+// snprintf( buf, sizeof( buf ), "%llu", (long long unsigned int ) ulValue );
|
||||||
|
+// #endif
|
||||||
|
+// return buf;
|
||||||
|
+// }
|
||||||
|
|
||||||
|
|
||||||
|
/** returns a uint64_t from a string */
|
||||||
|
@@ -451,84 +487,85 @@ std::vector<std::string> TokenizeString( const std::string & sString, char cToke
|
||||||
|
return vecStrings;
|
||||||
|
}
|
||||||
|
|
||||||
|
+// Mozilla: see mozilla.patch for more details
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// Purpose: Repairs a should-be-UTF-8 string to a for-sure-is-UTF-8 string, plus return boolean if we subbed in '?' somewhere
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
-bool RepairUTF8( const char *pbegin, const char *pend, std::string & sOutputUtf8 )
|
||||||
|
-{
|
||||||
|
- typedef std::codecvt_utf8<char32_t> facet_type;
|
||||||
|
- facet_type myfacet;
|
||||||
|
-
|
||||||
|
- std::mbstate_t mystate = std::mbstate_t();
|
||||||
|
-
|
||||||
|
- sOutputUtf8.clear();
|
||||||
|
- sOutputUtf8.reserve( pend - pbegin );
|
||||||
|
- bool bSqueakyClean = true;
|
||||||
|
-
|
||||||
|
- const char *pmid = pbegin;
|
||||||
|
- while ( pmid != pend )
|
||||||
|
- {
|
||||||
|
- bool bHasError = false;
|
||||||
|
- bool bHasValidData = false;
|
||||||
|
-
|
||||||
|
- char32_t out = 0xdeadbeef, *pout;
|
||||||
|
- pbegin = pmid;
|
||||||
|
- switch ( myfacet.in( mystate, pbegin, pend, pmid, &out, &out + 1, pout ) )
|
||||||
|
- {
|
||||||
|
- case facet_type::ok:
|
||||||
|
- bHasValidData = true;
|
||||||
|
- break;
|
||||||
|
-
|
||||||
|
- case facet_type::noconv:
|
||||||
|
- // unexpected! always converting type
|
||||||
|
- bSqueakyClean = false;
|
||||||
|
- break;
|
||||||
|
-
|
||||||
|
- case facet_type::partial:
|
||||||
|
- bHasError = pbegin == pmid;
|
||||||
|
- if ( bHasError )
|
||||||
|
- {
|
||||||
|
- bSqueakyClean = false;
|
||||||
|
- }
|
||||||
|
- else
|
||||||
|
- {
|
||||||
|
- bHasValidData = true;
|
||||||
|
- }
|
||||||
|
- break;
|
||||||
|
-
|
||||||
|
- case facet_type::error:
|
||||||
|
- bHasError = true;
|
||||||
|
- bSqueakyClean = false;
|
||||||
|
- break;
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- if ( bHasValidData )
|
||||||
|
- {
|
||||||
|
- // could convert back, but no need
|
||||||
|
- for ( const char *p = pbegin; p != pmid; ++p )
|
||||||
|
- {
|
||||||
|
- sOutputUtf8 += *p;
|
||||||
|
- }
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- if ( bHasError )
|
||||||
|
- {
|
||||||
|
- sOutputUtf8 += '?';
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- if ( pmid == pbegin )
|
||||||
|
- {
|
||||||
|
- pmid++;
|
||||||
|
- }
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- return bSqueakyClean;
|
||||||
|
-}
|
||||||
|
-
|
||||||
|
-//-----------------------------------------------------------------------------
|
||||||
|
-// Purpose: Repairs a should-be-UTF-8 string to a for-sure-is-UTF-8 string, plus return boolean if we subbed in '?' somewhere
|
||||||
|
-//-----------------------------------------------------------------------------
|
||||||
|
-bool RepairUTF8( const std::string & sInputUtf8, std::string & sOutputUtf8 )
|
||||||
|
-{
|
||||||
|
- return RepairUTF8( sInputUtf8.data(), sInputUtf8.data() + sInputUtf8.size(), sOutputUtf8 );
|
||||||
|
-}
|
||||||
|
+// bool RepairUTF8( const char *pbegin, const char *pend, std::string & sOutputUtf8 )
|
||||||
|
+// {
|
||||||
|
+// typedef std::codecvt_utf8<char32_t> facet_type;
|
||||||
|
+// facet_type myfacet;
|
||||||
|
+
|
||||||
|
+// std::mbstate_t mystate = std::mbstate_t();
|
||||||
|
+
|
||||||
|
+// sOutputUtf8.clear();
|
||||||
|
+// sOutputUtf8.reserve( pend - pbegin );
|
||||||
|
+// bool bSqueakyClean = true;
|
||||||
|
+
|
||||||
|
+// const char *pmid = pbegin;
|
||||||
|
+// while ( pmid != pend )
|
||||||
|
+// {
|
||||||
|
+// bool bHasError = false;
|
||||||
|
+// bool bHasValidData = false;
|
||||||
|
+
|
||||||
|
+// char32_t out = 0xdeadbeef, *pout;
|
||||||
|
+// pbegin = pmid;
|
||||||
|
+// switch ( myfacet.in( mystate, pbegin, pend, pmid, &out, &out + 1, pout ) )
|
||||||
|
+// {
|
||||||
|
+// case facet_type::ok:
|
||||||
|
+// bHasValidData = true;
|
||||||
|
+// break;
|
||||||
|
+
|
||||||
|
+// case facet_type::noconv:
|
||||||
|
+// // unexpected! always converting type
|
||||||
|
+// bSqueakyClean = false;
|
||||||
|
+// break;
|
||||||
|
+
|
||||||
|
+// case facet_type::partial:
|
||||||
|
+// bHasError = pbegin == pmid;
|
||||||
|
+// if ( bHasError )
|
||||||
|
+// {
|
||||||
|
+// bSqueakyClean = false;
|
||||||
|
+// }
|
||||||
|
+// else
|
||||||
|
+// {
|
||||||
|
+// bHasValidData = true;
|
||||||
|
+// }
|
||||||
|
+// break;
|
||||||
|
+
|
||||||
|
+// case facet_type::error:
|
||||||
|
+// bHasError = true;
|
||||||
|
+// bSqueakyClean = false;
|
||||||
|
+// break;
|
||||||
|
+// }
|
||||||
|
+
|
||||||
|
+// if ( bHasValidData )
|
||||||
|
+// {
|
||||||
|
+// // could convert back, but no need
|
||||||
|
+// for ( const char *p = pbegin; p != pmid; ++p )
|
||||||
|
+// {
|
||||||
|
+// sOutputUtf8 += *p;
|
||||||
|
+// }
|
||||||
|
+// }
|
||||||
|
+
|
||||||
|
+// if ( bHasError )
|
||||||
|
+// {
|
||||||
|
+// sOutputUtf8 += '?';
|
||||||
|
+// }
|
||||||
|
+
|
||||||
|
+// if ( pmid == pbegin )
|
||||||
|
+// {
|
||||||
|
+// pmid++;
|
||||||
|
+// }
|
||||||
|
+// }
|
||||||
|
+
|
||||||
|
+// return bSqueakyClean;
|
||||||
|
+// }
|
||||||
|
+
|
||||||
|
+// //-----------------------------------------------------------------------------
|
||||||
|
+// // Purpose: Repairs a should-be-UTF-8 string to a for-sure-is-UTF-8 string, plus return boolean if we subbed in '?' somewhere
|
||||||
|
+// //-----------------------------------------------------------------------------
|
||||||
|
+// bool RepairUTF8( const std::string & sInputUtf8, std::string & sOutputUtf8 )
|
||||||
|
+// {
|
||||||
|
+// return RepairUTF8( sInputUtf8.data(), sInputUtf8.data() + sInputUtf8.size(), sOutputUtf8 );
|
||||||
|
+// }
|
||||||
|
diff --git a/src/strtools_public.h b/src/strtools_public.h
|
||||||
|
index 349b5b38fd387..067bbe1b1b074 100644
|
||||||
|
--- a/src/strtools_public.h
|
||||||
|
+++ b/src/strtools_public.h
|
||||||
|
@@ -14,6 +14,8 @@ bool StringHasPrefixCaseSensitive( const std::string & sString, const std::strin
|
||||||
|
bool StringHasSuffix( const std::string &sString, const std::string &sSuffix );
|
||||||
|
bool StringHasSuffixCaseSensitive( const std::string &sString, const std::string &sSuffix );
|
||||||
|
|
||||||
|
+// Mozilla: see mozilla.patch for more details
|
||||||
|
+#if defined( _WIN32 )
|
||||||
|
/** converts a UTF-16 string to a UTF-8 string */
|
||||||
|
std::string UTF16to8( const wchar_t * in );
|
||||||
|
std::string UTF16to8( const std::wstring & in );
|
||||||
|
@@ -22,6 +24,7 @@ std::string UTF16to8( const std::wstring & in );
|
||||||
|
std::wstring UTF8to16(const char * in);
|
||||||
|
std::wstring UTF8to16( const std::string & in );
|
||||||
|
#define Utf16FromUtf8 UTF8to16
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
#if defined( _WIN32 )
|
||||||
|
std::string DefaultACPtoUTF8( const char *pszStr );
|
||||||
|
@@ -69,15 +72,15 @@ inline int strnicmp( const char *pStr1, const char *pStr2, size_t unBufferLen )
|
||||||
|
#if defined( OSX )
|
||||||
|
// behaviors ensure NULL-termination at least as well as _TRUNCATE does, but
|
||||||
|
// wcsncpy_s/strncpy_s can non-NULL-terminate, wcslcpy/strlcpy can not.
|
||||||
|
-inline errno_t wcsncpy_s(wchar_t *strDest, size_t numberOfElements, const wchar_t *strSource, size_t count)
|
||||||
|
-{
|
||||||
|
- return wcslcpy(strDest, strSource, numberOfElements);
|
||||||
|
-}
|
||||||
|
+// inline errno_t wcsncpy_s(wchar_t *strDest, size_t numberOfElements, const wchar_t *strSource, size_t count)
|
||||||
|
+// {
|
||||||
|
+// return wcslcpy(strDest, strSource, numberOfElements);
|
||||||
|
+// }
|
||||||
|
|
||||||
|
-inline errno_t strncpy_s(char *strDest, size_t numberOfElements, const char *strSource, size_t count)
|
||||||
|
-{
|
||||||
|
- return strlcpy(strDest, strSource, numberOfElements);
|
||||||
|
-}
|
||||||
|
+// inline errno_t strncpy_s(char *strDest, size_t numberOfElements, const char *strSource, size_t count)
|
||||||
|
+// {
|
||||||
|
+// return strlcpy(strDest, strSource, numberOfElements);
|
||||||
|
+// }
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
@@ -108,7 +111,8 @@ inline uint64_t strtoull(const char *str, char **endptr, int base) { return _str
|
||||||
|
uint32_t ReturnStdString( const std::string & sValue, char *pchBuffer, uint32_t unBufferLen );
|
||||||
|
|
||||||
|
/** Returns a std::string from a uint64_t */
|
||||||
|
-std::string Uint64ToString( uint64_t ulValue );
|
||||||
|
+// Mozilla: see mozilla.patch for more details
|
||||||
|
+//std::string Uint64ToString( uint64_t ulValue );
|
||||||
|
|
||||||
|
/** returns a uint64_t from a string */
|
||||||
|
uint64_t StringToUint64( const std::string & sValue );
|
||||||
|
diff --git a/src/vrpathregistry_public.cpp b/src/vrpathregistry_public.cpp
|
||||||
|
index 6a7f457bbacf3..f40fc1cda1acd 100644
|
||||||
|
--- a/src/vrpathregistry_public.cpp
|
||||||
|
+++ b/src/vrpathregistry_public.cpp
|
||||||
|
@@ -208,7 +208,7 @@ bool CVRPathRegistry_Public::ToJsonString( std::string &sJsonString )
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
-
|
||||||
|
+// Mozilla: see mozilla.patch for more details
|
||||||
|
// ---------------------------------------------------------------------------
|
||||||
|
// Purpose: Loads the config file from its well known location
|
||||||
|
// ---------------------------------------------------------------------------
|
||||||
|
@@ -239,7 +239,8 @@ bool CVRPathRegistry_Public::BLoadFromFile( std::string *psLoadError )
|
||||||
|
std::istringstream istream( sRegistryContents );
|
||||||
|
std::string sErrors;
|
||||||
|
|
||||||
|
- try {
|
||||||
|
+// try
|
||||||
|
+ {
|
||||||
|
if ( !parseFromStream( builder, istream, &root, &sErrors ) )
|
||||||
|
{
|
||||||
|
if ( psLoadError )
|
||||||
|
@@ -257,14 +258,14 @@ bool CVRPathRegistry_Public::BLoadFromFile( std::string *psLoadError )
|
||||||
|
ParseStringListFromJson( &m_vecExternalDrivers, root, "external_drivers" );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
- catch ( ... )
|
||||||
|
- {
|
||||||
|
- if ( psLoadError )
|
||||||
|
- {
|
||||||
|
- *psLoadError = "Unable to parse " + sRegPath + ": exception thrown in JSON library";
|
||||||
|
- }
|
||||||
|
- return false;
|
||||||
|
- }
|
||||||
|
+// catch ( ... )
|
||||||
|
+// {
|
||||||
|
+// if ( psLoadError )
|
||||||
|
+// {
|
||||||
|
+// *psLoadError = "Unable to parse " + sRegPath + ": exception thrown in JSON library";
|
||||||
|
+// }
|
||||||
|
+// return false;
|
||||||
|
+// }
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
@ -798,7 +798,7 @@ bool Path_WriteStringToTextFileAtomic( const std::string &strFilename, const cha
|
||||||
#define FILE_URL_PREFIX "file://"
|
#define FILE_URL_PREFIX "file://"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Mozilla: see README.mozilla for more details
|
// Mozilla: see mozilla.patch for more details
|
||||||
// ----------------------------------------------------------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------------------------------------------------------
|
||||||
// Purpose: Turns a path to a file on disk into a URL (or just returns the value if it's already a URL)
|
// Purpose: Turns a path to a file on disk into a URL (or just returns the value if it's already a URL)
|
||||||
// ----------------------------------------------------------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
@ -827,7 +827,7 @@ bool Path_WriteStringToTextFileAtomic( const std::string &strFilename, const cha
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// Mozilla: see README.mozilla for more details
|
// Mozilla: see mozilla.patch for more details
|
||||||
// -----------------------------------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------------------------------
|
||||||
// Purpose: Strips off file:// off a URL and returns the path. For other kinds of URLs an empty string is returned
|
// Purpose: Strips off file:// off a URL and returns the path. For other kinds of URLs an empty string is returned
|
||||||
// -----------------------------------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
|
@ -98,7 +98,7 @@ std::string Path_ReadTextFile( const std::string &strFilename );
|
||||||
bool Path_WriteStringToTextFile( const std::string &strFilename, const char *pchData );
|
bool Path_WriteStringToTextFile( const std::string &strFilename, const char *pchData );
|
||||||
bool Path_WriteStringToTextFileAtomic( const std::string &strFilename, const char *pchData );
|
bool Path_WriteStringToTextFileAtomic( const std::string &strFilename, const char *pchData );
|
||||||
|
|
||||||
// Mozilla: see README.mozilla for more details
|
// Mozilla: see mozilla.patch for more details
|
||||||
/** Returns a file:// url for paths, or an http or https url if that's what was provided */
|
/** Returns a file:// url for paths, or an http or https url if that's what was provided */
|
||||||
// std::string Path_FilePathToUrl( const std::string & sRelativePath, const std::string & sBasePath );
|
// std::string Path_FilePathToUrl( const std::string & sRelativePath, const std::string & sBasePath );
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
// Mozilla: see README.mozilla for more details
|
// Mozilla: see mozilla.patch for more details
|
||||||
// #include <codecvt>
|
// #include <codecvt>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
|
|
@ -58,10 +58,10 @@ bool StringHasSuffixCaseSensitive( const std::string &sString, const std::string
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// Purpose:
|
// Purpose:
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// Mozilla: see README.mozilla for more details
|
// Mozilla: see mozilla.patch for more details
|
||||||
//typedef std::codecvt_utf8< wchar_t > convert_type;
|
//typedef std::codecvt_utf8< wchar_t > convert_type;
|
||||||
|
|
||||||
// Mozilla: see README.mozilla for more details
|
// Mozilla: see mozilla.patch for more details
|
||||||
#if defined( _WIN32 )
|
#if defined( _WIN32 )
|
||||||
std::string UTF16to8(const wchar_t * in)
|
std::string UTF16to8(const wchar_t * in)
|
||||||
{
|
{
|
||||||
|
|
@ -94,7 +94,7 @@ std::string UTF16to8(const wchar_t * in)
|
||||||
|
|
||||||
std::string UTF16to8( const std::wstring & in ) { return UTF16to8( in.c_str() ); }
|
std::string UTF16to8( const std::wstring & in ) { return UTF16to8( in.c_str() ); }
|
||||||
|
|
||||||
// Mozilla: see README.mozilla for more details
|
// Mozilla: see mozilla.patch for more details
|
||||||
std::wstring UTF8to16(const char * in)
|
std::wstring UTF8to16(const char * in)
|
||||||
{
|
{
|
||||||
int retLength = ::MultiByteToWideChar(CP_UTF8, 0, in, -1, nullptr, 0);
|
int retLength = ::MultiByteToWideChar(CP_UTF8, 0, in, -1, nullptr, 0);
|
||||||
|
|
@ -208,7 +208,7 @@ uint32_t ReturnStdString( const std::string & sValue, char *pchBuffer, uint32_t
|
||||||
|
|
||||||
|
|
||||||
/** Returns a std::string from a uint64_t */
|
/** Returns a std::string from a uint64_t */
|
||||||
// Mozilla: see README.mozilla for more details
|
// Mozilla: see mozilla.patch for more details
|
||||||
// std::string Uint64ToString( uint64_t ulValue )
|
// std::string Uint64ToString( uint64_t ulValue )
|
||||||
// {
|
// {
|
||||||
// char buf[ 22 ];
|
// char buf[ 22 ];
|
||||||
|
|
@ -487,7 +487,7 @@ std::vector<std::string> TokenizeString( const std::string & sString, char cToke
|
||||||
return vecStrings;
|
return vecStrings;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Mozilla: see README.mozilla for more details
|
// Mozilla: see mozilla.patch for more details
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// Purpose: Repairs a should-be-UTF-8 string to a for-sure-is-UTF-8 string, plus return boolean if we subbed in '?' somewhere
|
// Purpose: Repairs a should-be-UTF-8 string to a for-sure-is-UTF-8 string, plus return boolean if we subbed in '?' somewhere
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ bool StringHasPrefixCaseSensitive( const std::string & sString, const std::strin
|
||||||
bool StringHasSuffix( const std::string &sString, const std::string &sSuffix );
|
bool StringHasSuffix( const std::string &sString, const std::string &sSuffix );
|
||||||
bool StringHasSuffixCaseSensitive( const std::string &sString, const std::string &sSuffix );
|
bool StringHasSuffixCaseSensitive( const std::string &sString, const std::string &sSuffix );
|
||||||
|
|
||||||
// Mozilla: see README.mozilla for more details
|
// Mozilla: see mozilla.patch for more details
|
||||||
#if defined( _WIN32 )
|
#if defined( _WIN32 )
|
||||||
/** converts a UTF-16 string to a UTF-8 string */
|
/** converts a UTF-16 string to a UTF-8 string */
|
||||||
std::string UTF16to8( const wchar_t * in );
|
std::string UTF16to8( const wchar_t * in );
|
||||||
|
|
@ -111,7 +111,7 @@ inline uint64_t strtoull(const char *str, char **endptr, int base) { return _str
|
||||||
uint32_t ReturnStdString( const std::string & sValue, char *pchBuffer, uint32_t unBufferLen );
|
uint32_t ReturnStdString( const std::string & sValue, char *pchBuffer, uint32_t unBufferLen );
|
||||||
|
|
||||||
/** Returns a std::string from a uint64_t */
|
/** Returns a std::string from a uint64_t */
|
||||||
// Mozilla: see README.mozilla for more details
|
// Mozilla: see mozilla.patch for more details
|
||||||
//std::string Uint64ToString( uint64_t ulValue );
|
//std::string Uint64ToString( uint64_t ulValue );
|
||||||
|
|
||||||
/** returns a uint64_t from a string */
|
/** returns a uint64_t from a string */
|
||||||
|
|
|
||||||
|
|
@ -208,7 +208,7 @@ bool CVRPathRegistry_Public::ToJsonString( std::string &sJsonString )
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Mozilla: see README.mozilla for more details
|
// Mozilla: see mozilla.patch for more details
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
// Purpose: Loads the config file from its well known location
|
// Purpose: Loads the config file from its well known location
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue