35#ifndef Foam_OSHA1stream_H
36#define Foam_OSHA1stream_H
53 virtual public std::ios,
57 class sha1buf :
public std::streambuf
65 virtual int overflow(int_type c = traits_type::eof())
67 if (c != traits_type::eof()) sha1_.
append(c);
72 virtual std::streamsize xsputn(
const char*
s, std::streamsize
n)
84 SHA1&
sha1()
noexcept {
return sha1_; }
104 sha1buf*
rdbuf() {
return &buf_; }
107 SHA1&
sha1()
noexcept {
return buf_.sha1(); }
183 #ifdef Foam_IOstream_extras
A wrapper to hold a std::stream type for OpenFOAM wrapped streams. This is necessary since the OpenFO...
Foam::osha1stream stream_
A simple container for options an IOstream can normally have.
versionNumber version() const noexcept
Get the stream version.
constexpr IOstreamOption(streamFormat fmt=streamFormat::ASCII, compressionType comp=compressionType::UNCOMPRESSED) noexcept
Default construct (ASCII, UNCOMPRESSED, currentVersion) or construct with format, compression.
streamFormat format() const noexcept
Get the current stream format.
streamFormat
Data format (ascii | binary | coherent).
The output stream for calculating SHA1 digests.
OSHA1stream(const OSHA1stream &)=delete
No copy construct.
virtual Ostream & write(const std::string &s) override
Add (unquoted) string contents.
SHA1Digest digest()
Return SHA1::Digest for the data processed until now.
OSHA1stream(IOstreamOption streamOpt=IOstreamOption())
Construct with an empty digest.
void rewind()
Deprecated(2017-07) clear the SHA1 calculation.
void reset()
Clear the SHA1 calculation.
SHA1 & sha1() noexcept
Full access to the sha1.
void operator=(const OSHA1stream &)=delete
No copy assignment.
Generic output stream using a standard (STL) stream.
OSstream(const OSstream &)=default
Copy construct.
virtual Ostream & writeQuoted(const char *str, std::streamsize len, const bool quoted=true) override
Write character/string content, with/without surrounding quotes.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Functions to compute SHA1 message digest according to the NIST specification FIPS-180-1.
void clear() noexcept
Reset the hashed data before appending more.
void append(char c)
Append single character.
SHA1Digest digest()
Return SHA1::Digest for the data processed until now.
osha1stream()
Default construct.
sha1buf * rdbuf()
This hides both signatures of std::basic_ios::rdbuf().
void reset()
Clear the SHA1 calculation.
SHA1 & sha1() noexcept
Full access to the sha1.
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))