CSerializerInterface* CSerializerFactory::CreateInterface( QAction *action ) { Interfaces = new CSaveBinary; QObject::connect( action, SIGNAL(triggered()), Interfaces, SLOT(SerializeMap()) ); return Interfaces; }
template <> mongo::BSONObj Serialize<acl::UserData>(const acl::UserData& user) { mongo::BSONObjBuilder bob; bob.append("uid", user.id); bob.append("name", user.name); bob.append("ip masks", SerializeContainer(user.ipMasks)); bob.append("password", user.password); bob.append("salt", user.salt); bob.append("flags", user.flags); bob.append("primary gid", user.primaryGid); bob.append("secondary gids", SerializeContainer(user.secondaryGids)); bob.append("gadmin gids", SerializeContainer(user.gadminGids)); bob.append("creator", user.creator); bob.append("created", ToDateT(user.created)); bob.append("home dir", user.homeDir); bob.append("startup dir", user.startUpDir); bob.append("idle time", user.idleTime); if (user.expires) bob.append("expires", ToDateT(*user.expires)); else bob.appendNull("expires"); bob.append("num logins", user.numLogins); bob.append("comment", user.comment); bob.append("tagline", user.tagline); bob.append("max down speed", user.maxDownSpeed); bob.append("max up speed", user.maxUpSpeed); bob.append("max sim down", user.maxSimDown); bob.append("max sim up", user.maxSimUp); bob.append("logged in", user.loggedIn); if (user.lastLogin) bob.append("last login", ToDateT(*user.lastLogin)); else bob.appendNull("last login"); bob.append("ratio", SerializeMap(user.ratio, "section", "value")); bob.append("credits", SerializeMap(user.credits, "section", "value")); bob.append("weekly allotment", SerializeMap(user.weeklyAllotment, "section", "value")); return bob.obj(); }
void MetadataHandler::PopulateRequest(Aws::S3::Model::PutObjectRequest& request, const ContentCryptoMaterial& contentCryptoMaterial) { Aws::String encodedCEK = HashingUtils::Base64Encode(contentCryptoMaterial.GetEncryptedContentEncryptionKey()); request.AddMetadata(CONTENT_KEY_HEADER, encodedCEK); Aws::String encodedIV = HashingUtils::Base64Encode(contentCryptoMaterial.GetIV()); request.AddMetadata(IV_HEADER, encodedIV); Aws::Map<Aws::String, Aws::String> materialsDescriptionMap = contentCryptoMaterial.GetMaterialsDescription(); request.AddMetadata(MATERIALS_DESCRIPTION_HEADER, SerializeMap(materialsDescriptionMap)); ContentCryptoScheme scheme = contentCryptoMaterial.GetContentCryptoScheme(); request.AddMetadata(CONTENT_CRYPTO_SCHEME_HEADER, GetNameForContentCryptoScheme(scheme)); request.AddMetadata(CRYPTO_TAG_LENGTH_HEADER, StringUtils::to_string(contentCryptoMaterial.GetCryptoTagLength())); KeyWrapAlgorithm keyWrapAlgorithm = contentCryptoMaterial.GetKeyWrapAlgorithm(); request.AddMetadata(KEY_WRAP_ALGORITHM, GetNameForKeyWrapAlgorithm(keyWrapAlgorithm)); }