How to parse a feature string and determine the enabled feature

The most common way of determining if a feature is enabled is by calling the QlmLicense.IsFeatureEnabledEx API.

However, if you have retrieved the feature value from the server's DB as a string, you can use the code below to parse the feature string and determine if a specific feature is enabled.

Example in C#:

private bool IsFeatureEnabled (string featureString, int featureSet, int featureID)
{
 bool ret = false;
 // lv is an instance of the LicenseValidator class
 int[] features = lv.QlmLicenseObject.ConvertFeaturesToArray(featureString);

 int feature = features[featureSet];
 if ((feature & featureID) == featureID)
 {
     ret = true;
 }

 return ret;
}

Example in VC++:

Last updated