void DemoJuceFilter::setStateInformation (const void* data, int sizeInBytes)
{
    XmlElement* const xmlState = getXmlFromBinary (data, sizeInBytes);
    if (xmlState != 0)
    {
        if (xmlState->hasTagName (T("BITMUNGLER")))
        {
			Logger::writeToLog (xmlState->createDocument (String::empty));

			xorProcessing = xmlState->getBoolAttribute (T("xorProcessing"));
			andProcessing = xmlState->getBoolAttribute (T("andProcessing"));
			clearProcessing = xmlState->getBoolAttribute (T("clearProcessing"));
			setProcessing = xmlState->getBoolAttribute (T("setProcessing"));

			unserializeArray (xmlState->getStringAttribute (T("xorBits")), xorBits);
			xorWith = xmlState->getBoolAttribute (T("xorWith"));

			unserializeArray (xmlState->getStringAttribute (T("andBits")), andBits);
			andWith = xmlState->getBoolAttribute (T("andWith"));

			unserializeArray (xmlState->getStringAttribute (T("setBits")), setBits);
			unserializeArray (xmlState->getStringAttribute (T("clearBits")), clearBits);
        }
        delete xmlState;
    }

	sendChangeMessage (this);
}
Beispiel #2
0
KviKvsVariant * KviKvsVariant::unserialize(const QChar ** ppAux)
{
	KviKvsVariant * pResult = NULL;

	while((*ppAux)->isSpace())
		(*ppAux)++;

	switch((*ppAux)->unicode())
	{
		case 't':
			//true
			pResult = unserializeBool(ppAux,true);
		break;
		case 'f':
			//false
			pResult = unserializeBool(ppAux,false);
		break;
		case 'n':
			//null
			pResult = unserializeNull(ppAux);
		break;
		case '[':
			//array
			pResult = unserializeArray(ppAux);
		break;
		case '{':
			//hash
			pResult = unserializeHash(ppAux);
		break;
		case '"':
			//string
			pResult = unserializeString(ppAux);
		break;
		case '0':
		case '1':
		case '2':
		case '3':
		case '4':
		case '5':
		case '6':
		case '7':
		case '8':
		case '9':
		case '-':
			//real or integer
			pResult = unserializeNumber(ppAux);
		break;
		default:
			//incorrect value
			return NULL;
	}

	while((*ppAux)->isSpace())
		(*ppAux)++;

	return pResult;
}