mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
COMP: access transformedElements by reference, not copy
- better code style and seems to avoid triggering a gcc warning about possibly uninitialized values COMP: JSONformatter writeEntry missing a return value STYLE: accept 'json' for checkMesh write format - consistent with caseInfo functionObject
This commit is contained in:
@ -130,7 +130,7 @@ Foam::Ostream& Foam::JSONformatter::writeDict(const dictionary& dict)
|
||||
const word& keyword = e.keyword();
|
||||
|
||||
os_ << indent;
|
||||
writeKeyword(keyword) << " : ";
|
||||
os_.writeQuoted(keyword) << " : ";
|
||||
|
||||
if (e.isDict())
|
||||
{
|
||||
|
||||
@ -82,7 +82,7 @@ public:
|
||||
virtual Ostream& write(const bool val);
|
||||
virtual Ostream& write(const int32_t val);
|
||||
virtual Ostream& write(const int64_t val);
|
||||
virtual Ostream& write(const float val );
|
||||
virtual Ostream& write(const float val);
|
||||
virtual Ostream& write(const double val);
|
||||
virtual Ostream& write(const word& str);
|
||||
virtual Ostream& write(const std::string& str);
|
||||
@ -94,11 +94,13 @@ public:
|
||||
//- Write OpenFOAM dictionary to JSON dictionary
|
||||
virtual Ostream& writeDict(const dictionary& dict);
|
||||
|
||||
//- Write JSON keyword-value pair
|
||||
//- Write JSON keyword-value pair (for primitive types)
|
||||
template<class Type>
|
||||
Ostream& writeEntry(const word& keyword, Type val)
|
||||
Ostream& writeEntry(const word& keyword, const Type& val)
|
||||
{
|
||||
writeKeyword(keyword) << " : " << write(val);
|
||||
os_.writeQuoted(keyword) << " : ";
|
||||
write(val);
|
||||
return os_;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user