DMSCPMParser


@interface DMSCPMParser : NSObject

Class for parsing CPM paths. This is for very advanced usage of CPM. Most developers will not need to parse CPM, and some CPM values are not usable without additional processing. Unless there is a very specific need for parsing a CPM field, the Payload class can provide values for most usages. Generally, developers should treat CPM as a generic identifier and not need to deconstruct the format.

  • Initializes with a CPM path. Returns nil if the CPM path is not valid.

    Declaration

    Objective-C

    - (nullable id)initWithCPMPath:(nonnull NSString *)CPMPath;

    Swift

    init?(cpmPath CPMPath: String)
  • Returns an array of path components. DMSCPMComponent describes the component at each index.

    Declaration

    Objective-C

    @property (readonly) NSArray<NSString *> *_Nonnull pathComponents;

    Swift

    var pathComponents: [String] { get }
  • Returns the Subtype of a given CPM Path if applicable. If the subtype isn’t available, 0 is returned.

    Declaration

    Objective-C

    @property (readonly) NSString *_Nonnull subtype;

    Swift

    var subtype: String { get }
  • Returns the value of a given subtype for a given payload version. Returns nil if not applicable to the CPM path.

    Declaration

    Objective-C

    - (nullable NSString *)valueForVersion:(nonnull NSString *)version
                                   subtype:(nonnull NSString *)subtype;

    Swift

    func value(forVersion version: String, subtype: String) -> String?