vector RegistryQuery::ExtractMultiStringValue()

in library/src/RegistryQuery.cpp [54:72]


vector<wstring> RegistryQuery::ExtractMultiStringValue(const wchar_t* data, size_t numBytes)
{
	vector<wstring> strings;
	
	size_t offset = 0;
	size_t upperBound = numBytes / sizeof(wchar_t);
	while (offset < upperBound)
	{
		// Extract the next string and check that it's not empty
		wstring nextString(data + offset);
		if (nextString.size() == 0) { break; }
		
		// Add the string to our list and proceed to the next one
		strings.push_back(nextString);
		offset += strings.back().size() + 1;
	}
	
	return strings;
}