Diffusion Apple API  6.9.0
Unified Client Library for iOS, tvOS and OS X / macOS
 All Classes Files Functions Variables Enumerations Enumerator Properties Pages
Enumerations | Functions | Variables
PTDiffusion.h File Reference

Enumerations

enum  PTDiffusionErrorCode { PTDiffusionErrorCode_MisquotedInput = 1 }
 

Functions

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

Variables

import Foundation
 
NSString *const PTDiffusionErrorDomain
 

Detailed Description

Collection of utility functions

Enumeration Type Documentation

Values assigned to the code property of NSError objects generated from some methods in the Diffusion API.

Since
6.2
Deprecated:
since 6.7 Use PTDiffusionError instead.
Enumerator
PTDiffusionErrorCode_MisquotedInput 

The string supplied has been encoded incorrectly.

Deprecated:
since 6.7 Use PTDiffusionError_MisquotedInput instead.
Since
6.2

Function Documentation

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
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
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

Variable Documentation

NSString* const PTDiffusionErrorDomain

The value assigned to the domain property of NSError objects generated from some methods in the Diffusion API.

Since
6.2
Deprecated:
since 6.7 Error domains have been converged into PTDiffusion.