21#ifndef MODEL_IMPORT_INTERNAL_H
22#define MODEL_IMPORT_INTERNAL_H
70 std::uint64_t aMaxExpandedBytes, std::string& aExpanded );
89 const char*
what() const noexcept
override {
return "Model import canceled"; }
102 m_previousMode = _configthreadlocale( _ENABLE_PER_THREAD_LOCALE );
103 const char* current = std::setlocale( LC_NUMERIC,
nullptr );
106 m_previousLocale = current;
108 std::setlocale( LC_NUMERIC,
"C" );
113 if( !m_previousLocale.empty() )
114 std::setlocale( LC_NUMERIC, m_previousLocale.c_str() );
116 if( m_previousMode > 0 )
117 _configthreadlocale( m_previousMode );
121 int m_previousMode = _DISABLE_PER_THREAD_LOCALE;
122 std::string m_previousLocale;
126 locale_t current = uselocale(
static_cast<locale_t
>( 0 ) );
127 locale_t base = duplocale( current );
132 m_locale = newlocale( LC_NUMERIC_MASK,
"C", base );
const char * what() const noexcept override
MODEL_IMPORT_NUMERIC_LOCALE(const MODEL_IMPORT_NUMERIC_LOCALE &)=delete
MODEL_IMPORT_NUMERIC_LOCALE & operator=(const MODEL_IMPORT_NUMERIC_LOCALE &)=delete
MODEL_IMPORT_NUMERIC_LOCALE()
~MODEL_IMPORT_NUMERIC_LOCALE()
wxString CreateModelImportTempFileName(const wxString &aPrefix)
MODEL_IMPORT_GZIP_RESULT DecompressBoundedModel(const char *aData, std::size_t aSize, std::uint64_t aMaxExpandedBytes, std::string &aExpanded)
Expand a gzip stream into aExpanded, refusing anything over aMaxExpandedBytes.
S3D::MODEL_IMPORT_ERROR error
void Set(S3D::MODEL_IMPORT_ERROR aError, const char *aDiagnostic)
Remove the scratch file an importer expanded a compressed model into.
~MODEL_IMPORT_TEMP_FILE()