ficher: use lib/encoder

This commit is contained in:
Nick Craig-Wood
2019-09-30 22:00:25 +01:00
parent 4098907511
commit 8d8fad724b
7 changed files with 70 additions and 104 deletions
+27
View File
@@ -229,6 +229,31 @@ const Pcloud = encoder.MultiEncoder(
encoder.EncodeBackSlash |
encoder.EncodeInvalidUtf8)
// Fichier is the encoding used by the fichier backend
//
// Characters that need escaping
//
// '\\': '\', // FULLWIDTH REVERSE SOLIDUS
// '<': '<', // FULLWIDTH LESS-THAN SIGN
// '>': '>', // FULLWIDTH GREATER-THAN SIGN
// '"': '"', // FULLWIDTH QUOTATION MARK - not on the list but seems to be reserved
// '\'': ''', // FULLWIDTH APOSTROPHE
// '$': '$', // FULLWIDTH DOLLAR SIGN
// '`': '`', // FULLWIDTH GRAVE ACCENT
//
// Leading space and trailing space
const Fichier = encoder.MultiEncoder(
uint(Display) |
encoder.EncodeBackSlash |
encoder.EncodeSingleQuote |
encoder.EncodeBackQuote |
encoder.EncodeDoubleQuote |
encoder.EncodeLtGt |
encoder.EncodeDollar |
encoder.EncodeLeftSpace |
encoder.EncodeRightSpace |
encoder.EncodeInvalidUtf8)
// FTP is the encoding used by the ftp backend
//
// The FTP protocal can't handle trailing spaces (for instance
@@ -298,6 +323,8 @@ func ByName(name string) encoder.Encoder {
case "dropbox":
return Dropbox
//case "ftp":
case "ficher":
return Fichier
case "googlecloudstorage":
return GoogleCloudStorage
//case "http":
+4
View File
@@ -15,11 +15,13 @@ const (
LocalUnix = Base
LocalWindows = Base
AmazonCloudDrive = Base
AzureBlob = Base
B2 = Base
Box = Base
Drive = Base
Dropbox = Base
FTP = Base
Fichier = Base
GoogleCloudStorage = Base
JottaCloud = Base
Koofr = Base
@@ -27,7 +29,9 @@ const (
OneDrive = Base
OpenDrive = Base
Pcloud = Base
QingStor = Base
S3 = Base
Swift = Base
)
// ByName returns the encoder for a give backend name or nil