I need to write a program in labview that will read data from .mzml files. Here is the code snippet that writes the files, converting an array of numbers into a text string.
out.resize((Size)ceil(str.size()/3.) * 4); //resize output array in order to have enough space for all characters
it = reinterpret_cast<Byte*>(&str[0]);
end = it + str.size();
}
Byte* to = reinterpret_cast<Byte*>(&out[0]);
Size written = 0;
while (it!=end)
{
Int int_24bit = 0;
Int padding_count = 0;
// construct 24-bit integer from 3 bytes
for (Size i=0; i<3; i++)
{
if (it!=end)
{
int_24bit |= *it++<<((2-i)*8);
}
else
{
padding_count++;
}
}
// write out 4 characters
for (Int i=3; i>=0; i--)
{
to[i] = encoder_[int_24bit & 0x3F];
int_24bit >>= 6;
}
// fixup for padding
if (padding_count > 0) to[3] = '=';
if (padding_count > 1) to[2] = '=';
to += 4;
written += 4;
}
out.resize(written); //no more space is needed
Can anyone help me interpret that and tell me what to do to turn the text back into an array of numbers? I think I get that 4 text characters equals one number... then what?