mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
consistency update - writeCompression in system/controlDict
allow switch/bool values for writeCompression in system/controlDict
- eg,
writeCompression false; or writeCompression uncompressed;
writeCompression true; or writeCompression compressed;
improves consistency with other controlDict parameters
This commit is contained in:
@ -26,6 +26,7 @@ License
|
|||||||
|
|
||||||
#include "IOstream.H"
|
#include "IOstream.H"
|
||||||
#include "error.H"
|
#include "error.H"
|
||||||
|
#include "Switch.H"
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
@ -60,7 +61,14 @@ Foam::IOstream::formatEnum(const word& format)
|
|||||||
Foam::IOstream::compressionType
|
Foam::IOstream::compressionType
|
||||||
Foam::IOstream::compressionEnum(const word& compression)
|
Foam::IOstream::compressionEnum(const word& compression)
|
||||||
{
|
{
|
||||||
if (compression == "uncompressed")
|
// get Switch (bool) value, but allow it to fail
|
||||||
|
Switch::switchType sw = Switch::asEnum(compression, true);
|
||||||
|
|
||||||
|
if (sw != Switch::INVALID)
|
||||||
|
{
|
||||||
|
return sw ? IOstream::COMPRESSED : IOstream::UNCOMPRESSED;
|
||||||
|
}
|
||||||
|
else if (compression == "uncompressed")
|
||||||
{
|
{
|
||||||
return IOstream::UNCOMPRESSED;
|
return IOstream::UNCOMPRESSED;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user