mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-12-28 03:37:59 +00:00
STYLE: fix worst spacing violations for 'os <<' constructions
- accept some violations of the coding guidelines though - perhaps adding a style exception would be simpler.
This commit is contained in:
@ -50,7 +50,7 @@ Istream& operator>>
|
||||
alphaContactAngleFvPatchScalarField::interfaceThetaProps& tp
|
||||
)
|
||||
{
|
||||
is >> tp.theta0_ >> tp.uTheta_ >> tp.thetaA_ >> tp.thetaR_;
|
||||
is >> tp.theta0_ >> tp.uTheta_ >> tp.thetaA_ >> tp.thetaR_;
|
||||
return is;
|
||||
}
|
||||
|
||||
|
||||
@ -59,7 +59,7 @@ public:
|
||||
|
||||
friend Ostream& operator<<(Ostream& os, const ent& e)
|
||||
{
|
||||
os << e.keyword_ << ' ' << e.i_ << endl;
|
||||
os << e.keyword_ << ' ' << e.i_ << endl;
|
||||
return os;
|
||||
}
|
||||
};
|
||||
@ -88,7 +88,7 @@ public:
|
||||
|
||||
friend Ostream& operator<<(Ostream& os, const Scalar& val)
|
||||
{
|
||||
os << val.data_;
|
||||
os << val.data_;
|
||||
return os;
|
||||
}
|
||||
};
|
||||
|
||||
@ -38,7 +38,7 @@ public:
|
||||
|
||||
friend std::ostream& operator<<(std::ostream& os, const Vector<C>& v)
|
||||
{
|
||||
os << v.X << '\t' << v.Y << '\n';
|
||||
os << v.X << '\t' << v.Y << '\n';
|
||||
return os;
|
||||
}
|
||||
};
|
||||
|
||||
@ -89,7 +89,7 @@ int main()
|
||||
|
||||
{
|
||||
OStringStream os;
|
||||
os << table1;
|
||||
os << table1;
|
||||
HASHTABLE_CLASS<double> readTable(IStringStream(os.str())(), 100);
|
||||
|
||||
Info<< "Istream constructor:" << readTable << endl;
|
||||
|
||||
@ -54,7 +54,7 @@ public:
|
||||
|
||||
friend Ostream& operator<<(Ostream& os, const Scalar& s)
|
||||
{
|
||||
os << s.data_;
|
||||
os << s.data_;
|
||||
return os;
|
||||
}
|
||||
|
||||
|
||||
@ -60,7 +60,7 @@ public:
|
||||
|
||||
friend Ostream& operator<<(Ostream& os, const Scalar& val)
|
||||
{
|
||||
os << val.data_;
|
||||
os << val.data_;
|
||||
return os;
|
||||
}
|
||||
};
|
||||
|
||||
@ -83,7 +83,7 @@ int main()
|
||||
|
||||
{
|
||||
OStringStream os;
|
||||
os << table1;
|
||||
os << table1;
|
||||
HASHTABLE_CLASS<double> readTable(IStringStream(os.str())(), 100);
|
||||
|
||||
Info<< "Istream constructor:" << readTable << endl;
|
||||
|
||||
@ -56,7 +56,7 @@ public:
|
||||
|
||||
friend Ostream& operator<<(Ostream& os, const ent& e)
|
||||
{
|
||||
os << e.keyword_ << ' ' << e.i_ << endl;
|
||||
os << e.keyword_ << ' ' << e.i_ << endl;
|
||||
return os;
|
||||
}
|
||||
};
|
||||
|
||||
@ -47,8 +47,7 @@ void writeObj(Ostream& os,const pointField& points)
|
||||
{
|
||||
const point& pt = points[pointI];
|
||||
|
||||
os << "v " << pt.x() << ' ' << pt.y()
|
||||
<< ' ' << pt.z() << endl;
|
||||
os << "v " << pt.x() << ' ' << pt.y() << ' ' << pt.z() << endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -92,14 +92,14 @@ int main(int argc, char * argv[])
|
||||
{
|
||||
OSHA1stream os;
|
||||
|
||||
os << str;
|
||||
os << str;
|
||||
Info<< os.digest() << endl;
|
||||
|
||||
os << str;
|
||||
os << str;
|
||||
Info<< os.digest() << endl;
|
||||
|
||||
os.rewind();
|
||||
os << "The quick brown fox jumps over the lazy dog";
|
||||
os << "The quick brown fox jumps over the lazy dog";
|
||||
Info<< os.digest() << endl;
|
||||
|
||||
}
|
||||
|
||||
@ -110,9 +110,9 @@ const labelListListList& block::boundaryPatches() const
|
||||
|
||||
Ostream& operator<<(Ostream& os, const block& b)
|
||||
{
|
||||
os << b.Vertices << nl
|
||||
<< b.Cells << nl
|
||||
<< b.BoundaryPatches << endl;
|
||||
os << b.Vertices << nl
|
||||
<< b.Cells << nl
|
||||
<< b.BoundaryPatches << endl;
|
||||
|
||||
return os;
|
||||
}
|
||||
|
||||
@ -57,7 +57,7 @@ void hexBlock::readPoints(Istream& is)
|
||||
{
|
||||
forAll(points_, i)
|
||||
{
|
||||
is >> points_[i].x() >> points_[i].y() >> points_[i].z();
|
||||
is >> points_[i].x() >> points_[i].y() >> points_[i].z();
|
||||
}
|
||||
|
||||
// Calculate the handedness of the block
|
||||
|
||||
@ -128,13 +128,13 @@ void hexBlock::readPoints
|
||||
Info<< "Reading " << nPoints << " x coordinates..." << endl;
|
||||
for (label i=0; i < nPoints; i++)
|
||||
{
|
||||
is >> points_[i].x();
|
||||
is >> points_[i].x();
|
||||
}
|
||||
|
||||
Info<< "Reading " << nPoints << " y coordinates..." << endl;
|
||||
for (label i=0; i < nPoints; i++)
|
||||
{
|
||||
is >> points_[i].y();
|
||||
is >> points_[i].y();
|
||||
}
|
||||
|
||||
if (twoDThicknes > 0)
|
||||
@ -156,7 +156,7 @@ void hexBlock::readPoints
|
||||
Info<< "Reading " << nPoints << " z coordinates..." << endl;
|
||||
for (label i=0; i < nPoints; i++)
|
||||
{
|
||||
is >> points_[i].z();
|
||||
is >> points_[i].z();
|
||||
}
|
||||
}
|
||||
|
||||
@ -166,7 +166,7 @@ void hexBlock::readPoints
|
||||
Info<< "Reading " << nPoints << " blanks..." << endl;
|
||||
for (label i=0; i < nPoints; i++)
|
||||
{
|
||||
is >> iBlank;
|
||||
is >> iBlank;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -51,7 +51,7 @@ using namespace Foam;
|
||||
|
||||
void writeOBJ(const point& pt, Ostream& os)
|
||||
{
|
||||
os << "v " << pt.x() << ' ' << pt.y() << ' ' << pt.z() << nl;
|
||||
os << "v " << pt.x() << ' ' << pt.y() << ' ' << pt.z() << nl;
|
||||
}
|
||||
|
||||
// All edges of mesh
|
||||
|
||||
@ -58,7 +58,7 @@ Foam::Ostream& Foam::operator<<
|
||||
|
||||
if (faceI != -1)
|
||||
{
|
||||
os<< " fc:" << c.patch_.localFaces()[faceI].centre(pts);
|
||||
os << " fc:" << c.patch_.localFaces()[faceI].centre(pts);
|
||||
}
|
||||
return os;
|
||||
}
|
||||
|
||||
@ -974,7 +974,7 @@ int main(int argc, char *argv[])
|
||||
IStringStream is(rawLine + ' ');
|
||||
|
||||
// Type: cellSet, faceSet, pointSet, faceZoneSet
|
||||
is >> setType;
|
||||
is >> setType;
|
||||
|
||||
stat = parseType(runTime, mesh, setType, is);
|
||||
|
||||
|
||||
@ -85,20 +85,20 @@ void Foam::writeFuns::write
|
||||
fField.size()*sizeof(float)
|
||||
);
|
||||
|
||||
os << std::endl;
|
||||
os << std::endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
forAll(fField, i)
|
||||
{
|
||||
os << fField[i] << ' ';
|
||||
os << fField[i] << ' ';
|
||||
|
||||
if (i > 0 && (i % 10) == 0)
|
||||
{
|
||||
os << std::endl;
|
||||
os << std::endl;
|
||||
}
|
||||
}
|
||||
os << std::endl;
|
||||
os << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
@ -134,20 +134,20 @@ void Foam::writeFuns::write
|
||||
elems.size()*sizeof(label)
|
||||
);
|
||||
|
||||
os << std::endl;
|
||||
os << std::endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
forAll(elems, i)
|
||||
{
|
||||
os << elems[i] << ' ';
|
||||
os << elems[i] << ' ';
|
||||
|
||||
if (i > 0 && (i % 10) == 0)
|
||||
{
|
||||
os << std::endl;
|
||||
os << std::endl;
|
||||
}
|
||||
}
|
||||
os << std::endl;
|
||||
os << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -85,12 +85,12 @@ void writeBytes(char* start, int nBytes)
|
||||
// Debug: write wall flags data
|
||||
void writeWallFlags(Ostream& os, label cellI, const labelList& wallFlags)
|
||||
{
|
||||
os << "cell " << cellI << " wallsFlags:";
|
||||
os << "cell " << cellI << " wallsFlags:";
|
||||
forAll(wallFlags, wallFaceI)
|
||||
{
|
||||
os << wallFlags[wallFaceI] << " ";
|
||||
os << wallFlags[wallFaceI] << ' ';
|
||||
}
|
||||
os << endl;
|
||||
os << endl;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -99,12 +99,12 @@ void print(const char* msg, Ostream& os, const PtrList<GeoField>& flds)
|
||||
{
|
||||
if (flds.size())
|
||||
{
|
||||
os << msg;
|
||||
os << msg;
|
||||
forAll(flds, i)
|
||||
{
|
||||
os<< ' ' << flds[i].name();
|
||||
os << ' ' << flds[i].name();
|
||||
}
|
||||
os << endl;
|
||||
os << endl;
|
||||
}
|
||||
}
|
||||
|
||||
@ -113,9 +113,9 @@ void print(Ostream& os, const wordList& flds)
|
||||
{
|
||||
forAll(flds, i)
|
||||
{
|
||||
os<< ' ' << flds[i];
|
||||
os << ' ' << flds[i];
|
||||
}
|
||||
os << endl;
|
||||
os << endl;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -163,12 +163,12 @@ void print(const char* msg, Ostream& os, const PtrList<GeoField>& flds)
|
||||
{
|
||||
if (flds.size())
|
||||
{
|
||||
os << msg;
|
||||
os << msg;
|
||||
forAll(flds, i)
|
||||
{
|
||||
os<< ' ' << flds[i].name();
|
||||
os << ' ' << flds[i].name();
|
||||
}
|
||||
os << endl;
|
||||
os << endl;
|
||||
}
|
||||
}
|
||||
|
||||
@ -177,9 +177,9 @@ void print(Ostream& os, const wordList& flds)
|
||||
{
|
||||
forAll(flds, i)
|
||||
{
|
||||
os<< ' ' << flds[i];
|
||||
os << ' ' << flds[i];
|
||||
}
|
||||
os << endl;
|
||||
os << endl;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -94,20 +94,20 @@ void Foam::writeFuns::write
|
||||
fField.size()*sizeof(float)
|
||||
);
|
||||
|
||||
os << std::endl;
|
||||
os << std::endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
forAll(fField, i)
|
||||
{
|
||||
os << fField[i] << ' ';
|
||||
os << fField[i] << ' ';
|
||||
|
||||
if (i > 0 && (i % 10) == 0)
|
||||
{
|
||||
os << std::endl;
|
||||
os << std::endl;
|
||||
}
|
||||
}
|
||||
os << std::endl;
|
||||
os << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
@ -143,20 +143,20 @@ void Foam::writeFuns::write
|
||||
elems.size()*sizeof(label)
|
||||
);
|
||||
|
||||
os << std::endl;
|
||||
os << std::endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
forAll(elems, i)
|
||||
{
|
||||
os << elems[i] << ' ';
|
||||
os << elems[i] << ' ';
|
||||
|
||||
if (i > 0 && (i % 10) == 0)
|
||||
{
|
||||
os << std::endl;
|
||||
os << std::endl;
|
||||
}
|
||||
}
|
||||
os << std::endl;
|
||||
os << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
@ -186,11 +186,11 @@ void Foam::writeFuns::writeHeader
|
||||
|
||||
if (binary)
|
||||
{
|
||||
os << "BINARY" << std::endl;
|
||||
os << "BINARY" << std::endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
os << "ASCII" << std::endl;
|
||||
os << "ASCII" << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -502,15 +502,14 @@ void vtkPV3FoamReader::PrintSelf(ostream& os, vtkIndent indent)
|
||||
vtkDebugMacro(<<"PrintSelf");
|
||||
|
||||
this->Superclass::PrintSelf(os,indent);
|
||||
os<< indent << "File name: "
|
||||
<< (this->FileName ? this->FileName : "(none)") << "\n";
|
||||
os << indent << "File name: "
|
||||
<< (this->FileName ? this->FileName : "(none)") << "\n";
|
||||
|
||||
foamData_->PrintSelf(os, indent);
|
||||
|
||||
os<< indent << "Time step range: "
|
||||
<< this->TimeStepRange[0] << " - " << this->TimeStepRange[1]
|
||||
<< "\n";
|
||||
os<< indent << "Time step: " << this->GetTimeStep() << endl;
|
||||
os << indent << "Time step range: "
|
||||
<< this->TimeStepRange[0] << " - " << this->TimeStepRange[1] << "\n"
|
||||
<< indent << "Time step: " << this->GetTimeStep() << endl;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -283,8 +283,8 @@ void vtkPV3blockMeshReader::PrintSelf(ostream& os, vtkIndent indent)
|
||||
vtkDebugMacro(<<"PrintSelf");
|
||||
|
||||
this->Superclass::PrintSelf(os,indent);
|
||||
os<< indent << "File name: "
|
||||
<< (this->FileName ? this->FileName : "(none)") << "\n";
|
||||
os << indent << "File name: "
|
||||
<< (this->FileName ? this->FileName : "(none)") << "\n";
|
||||
|
||||
foamData_->PrintSelf(os, indent);
|
||||
}
|
||||
|
||||
@ -41,7 +41,7 @@ Foam::Ostream& Foam::operator<<
|
||||
|
||||
Foam::Istream& Foam::operator>>(Foam::Istream& is, Foam::sumData& wDist)
|
||||
{
|
||||
return is >> wDist.oldFace_ >> wDist.sum_ >> wDist.count_;
|
||||
return is >> wDist.oldFace_ >> wDist.sum_ >> wDist.count_;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -65,7 +65,7 @@ void writeOBJ(Ostream& os, const pointField& pts)
|
||||
{
|
||||
const point& pt = pts[i];
|
||||
|
||||
os << "v " << pt.x() << ' ' << pt.y() << ' ' << pt.z() << endl;
|
||||
os << "v " << pt.x() << ' ' << pt.y() << ' ' << pt.z() << endl;
|
||||
}
|
||||
}
|
||||
|
||||
@ -85,7 +85,7 @@ void dumpPoints(const triSurface& surf, const labelList& borderPoint)
|
||||
{
|
||||
const point& pt = surf.localPoints()[pointI];
|
||||
|
||||
os << "v " << pt.x() << ' ' << pt.y() << ' ' << pt.z() << endl;
|
||||
os << "v " << pt.x() << ' ' << pt.y() << ' ' << pt.z() << endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -108,7 +108,7 @@ void dumpEdges(const triSurface& surf, const boolList& borderEdge)
|
||||
{
|
||||
const edge& e = surf.edges()[edgeI];
|
||||
|
||||
os << "l " << e.start()+1 << ' ' << e.end()+1 << endl;
|
||||
os << "l " << e.start()+1 << ' ' << e.end()+1 << endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -95,13 +95,13 @@ public:
|
||||
|
||||
friend Istream& operator>>(Istream& is, substance& s)
|
||||
{
|
||||
is >> s.name_ >> s.volFrac_;
|
||||
is >> s.name_ >> s.volFrac_;
|
||||
return is;
|
||||
}
|
||||
|
||||
friend Ostream& operator<<(Ostream& os, const substance& s)
|
||||
{
|
||||
os << s.name_ << token::SPACE << s.volFrac_;
|
||||
os << s.name_ << token::SPACE << s.volFrac_;
|
||||
return os;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user