{
_curPos = 0;
}
- _curLocale.clear();
}
//================================================================================
void ASCIIReader::initDoubleReading(int nbValues)
{
- init( nbValues, 3, 22 );
-
- // Correction 2 of getDouble(): set "C" numeric locale to read numbers
- // with dot decimal point separator, as it is in SAUVE files
- _curLocale = setlocale(LC_NUMERIC, "C");
+ init( nbValues, 3, 22 );
}
//================================================================================
else
{
_curPos = 0;
- if ( !_curLocale.empty() )
- {
- setlocale(LC_NUMERIC, _curLocale.c_str());
- _curLocale.clear();
- }
}
}
#define GIBI_EQUAL(var_str, stat_str) (strncmp (var_str, stat_str, strlen(stat_str)) == 0)
+namespace
+{
+ class Localizer
+ {
+ std::string _locale;
+ public:
+ Localizer()
+ {
+ _locale = setlocale(LC_NUMERIC, NULL);
+ setlocale(LC_NUMERIC, "C");
+ }
+ ~Localizer()
+ {
+ setlocale(LC_NUMERIC, _locale.c_str());
+ }
+ };
+}
+
//================================================================================
/*!
* \brief Creates a reader of a given sauve file
MEDCoupling::MEDFileData * SauvReader::loadInMEDFileDS()
{
+ Localizer loc; // localization, to read numbers in "C" locale
+
SauvUtilities::IntermediateMED iMed; // intermadiate DS
_iMed = &iMed;
std::size_t getHeapMemorySizeWithoutChildren() const { return 0; }
std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const { return std::vector<const BigMemoryObject *>(); }
protected:
- std::string _fileName, _curLocale;
+ std::string _fileName;
int _iRead, _nbToRead;
};
}