mirror of
https://github.com/whoeevee/EeveeSpotifyReborn.git
synced 2026-01-09 00:23:20 +01:00
39 lines
861 B
Swift
39 lines
861 B
Swift
// Copyright (c) 2017-2020 Shawn Moore and XMLCoder contributors
|
|
//
|
|
// This software is released under the MIT License.
|
|
// https://opensource.org/licenses/MIT
|
|
//
|
|
// Created by Shawn Moore on 11/21/17.
|
|
//
|
|
|
|
import Foundation
|
|
|
|
/// Shared Key Types
|
|
struct XMLKey: CodingKey {
|
|
public let stringValue: String
|
|
public let intValue: Int?
|
|
|
|
public init?(stringValue: String) {
|
|
self.init(key: stringValue)
|
|
}
|
|
|
|
public init?(intValue: Int) {
|
|
self.init(index: intValue)
|
|
}
|
|
|
|
public init(stringValue: String, intValue: Int?) {
|
|
self.stringValue = stringValue
|
|
self.intValue = intValue
|
|
}
|
|
|
|
init(key: String) {
|
|
self.init(stringValue: key, intValue: nil)
|
|
}
|
|
|
|
init(index: Int) {
|
|
self.init(stringValue: "\(index)", intValue: index)
|
|
}
|
|
|
|
static let `super` = XMLKey(stringValue: "super")!
|
|
}
|