34static const unsigned char base64Chars[64] =
36 'A',
'B',
'C',
'D',
'E',
'F',
'G',
'H',
37 'I',
'J',
'K',
'L',
'M',
'N',
'O',
'P',
38 'Q',
'R',
'S',
'T',
'U',
'V',
'W',
'X',
39 'Y',
'Z',
'a',
'b',
'c',
'd',
'e',
'f',
40 'g',
'h',
'i',
'j',
'k',
'l',
'm',
'n',
41 'o',
'p',
'q',
'r',
's',
't',
'u',
'v',
42 'w',
'x',
'y',
'z',
'0',
'1',
'2',
'3',
43 '4',
'5',
'6',
'7',
'8',
'9',
'+',
'/'
52 return 4 * ((
n / 3) + (
n % 3 ? 1 : 0));
58inline unsigned char Foam::base64Layer::encode0() const
noexcept
61 return base64Chars[((group_[0] & 0xFC) >> 2)];
64inline unsigned char Foam::base64Layer::encode1() const
noexcept
67 return base64Chars[((group_[0] & 0x03) << 4) | ((group_[1] & 0xF0) >> 4)];
70inline unsigned char Foam::base64Layer::encode2() const
noexcept
73 return base64Chars[((group_[1] & 0x0F) << 2) | ((group_[2] & 0xC0) >> 6)];
76inline unsigned char Foam::base64Layer::encode3() const
noexcept
79 return base64Chars[(group_[2] & 0x3F)];
85 group_[groupLen_++] =
static_cast<unsigned char>(c);
94 os_.write(
reinterpret_cast<char*
>(out), 4);
126 for (std::streamsize i=0; i <
n; ++i)
147 unsigned char out[4];
156 os_.write(
reinterpret_cast<char*
>(out), 4);
158 else if (groupLen_ == 2)
166 os_.write(
reinterpret_cast<char*
>(out), 4);
An output filter layer to write base-64 encoded content.
bool close()
End the encoding sequence, padding the final characters with '='.
~base64Layer()
Destructor. Performs close()
static std::size_t encodedLength(std::size_t n)
The encoded length has 4 bytes out for every 3 bytes in.
void reset()
Restart a new encoding sequence.
virtual bool write()
Write the output fields.
Sums a given list of (at least two or more) fields and outputs the result into a new field,...
OBJstream os(runTime.globalPath()/outputName)
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))
void add(FieldField< Field1, typename typeOfSum< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)