company logo

String :: replaceOptions - Replace option variables in a string

The function replaces all option variables in a string by the option values currently set. Option variables not set will be removed from the string. Option variables set in the string have to be enclosed in %...%. Option variables have to consist of ASCII characters, only. Strings enclosed in %...% containing special characters are not considered as option variables.

Return value:  String object ( odaba::String & )

Implementation overview

Implementation details

  1. Replace all options in the string
    odaba::String & String  :: replaceOptions (  )

    Option variables referenced in the string need to be defined with full path (e.g. %Options.Email.Host%)

    // replacing Options.Email.Password

      String("my password: %Options.Email.Password%").replaceOptions();

  2. to list
  3. Replace options defined on option hierarchy level (sub options)
    odaba::String & String  :: replaceOptions ( odaba::String &cOptionPath )

    The function replaces options defined as sub options for the option passed in cOption. Option names in the string have to be defined relative to the

    // replacing Options.Email.Password

      String("my password: %Password%").replaceOptions("Options.Email");

    • cOptionPath - - internal feature (not documented)
  4. to list