Interpretation help please

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.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
			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?

The code is from https://open-ms.svn.sourceforge.net/svnroot/open-ms/OpenMS/source/FORMAT/Base64.C also described here http://ftp.mi.fu-berlin.de/OpenMS/doc-1.9-official/html/classOpenMS_1_1Base64.html Thanks in advance.
Topic archived. No new replies allowed.