Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
Elixxir dApps SDK Swift
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mobile
iOS
Elixxir dApps SDK Swift
Commits
e22c3daf
Commit
e22c3daf
authored
2 years ago
by
Dariusz Rybicki
Browse files
Options
Downloads
Patches
Plain Diff
Update MessengerFileManager
parent
c4fdba3c
No related branches found
No related tags found
2 merge requests
!110
Backup improvements & example
,
!102
Release 1.0.0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Sources/XXMessengerClient/Utils/MessengerFileManager.swift
+17
-1
17 additions, 1 deletion
Sources/XXMessengerClient/Utils/MessengerFileManager.swift
with
17 additions
and
1 deletion
Sources/XXMessengerClient/Utils/MessengerFileManager.swift
+
17
−
1
View file @
e22c3daf
...
@@ -5,6 +5,9 @@ public struct MessengerFileManager {
...
@@ -5,6 +5,9 @@ public struct MessengerFileManager {
public
var
isDirectoryEmpty
:
(
String
)
->
Bool
public
var
isDirectoryEmpty
:
(
String
)
->
Bool
public
var
removeItem
:
(
String
)
throws
->
Void
public
var
removeItem
:
(
String
)
throws
->
Void
public
var
createDirectory
:
(
String
)
throws
->
Void
public
var
createDirectory
:
(
String
)
throws
->
Void
public
var
saveFile
:
(
String
,
Data
)
throws
->
Void
public
var
loadFile
:
(
String
)
throws
->
Data
?
public
var
modifiedTime
:
(
String
)
throws
->
Date
?
}
}
extension
MessengerFileManager
{
extension
MessengerFileManager
{
...
@@ -26,6 +29,16 @@ extension MessengerFileManager {
...
@@ -26,6 +29,16 @@ extension MessengerFileManager {
atPath
:
path
,
atPath
:
path
,
withIntermediateDirectories
:
true
withIntermediateDirectories
:
true
)
)
},
saveFile
:
{
path
,
data
in
try
data
.
write
(
to
:
URL
(
fileURLWithPath
:
path
))
},
loadFile
:
{
path
in
try
Data
(
contentsOf
:
URL
(
fileURLWithPath
:
path
))
},
modifiedTime
:
{
path
in
let
attributes
=
try
fileManager
.
attributesOfItem
(
atPath
:
path
)
return
attributes
[
.
modificationDate
]
as?
Date
}
}
)
)
}
}
...
@@ -35,6 +48,9 @@ extension MessengerFileManager {
...
@@ -35,6 +48,9 @@ extension MessengerFileManager {
public
static
let
unimplemented
=
MessengerFileManager
(
public
static
let
unimplemented
=
MessengerFileManager
(
isDirectoryEmpty
:
XCTUnimplemented
(
"
\(
Self
.
self
)
.isDirectoryEmpty"
,
placeholder
:
false
),
isDirectoryEmpty
:
XCTUnimplemented
(
"
\(
Self
.
self
)
.isDirectoryEmpty"
,
placeholder
:
false
),
removeItem
:
XCTUnimplemented
(
"
\(
Self
.
self
)
.removeItem"
),
removeItem
:
XCTUnimplemented
(
"
\(
Self
.
self
)
.removeItem"
),
createDirectory
:
XCTUnimplemented
(
"
\(
Self
.
self
)
.createDirectory"
)
createDirectory
:
XCTUnimplemented
(
"
\(
Self
.
self
)
.createDirectory"
),
saveFile
:
XCTUnimplemented
(
"
\(
Self
.
self
)
.saveFile"
),
loadFile
:
XCTUnimplemented
(
"
\(
Self
.
self
)
.loadFile"
),
modifiedTime
:
XCTUnimplemented
(
"
\(
Self
.
self
)
.modifiedTime"
)
)
)
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment