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)
104 sha1buf*
rdbuf() {
return &buf_; }
113 void reset() { buf_.sha1().clear(); }
125 class OSHA1streamAllocator
211 #ifdef Foam_IOstream_extras OSHA1streamAllocator()=default
Default construct.
Generic output stream using a standard (STL) stream.
SHA1 & sha1() noexcept
Full access to the sha1.
void clear() noexcept
Reset the hashed data before appending more.
void reset()
Clear the SHA1 calculation.
virtual Ostream & writeQuoted(const char *str, std::streamsize len, const bool quoted=true) override
Write character/string content, with/without surrounding quotes.
A basic output stream for calculating SHA1 digests.
A simple container for options an IOstream can normally have.
The output stream for calculating SHA1 digests.
SHA1Digest digest()
Return SHA1::Digest for the data processed until now.
void rewind()
Deprecated(2017-07) clear the SHA1 calculation.
constexpr IOstreamOption(streamFormat fmt=streamFormat::ASCII, compressionType comp=compressionType::UNCOMPRESSED) noexcept
Default construct (ASCII, UNCOMPRESSED, currentVersion) or construct with format, compression...
void operator=(const OSHA1stream &)=delete
No copy assignment.
SHA1 & sha1() noexcept
Full access to the sha1.
OSHA1stream(const OSHA1stream &)=delete
No copy construct.
An allocator for holding Foam::osha1stream.
virtual Ostream & write(const std::string &str) override
Add (unquoted) string contents.
Foam::osha1stream stream_
The output stream.
const dimensionedScalar c
Speed of light in a vacuum.
void append(char c)
Append single character.
versionNumber version() const noexcept
Get the stream version.
SHA1Digest digest()
Return SHA1::Digest for the data processed until now.
streamFormat
Data format (ascii | binary)
Functions to compute SHA1 message digest according to the NIST specification FIPS-180-1.
void reset()
Clear the SHA1 calculation.
osha1stream()
Default construct.
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))
Ostream(const Ostream &)=default
Copy construct.
streamFormat format() const noexcept
Get the current stream format.
sha1buf * rdbuf()
This hides both signatures of std::basic_ios::rdbuf()