Commit 97112575 authored by Manuel Grizonnet's avatar Manuel Grizonnet

ENH:Get locale conf with std::locale

parent 39e7405c
......@@ -33,7 +33,7 @@ PURPOSE. See the above copyright notices for more information.
*/
int main(int argc, char* argv[])
{
const unsigned int nbParameters = 3;
const unsigned int nbParameters = 2;
std::ofstream os(argv[1]);
if (!os)
......@@ -57,22 +57,26 @@ int main(int argc, char* argv[])
paramVector.push_back("");
}
}
/** Get local configuration*/
const std::locale& mylocale = std::locale("");
/** Write parameters to the configuration file*/
os << "#Auto generated by config-properties \n"
<< "OTB_LANG="
<< paramVector[0]
<< mylocale.name()
<< "\n"
<< "OTB_STREAM_IMAGE_SIZE_TO_ACTIVATE_STREAMING="
<< paramVector[1]
<< paramVector[0]
<< "\n"
<< "OTB_STREAM_MAX_SIZE_BUFFER_FOR_STREAMING="
<< paramVector[2]
<< paramVector[1]
<< "\n"
<< "#End of config file properties generation"
<< std::endl;
os.close();
std::cout << "wrote file: " << argv[1] << std::endl;
exit(0);
......
......@@ -1136,5 +1136,5 @@ ADD_CUSTOM_COMMAND(
TARGET GenerateConfigProperties
POST_BUILD
COMMAND GenerateConfigProperties
ARGS "${otbconfigfile_DEFAULT}" "${OTB_LANG}" "${OTB_STREAM_IMAGE_SIZE_TO_ACTIVATE_STREAMING}" "${OTB_STREAM_MAX_SIZE_BUFFER_FOR_STREAMING}"
ARGS "${otbconfigfile_DEFAULT}" "${OTB_STREAM_IMAGE_SIZE_TO_ACTIVATE_STREAMING}" "${OTB_STREAM_MAX_SIZE_BUFFER_FOR_STREAMING}"
COMMENT "Generating ${otbconfigfile_DEFAULT}" )
......@@ -34,7 +34,10 @@ int otbConfigurationTest(int argc, char * argv[])
std::cout << conf << std::endl;
if (lang != "fr_FR.UTF-8")
return EXIT_FAILURE;
{
std::cout << "Locale language " << lang << std::endl;
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment