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',
'+',
'/'
50inline unsigned char Foam::base64Layer::encode0() const noexcept
53 return base64Chars[((group_[0] & 0xFC) >> 2)];
56inline unsigned char Foam::base64Layer::encode1() const
noexcept
59 return base64Chars[((group_[0] & 0x03) << 4) | ((group_[1] & 0xF0) >> 4)];
62inline unsigned char Foam::base64Layer::encode2() const
noexcept
65 return base64Chars[((group_[1] & 0x0F) << 2) | ((group_[2] & 0xC0) >> 6)];
68inline unsigned char Foam::base64Layer::encode3() const
noexcept
71 return base64Chars[(group_[2] & 0x3F)];
75inline void Foam::base64Layer::add_char(
char c)
77 group_[groupLen_++] =
static_cast<unsigned char>(
c);
87 os_.write(
reinterpret_cast<char*
>(out), 4);
123 for (std::streamsize i=0; i <
n; ++i)
138 bool had_pending =
false;
140 unsigned char out[4];
151 else if (groupLen_ == 2)
168 os_.write(
reinterpret_cast<char*
>(out), 4);
void reset() noexcept
Restart a new encoding sequence.
void add(char c)
Add a character to the group, outputting when the group is full.
bool close()
End the encoding sequence, padding the final characters with '='.
base64Layer(std::ostream &os) noexcept
Attach to an output stream.
~base64Layer()
Destructor. Performs close().
void write(const char *s, std::streamsize n)
Encode the character sequence, writing when possible.
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))
const dimensionedScalar c
Speed of light in a vacuum.