Example #1
0
    static void encode(Encoder& e, resetT v) {
		if (v < reset || v > reset)
		{
			std::ostringstream error;
			error << "enum value " << v << " is out of bound for resetT and cannot be encoded";
			throw avro::Exception(error.str());
		}
        e.encodeEnum(v);
    }
Example #2
0
    static void encode(Encoder& e, strategyT v) {
		if (v < DEFAULT || v > CONCRETE2)
		{
			std::ostringstream error;
			error << "enum value " << v << " is out of bound for strategyT and cannot be encoded";
			throw avro::Exception(error.str());
		}
        e.encodeEnum(v);
    }
Example #3
0
    static void encode(Encoder& e, userRoleT v) {
		if (v < ADMIN || v > GUEST)
		{
			std::ostringstream error;
			error << "enum value " << v << " is out of bound for userRoleT and cannot be encoded";
			throw avro::Exception(error.str());
		}
        e.encodeEnum(v);
    }
Example #4
0
    static void encode(Encoder& e, unchangedT v) {
		if (v < unchanged || v > unchanged)
		{
			std::ostringstream error;
			error << "enum value " << v << " is out of bound for unchangedT and cannot be encoded";
			throw avro::Exception(error.str());
		}
        e.encodeEnum(v);
    }
void Coder<WebCore::CertificateInfo>::encode(Encoder& encoder, const WebCore::CertificateInfo& certificateInfo)
{
    encoder.encodeEnum(certificateInfo.type());

    switch (certificateInfo.type()) {
#if HAVE(SEC_TRUST_SERIALIZATION)
    case WebCore::CertificateInfo::Type::Trust:
        encodeSecTrustRef(encoder, certificateInfo.trust());
        break;
#endif
    case WebCore::CertificateInfo::Type::CertificateChain: {
        encodeCertificateChain(encoder, certificateInfo.certificateChain());
        break;
    }
    case WebCore::CertificateInfo::Type::None:
        // Do nothing.
        break;
    }
}