Diffusion Apple API 6.12.0
Unified Client Library for iOS, tvOS and OS X / macOS
Loading...
Searching...
No Matches
PTDiffusion.h File Reference

Functions

NSString * PTDiffusionEscape (NSString *string)
BOOL PTDiffusionRolesFromString (NSString *string, NSSet< NSString * > *_Nullable *_Nonnull roles, NSError **error)
NSString * PTDiffusionStringFromRoles (NSSet< NSString * > *roles)

Detailed Description

Collection of utility functions

Function Documentation

◆ PTDiffusionEscape()

NSString * PTDiffusionEscape ( NSString * string)

Escapes special characters in a string that is to be used within a topic property or a session filter.

This is a convenience method which inserts an escape character \ before any of the special characters ‘’, " or `.

Parameters
stringThe string to be escaped.
Returns
The string value with escape characters inserted as appropriate.
Exceptions
NSInvalidArgumentExceptionIf the given string is `nil`.
Since
6.1

◆ PTDiffusionRolesFromString()

BOOL PTDiffusionRolesFromString ( NSString * string,
NSSet< NSString * > *_Nullable *_Nonnull roles,
NSError ** error )

Converts a string of the format required by the rolesPropertyKey (PTDiffusionSession) into a set of strings.

Parameters
stringQuoted roles, separated by whitespace or commas.
rolesIf successful, upon return contains the set of roles.
errorIf an error occurs, upon return contains an NSError object that describes the problem.
Returns
An immutable set of roles.
Since
6.2

◆ PTDiffusionStringFromRoles()

NSString * PTDiffusionStringFromRoles ( NSSet< NSString * > * roles)

Converts a set of authorisation roles to the string format required by the rolesPropertyKey (PTDiffusionSession).

Parameters
rolesThe roles to format.
Returns
A string representation of the supplied roles.
Since
6.2