Home Help Center

Properties.load clarification and saving property sets

Alexey RomanovAlexey Romanov Member Alexey RomanovOrganization: Focus MediaProject: Smart card controllers
What happens if the properties set already contains some of the properties contained in the loaded file? With the same or different values?

Also, is there a simple way to save a property set (or its subset for some prefix) to a file?

Comments

  • bernardbernard Jupiter, FLAdministrators, ZeroC Staff Bernard NormierOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    Hi Alexey,
    What happens if the properties set already contains some of the properties contained in the loaded file? With the same or different values?

    If you set a property that was previously set, you override the existing value. This is true whether you set this property programmatically or by loading a configuration file.
    Also, is there a simple way to save a property set (or its subset for some prefix) to a file?

    You can use the getPropertiesForPrefix operation to transform your property set (Ice Properties) into a simple dictionary<string, string> and then persist this dictionary anyway you like (e.g. into a file or Freeze Map). Ice does not provide a public API to write Ice Properties to an Ice configuration file.

    Best regards,
    Bernard
  • Alexey RomanovAlexey Romanov Member Alexey RomanovOrganization: Focus MediaProject: Smart card controllers
    Thank you for the answers!
Sign In or Register to comment.