本文整理汇总了C++中ThreadContext::GetWindowsGlobalizationAdapter方法的典型用法代码示例。如果您正苦于以下问题:C++ ThreadContext::GetWindowsGlobalizationAdapter方法的具体用法?C++ ThreadContext::GetWindowsGlobalizationAdapter怎么用?C++ ThreadContext::GetWindowsGlobalizationAdapter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ThreadContext
的用法示例。
在下文中一共展示了ThreadContext::GetWindowsGlobalizationAdapter方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
void Js::CharClassifier::initClassifier(ScriptContext * scriptContext, CharClassifierModes identifierSupport,
CharClassifierModes whiteSpaceSupport, CharClassifierModes generalCharClassificationSupport, bool codePointSupport, bool isES6UnicodeVerboseEnabled, CharClassifierModes es6FallbackMode)
{
bool es6Supported = true;
bool es6ModeNeeded = identifierSupport == CharClassifierModes::ES6 || whiteSpaceSupport == CharClassifierModes::ES6 || generalCharClassificationSupport == CharClassifierModes::ES6;
#ifdef ENABLE_ES6_CHAR_CLASSIFIER
ThreadContext* threadContext = scriptContext->GetThreadContext();
Js::WindowsGlobalizationAdapter* globalizationAdapter = threadContext->GetWindowsGlobalizationAdapter();
Js::DelayLoadWindowsGlobalization* globLibrary = threadContext->GetWindowsGlobalizationLibrary();
if (es6ModeNeeded)
{
HRESULT hr = globalizationAdapter->EnsureDataTextObjectsInitialized(globLibrary);
// Failed to load windows.globalization.dll or jsintl.dll. No unicodeStatics support
// in that case.
if (FAILED(hr))
{
es6Supported = false;
es6FallbackMode = CharClassifierModes::ES5;
}
else
{
this->winGlobCharApi = globalizationAdapter->GetUnicodeStatics();
if (this->winGlobCharApi == nullptr)
{
// No fallback mode, then assert
if (es6FallbackMode == CharClassifierModes::ES6)
{
AssertMsg(false, "Windows::Data::Text::IUnicodeCharactersStatics not initialized");
//Fallback to ES5 just in case for fre builds.
es6FallbackMode = CharClassifierModes::ES5;
}
if (isES6UnicodeVerboseEnabled)
{
Output::Print(L"Windows::Data::Text::IUnicodeCharactersStatics not initialized\r\n");
}
//Default to non-es6
es6Supported = false;
}
}
}
#else
es6Supported = false;
es6FallbackMode = CharClassifierModes::ES5;
#endif
if (es6ModeNeeded && !es6Supported)
{
identifierSupport = identifierSupport == CharClassifierModes::ES6 ? es6FallbackMode : identifierSupport;
whiteSpaceSupport = whiteSpaceSupport == CharClassifierModes::ES6 ? es6FallbackMode : whiteSpaceSupport;
generalCharClassificationSupport = generalCharClassificationSupport == CharClassifierModes::ES6 ? es6FallbackMode : generalCharClassificationSupport;
}
bigCharIsIdStartFunc = identifierSupport == CharClassifierModes::ES6 ? &CharClassifier::BigCharIsIdStartES6 : &CharClassifier::BigCharIsIdStartDefault;
bigCharIsIdContinueFunc = identifierSupport == CharClassifierModes::ES6 ? &CharClassifier::BigCharIsIdContinueES6 : &CharClassifier::BigCharIsIdContinueDefault;
bigCharIsWhitespaceFunc = whiteSpaceSupport == CharClassifierModes::ES6 ? &CharClassifier::BigCharIsWhitespaceES6 : &CharClassifier::BigCharIsWhitespaceDefault;
skipWhiteSpaceFunc = codePointSupport ? &CharClassifier::SkipWhiteSpaceSurrogate : &CharClassifier::SkipWhiteSpaceNonSurrogate;
skipWhiteSpaceStartEndFunc = codePointSupport ? &CharClassifier::SkipWhiteSpaceSurrogateStartEnd : &CharClassifier::SkipWhiteSpaceNonSurrogateStartEnd;
skipIdentifierFunc = codePointSupport ? &CharClassifier::SkipIdentifierSurrogate : &CharClassifier::SkipIdentifierNonSurrogate;
skipIdentifierStartEndFunc = codePointSupport ? &CharClassifier::SkipIdentifierSurrogateStartEnd : &CharClassifier::SkipIdentifierNonSurrogateStartEnd;
if (generalCharClassificationSupport == CharClassifierModes::ES6)
{
getBigCharTypeFunc = &CharClassifier::GetBigCharTypeES6;
getBigCharFlagsFunc = &CharClassifier::GetBigCharFlagsES6;
}
else if (generalCharClassificationSupport == CharClassifierModes::ES5)
{
getBigCharTypeFunc = &GetBigCharType;
getBigCharFlagsFunc = &GetBigCharFlags5;
}
else
{
getBigCharTypeFunc = &GetBigCharType;
getBigCharFlagsFunc = &GetBigCharFlags;
}
}