Go to the documentation of this file.
34 static 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));
58 inline unsigned char Foam::base64Layer::encode0()
const
61 return base64Chars[((group_[0] & 0xFC) >> 2)];
64 inline unsigned char Foam::base64Layer::encode1()
const
67 return base64Chars[((group_[0] & 0x03) << 4) | ((group_[1] & 0xF0) >> 4)];
70 inline unsigned char Foam::base64Layer::encode2()
const
73 return base64Chars[((group_[1] & 0x0F) << 2) | ((group_[2] & 0xC0) >> 6)];
76 inline unsigned char Foam::base64Layer::encode3()
const
79 return base64Chars[(group_[2] & 0x3F)];
85 group_[groupLen_++] =
static_cast<unsigned char>(
c);
94 os_.write(
reinterpret_cast<char*
>(out), 4);
105 Foam::base64Layer::base64Layer(std::ostream&
os)
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);
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))
~base64Layer()
Destructor. Performs close()
bool close()
End the encoding sequence, padding the final characters with '='.
void write(const char *s, std::streamsize n)
Encode the character sequence, writing when possible.
void reset()
Restart a new encoding sequence.
void add(FieldField< Field1, typename typeOfSum< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
OBJstream os(runTime.globalPath()/outputName)
void add(char c)
Add a character to the group, outputting when the group is full.
const dimensionedScalar c
Speed of light in a vacuum.
static std::size_t encodedLength(std::size_t n)
The encoded length has 4 bytes out for every 3 bytes in.