Move string coder protocols into the same file

This commit is contained in:
Daniel Saidi 2022-06-20 09:23:16 +02:00
parent 5d064644e9
commit d0aa08edf2
3 changed files with 24 additions and 42 deletions

View File

@ -13,3 +13,27 @@ import Foundation
and decode strings.
*/
public protocol StringCoder: StringEncoder, StringDecoder {}
/**
This protocol can be implemented by classes that can decode
strings.
*/
public protocol StringDecoder: AnyObject {
/**
Decode a string to another string.
*/
func decode(_ string: String) -> String?
}
/**
This protocol can be implemented by classes that can encode
strings.
*/
public protocol StringEncoder: AnyObject {
/**
Encode a string to something else.
*/
func encode(_ string: String) -> String?
}

View File

@ -1,21 +0,0 @@
//
// StringDecoder.swift
// SwiftKit
//
// Created by Daniel Saidi on 2015-03-21.
// Copyright © 2020 Daniel Saidi. All rights reserved.
//
import Foundation
/**
This protocol can be implemented by classes that can decode
strings.
*/
public protocol StringDecoder: AnyObject {
/**
Decode a string to another string.
*/
func decode(_ string: String) -> String?
}

View File

@ -1,21 +0,0 @@
//
// StringEncoder.swift
// SwiftKit
//
// Created by Daniel Saidi on 2015-03-21.
// Copyright © 2020 Daniel Saidi. All rights reserved.
//
import Foundation
/**
This protocol can be implemented by classes that can encode
strings.
*/
public protocol StringEncoder: AnyObject {
/**
Encode a string to something else.
*/
func encode(_ string: String) -> String?
}