getString

Get a string value held in the dictionary.

virtual const string& getString(const string &key) = 0;

virtual const string& getString(const string &key, const string &defaultValue) = 0;

Parameters

key: The key to be looked up in the dictionary.

defaultValue: The default value is returned if the key is not present in the dictionary.

Return Value

A string reference.

Remarks

If the parameter key is not found the first variant throws a NoSuchValueException indicating the key.

Example

string host = getString("hostName");

See also: setString

 

This topic was last updated on 2月 01, 2019, at 11:13:23 午前.

Eggplant icon Eggplant.io | Documentation Home | User Forums | Support | Copyright © 2019 Eggplant