mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-14 13:30:48 +03:00
0027838: Foundation Classes - support wchar_t* input within TCollection_AsciiString and TCollection_ExtendedString
TCollection_ExtendedString/TCollection_AsciiString description has been updated to reflect usage of this classes for Unicode strings. TCollection_ExtendedString now defines constructor taking wchar_t* (all platforms) and method ::ToWideString() returning wchar_t* (Windows only). TCollection_AsciiString now defines constructor taking wchar_t*. TCollection_ExtendedString/TCollection_AsciiString now defines auxiliary methods ::StartsWith() and ::EndsWith(). TCollection_ExtendedString internals has been updated to eliminate duplicated code for converting between UTF-16 and UTF-8. Code has been cleaned up from redundant explicit conversions to wchar_t*. Global method OSD_OpenStream()/OSD_OpenFileBuf() have been replaced by C++ template to eliminate copy-paste for different STL collections. OSD_SharedLibrary now uses wide-char system API call LoadLibraryExW() on Windows for consistency. New macro Standard_UNUSED has been added for marking possibly unused functions and variables (to suppress gcc/clang compiler warnings).
This commit is contained in:
@@ -425,7 +425,7 @@ void Graphic3d_Group::Text (const TCollection_ExtendedString& theText,
|
||||
const Graphic3d_VerticalTextAlignment theVta,
|
||||
const Standard_Boolean theToEvalMinMax)
|
||||
{
|
||||
const NCollection_String aText ((Standard_Utf16Char* )theText.ToExtString());
|
||||
const NCollection_String aText (theText.ToExtString());
|
||||
Text (aText.ToCString(), thePoint, theHeight, theAngle,
|
||||
theTp, theHta, theVta, theToEvalMinMax);
|
||||
}
|
||||
@@ -444,7 +444,7 @@ void Graphic3d_Group::Text (const TCollection_ExtendedString& theText,
|
||||
const Standard_Boolean theToEvalMinMax,
|
||||
const Standard_Boolean theHasOwnAnchor)
|
||||
{
|
||||
const NCollection_String aText ((Standard_Utf16Char*)(theText.ToExtString()));
|
||||
const NCollection_String aText (theText.ToExtString());
|
||||
Text (aText.ToCString(),
|
||||
theOrientation,
|
||||
theHeight,
|
||||
@@ -495,7 +495,7 @@ void Graphic3d_Group::Text (const TCollection_ExtendedString& theText,
|
||||
const Standard_Real theHeight,
|
||||
const Standard_Boolean theToEvalMinMax)
|
||||
{
|
||||
const NCollection_String aText ((Standard_Utf16Char* )theText.ToExtString());
|
||||
const NCollection_String aText (theText.ToExtString());
|
||||
Text (aText.ToCString(), thePoint, theHeight, 0.0,
|
||||
Graphic3d_TP_RIGHT, Graphic3d_HTA_LEFT, Graphic3d_VTA_BOTTOM, theToEvalMinMax);
|
||||
}
|
||||
|
Reference in New Issue
Block a user