• Manual
  • API Documentation
  • Bayat.SaveSystem.Storage
  • IStorage

    Show / Hide Table of Contents
    • Bayat
      • UnityThread
    • Bayat.Core
      • AddReferenceWindow
      • AddReferenceWindow.Dependency
      • AssetReferenceResolver
      • AssetReferenceResolverEditor
      • BayatEditorStyles
      • CoreAssetPostProcessor
      • EditorApplicationUtility
      • MaterialPropertiesResolver
      • MaterialPropertiesResolverEditor
      • ReferenceCheckerWindow
      • ReferenceResolverMode
      • RuntimeMaterialProperties
      • RuntimeMaterialProperty
      • RuntimeMaterialPropertyType
      • SceneReferenceResolver
      • SceneReferenceResolverEditor
      • UnityEditorInternalException
    • Bayat.Core.EditorWindows
      • AssetReferenceManagerWindow
      • AssetReferenceManagerWindow.Styles
      • DatabaseMigrationWindow
      • DatabaseMigrationWindow.SceneMigrationStatus
      • DatabaseMigrationWindow.Styles
      • EditorWindowExtensions
      • EditorWindowUtility
      • EditorWindowWrapper
      • SceneReferenceManagerWindow
      • SceneReferenceManagerWindow.Styles
      • WindowClose
      • WrappedEditorWindow
    • Bayat.Core.Profiling
      • ProfiledSegment
      • ProfiledSegmentCollection
      • ProfilingScope
      • ProfilingUtility
    • Bayat.Core.Reflection
      • AssemblyExtensions
      • Codebase
      • RuntimeCodebase
      • TypeExtensions
      • TypeUtility
    • Bayat.Core.Text
      • StringExtensions
      • StringUtility
    • Bayat.Core.Utilities
      • ExceptionExtensions
      • GuidToReferenceDictionary
      • SerializableDictionary<TKey, TVal>
    • Bayat.Json
      • ConstructorHandling
      • CreateObjectConverterWindow
      • CreateObjectConverterWindow.Styles
      • DateFormatHandling
      • DateParseHandling
      • DateTimeZoneHandling
      • DefaultValueHandling
      • FloatFormatHandling
      • FloatParseHandling
      • Formatting
      • GameObjectSerializationHandler
      • GameObjectSerializationManagerTreeView
      • GameObjectSerializationManagerTreeView.Styles
      • GameObjectSerializationManagerWindow
      • GameObjectSerializationManagerWindow.Styles
      • IArrayPool<T>
      • IJsonLineInfo
      • JsonArrayAttribute
      • JsonConstructorAttribute
      • JsonContainerAttribute
      • JsonContainerType
      • JsonConvert
      • JsonConverter
      • JsonConverterAttribute
      • JsonConverterCollection
      • JsonDefaultSettingsWindow
      • JsonDefaultSettingsWindow.Styles
      • JsonDictionaryAttribute
      • JsonException
      • JsonExtensionDataAttribute
      • JsonIgnoreAttribute
      • JsonObjectAttribute
      • JsonPosition
      • JsonPropertyAttribute
      • JsonReader
      • JsonReader.State
      • JsonReaderException
      • JsonRequiredAttribute
      • JsonSerializationException
      • JsonSerializer
      • JsonSerializerSettings
      • JsonSerializerSettingsPreset
      • JsonTextReader
      • JsonTextWriter
      • JsonToken
      • JsonWriter
      • JsonWriter.State
      • JsonWriterException
      • MemberSerialization
      • MetadataPropertyHandling
      • MissingMemberHandling
      • NullValueHandling
      • ObjectCreationHandling
      • PreserveReferencesHandling
      • ReadType
      • ReferenceLoopHandling
      • Required
      • StringEscapeHandling
      • TypeNameHandling
      • WriteState
    • Bayat.Json.Bson
      • BsonArray
      • BsonBinary
      • BsonBinaryType
      • BsonBinaryWriter
      • BsonObject
      • BsonObjectId
      • BsonProperty
      • BsonReader
      • BsonRegex
      • BsonString
      • BsonToken
      • BsonType
      • BsonValue
      • BsonWriter
    • Bayat.Json.Converters
      • AnimatorConverter
      • AudioClipConverter
      • BinaryConverter
      • BoundsConverter
      • BsonObjectIdConverter
      • ColliderConverter
      • ColorConverter
      • CustomCreationConverter<T>
      • DateTimeConverterBase
      • DiscriminatedUnionConverter
      • EntityKeyMemberConverter
      • ExpandoObjectConverter
      • GameObjectConverter
      • HashSetConverter
      • IsoDateTimeConverter
      • JavaScriptDateTimeConverter
      • KeyValuePairConverter
      • MaterialConverter
      • MaterialConverter.JsonSerializedMaterialProperty
      • Matrix4x4Converter
      • MeshConverter
      • MeshConverter.SerializedIndices
      • MeshFilterConverter
      • ObjectJsonConverter
      • QuaternionConverter
      • RectConverter
      • RectTransformConverter
      • RegexConverter
      • RendererConverter
      • ResolutionConverter
      • ShaderConverter
      • SpriteConverter
      • StringEnumConverter
      • Texture2DConverter
      • TransformConverter
      • UnityBehaviourConverter
      • UnityComponentConverter
      • UnityMonoBehaviourConverter
      • UnityObjectConverter
      • UriConverter
      • VectorConverter
      • VersionConverter
      • XmlNodeConverter
    • Bayat.Json.Linq
      • CommentHandling
      • Extensions
      • IJEnumerable<T>
      • JArray
      • JConstructor
      • JContainer
      • JEnumerable<T>
      • JObject
      • JProperty
      • JPropertyDescriptor
      • JPropertyKeyedCollection
      • JRaw
      • JsonLoadSettings
      • JsonMergeSettings
      • JToken
      • JTokenEqualityComparer
      • JTokenReader
      • JTokenType
      • JTokenWriter
      • JValue
      • LineInfoHandling
      • MergeArrayHandling
      • MergeNullValueHandling
    • Bayat.Json.Linq.JsonPath
      • ArrayIndexFilter
      • ArrayMultipleIndexFilter
      • ArraySliceFilter
      • BooleanQueryExpression
      • CompositeExpression
      • FieldFilter
      • FieldMultipleFilter
      • JPath
      • PathFilter
      • QueryExpression
      • QueryFilter
      • QueryOperator
      • ScanFilter
    • Bayat.Json.Serialization
      • CachedAttributeGetter<T>
      • CamelCasePropertyNamesContractResolver
      • DefaultContractResolver
      • DefaultContractResolver.EnumerableDictionaryWrapper<TEnumeratorKey, TEnumeratorValue>
      • DefaultContractResolverState
      • DefaultReferenceResolver
      • DefaultSerializationBinder
      • DefaultSerializationBinder.TypeNameKey
      • DiagnosticsTraceWriter
      • ErrorContext
      • ErrorEventArgs
      • ExpressionValueProvider
      • ExtensionDataGetter
      • ExtensionDataSetter
      • IAttributeProvider
      • IContractResolver
      • IReferenceResolver
      • ITraceWriter
      • IValueProvider
      • JsonArrayContract
      • JsonContainerContract
      • JsonContract
      • JsonContractType
      • JsonDictionaryContract
      • JsonDynamicContract
      • JsonFormatterConverter
      • JsonISerializableContract
      • JsonLinqContract
      • JsonObjectContract
      • JsonPrimitiveContract
      • JsonProperty
      • JsonPropertyCollection
      • JsonSerializerInternalBase
      • JsonSerializerProxy
      • JsonSerializerReader
      • JsonSerializerReader.CreatorPropertyContext
      • JsonSerializerReader.PropertyPresence
      • JsonSerializerWriter
      • JsonStringContract
      • JsonTypeReflector
      • MemoryTraceWriter
      • ObjectConstructor<T>
      • OnErrorAttribute
      • ReflectionAttributeProvider
      • ReflectionValueProvider
      • ResolverContractKey
      • SerializationCallback
      • SerializationErrorCallback
      • TraceJsonReader
      • TraceJsonWriter
    • Bayat.Json.Shims
      • PreserveAttribute
    • Bayat.Json.Utilities
      • Base64Encoder
      • BidirectionalDictionary<TFirst, TSecond>
      • BufferUtils
      • CollectionUtils
      • CollectionWrapper<T>
      • ConvertUtils
      • ConvertUtils.ConvertResult
      • ConvertUtils.TypeConvertKey
      • Creator<T>
      • DateTimeParser
      • DateTimeUtils
      • DictionaryWrapper<TKey, TValue>
      • DynamicProxy<T>
      • DynamicProxyMetaObject<T>
      • DynamicUtils
      • DynamicUtils.BinderWrapper
      • EnumUtils
      • EnumValue<T>
      • ExpressionReflectionDelegateFactory
      • FSharpFunction
      • FSharpUtils
      • ImmutableCollectionsUtils
      • ImmutableCollectionsUtils.ImmutableCollectionTypeInfo
      • IWrappedCollection
      • IWrappedDictionary
      • JavaScriptUtils
      • JsonTokenUtils
      • LateBoundReflectionDelegateFactory
      • MathUtils
      • MethodCall<T, TResult>
      • MiscellaneousUtils
      • NoThrowExpressionVisitor
      • NoThrowGetBinderMember
      • NoThrowSetBinderMember
      • ParseResult
      • ParserTimeZone
      • PrimitiveTypeCode
      • PropertyNameTable
      • ReflectionDelegateFactory
      • ReflectionMember
      • ReflectionObject
      • ReflectionUtils
      • StringBuffer
      • StringReference
      • StringReferenceExtensions
      • StringUtils
      • ThreadSafeStore<TKey, TValue>
      • TypeInformation
      • ValidationUtils
    • Bayat.SaveSystem
      • AutoSave
      • AutoSaveManager
      • AutoSaveManager.LoadEvent
      • AutoSaveManager.SaveEvent
      • AutoSaveManagerWindow
      • AutoSaveManagerWindow.Styles
      • LoadEventArgs
      • LoadIntoEventArgs
      • SaveEventArgs
      • SaveSystemAPI
      • SaveSystemDefaultSettingsWindow
      • SaveSystemDefaultSettingsWindow.Styles
      • SaveSystemEditorResources
      • SaveSystemJsonSerializer
      • SaveSystemManager
      • SaveSystemSettings
      • SaveSystemSettingsPreset
      • WelcomeWindow
      • WelcomeWindow.Styles
    • Bayat.SaveSystem.Security
      • ISaveSystemEncryption
      • SaveSystemCryptoStream
      • SaveSystemSymmetricCryptoStream
      • SaveSystemSymmetricEncryption
    • Bayat.SaveSystem.Storage
      • BuiltInConnectionFactory
      • ConnectionStringFactory
      • FileStorageStream
      • IConnectionFactory
      • IStorage
      • IStorageStream
      • LocalDiskStorage
      • PlayerPrefsStorage
      • PlayerPrefsStorageStream
      • StorageBackup
      • StorageBase
      • StorageClearOperationResult
      • StorageConnectionString
      • StorageCopyOperationResult
      • StorageDeleteOperationResult
      • StorageFactory
      • StorageFullException
      • StorageInvalidIdentifierException
      • StorageItemNotFoundException
      • StorageListOptions
      • StorageMetaData
      • StorageMoveOperationResult
      • StorageOperationResult
      • StorageStream

    Interface IStorage

    The storage interface, inherit StorageBase for implementing your own storage.

    Namespace: Bayat.SaveSystem.Storage
    Assembly: Bayat.SaveSystem.Runtime.dll
    Syntax
    public interface IStorage

    Properties

    | Improve this Doc View Source

    BackupSuffix

    The backup item identifier suffix of this storage.

    Declaration
    string BackupSuffix { get; }
    Property Value
    Type Description
    System.String
    | Improve this Doc View Source

    CatalogIdentifier

    The catalog identifier of this storage.

    Declaration
    string CatalogIdentifier { get; }
    Property Value
    Type Description
    System.String
    | Improve this Doc View Source

    MetaSuffix

    The meta item identifier suffix of this storage.

    Declaration
    string MetaSuffix { get; }
    Property Value
    Type Description
    System.String
    | Improve this Doc View Source

    TextEncoding

    The storage text encoding.

    Declaration
    Encoding TextEncoding { get; set; }
    Property Value
    Type Description
    System.Text.Encoding
    | Improve this Doc View Source

    UseCatalog

    Gets or sets whether to use catalog or not.

    Declaration
    bool UseCatalog { get; set; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    UseMetaData

    Gets or sets whether to use meta data or not.

    Declaration
    bool UseMetaData { get; set; }
    Property Value
    Type Description
    System.Boolean

    Methods

    | Improve this Doc View Source

    Clear()

    Clears all items in the storage, this method will delete all items in the storage so use it at your own risk.

    Declaration
    Task<StorageClearOperationResult> Clear()
    Returns
    Type Description
    System.Threading.Tasks.Task<StorageClearOperationResult>

    True if operation was successful otherwise false

    | Improve this Doc View Source

    CommitWriteStream(IStorageStream)

    Commits the writable stream changes.

    Declaration
    Task CommitWriteStream(IStorageStream stream)
    Parameters
    Type Name Description
    IStorageStream stream

    The stream to commit its changes

    Returns
    Type Description
    System.Threading.Tasks.Task
    | Improve this Doc View Source

    Copy(String, String, Boolean)

    Copies the specified item to the new location.

    Declaration
    Task<StorageCopyOperationResult> Copy(string fromIdentifier, string toIdentifier, bool replace)
    Parameters
    Type Name Description
    System.String fromIdentifier

    The item source location

    System.String toIdentifier

    The itme destination location

    System.Boolean replace

    Replace the item at the destination or not if exists

    Returns
    Type Description
    System.Threading.Tasks.Task<StorageCopyOperationResult>

    True if operation was successful otherwise false

    | Improve this Doc View Source

    CreateBackup(String)

    Creates a new backup for the storage item.

    Declaration
    Task<StorageBackup> CreateBackup(string identifier)
    Parameters
    Type Name Description
    System.String identifier
    Returns
    Type Description
    System.Threading.Tasks.Task<StorageBackup>

    The created backup information StorageBackup

    | Improve this Doc View Source

    Delete(String)

    Deletes the specified item.

    Declaration
    Task<StorageDeleteOperationResult> Delete(string identifier)
    Parameters
    Type Name Description
    System.String identifier

    The item identifier

    Returns
    Type Description
    System.Threading.Tasks.Task<StorageDeleteOperationResult>

    True if operation was successful otherwise false

    | Improve this Doc View Source

    DeleteBackup(String, StorageBackup)

    Deletes the specified backup for the storage item.

    Declaration
    Task<StorageDeleteOperationResult> DeleteBackup(string identifier, StorageBackup backup)
    Parameters
    Type Name Description
    System.String identifier

    The storage item identifier

    StorageBackup backup

    The backup information

    Returns
    Type Description
    System.Threading.Tasks.Task<StorageDeleteOperationResult>

    True if operation was successful otherwise false

    | Improve this Doc View Source

    DeleteBackups(String)

    Deletes all the backups for the storage item.

    Declaration
    Task<bool> DeleteBackups(string identifier)
    Parameters
    Type Name Description
    System.String identifier

    The storage item identifier

    Returns
    Type Description
    System.Threading.Tasks.Task<System.Boolean>

    True if operation was successful otherwise false

    | Improve this Doc View Source

    DeleteMetaData(String)

    Deletes the specified item meta data.

    Declaration
    Task<StorageDeleteOperationResult> DeleteMetaData(string identifier)
    Parameters
    Type Name Description
    System.String identifier
    Returns
    Type Description
    System.Threading.Tasks.Task<StorageDeleteOperationResult>

    True if operation was successful otherwise false

    | Improve this Doc View Source

    Exists(String)

    Checks whether the specified item exists or not.

    Declaration
    Task<bool> Exists(string identifier)
    Parameters
    Type Name Description
    System.String identifier

    The item identifier

    Returns
    Type Description
    System.Threading.Tasks.Task<System.Boolean>

    True if item exists otherwise false

    | Improve this Doc View Source

    GetBackups(String)

    Gets the storage item backups.

    Declaration
    Task<List<StorageBackup>> GetBackups(string identifier)
    Parameters
    Type Name Description
    System.String identifier

    The storage item identifier to get backups from

    Returns
    Type Description
    System.Threading.Tasks.Task<System.Collections.Generic.List<StorageBackup>>

    The storage item backups

    | Improve this Doc View Source

    GetLatestBackup(String)

    Gets the latest backup information.

    Declaration
    Task<StorageBackup> GetLatestBackup(string identifier)
    Parameters
    Type Name Description
    System.String identifier

    The storage item identifier to get latest backup from

    Returns
    Type Description
    System.Threading.Tasks.Task<StorageBackup>

    The latest backup information

    | Improve this Doc View Source

    GetReadStream(String)

    Retrieves a readable stream from the storage.

    Declaration
    Task<IStorageStream> GetReadStream(string identifier)
    Parameters
    Type Name Description
    System.String identifier

    The item identifier

    Returns
    Type Description
    System.Threading.Tasks.Task<IStorageStream>

    A readable storage stream wrapper

    | Improve this Doc View Source

    GetWriteStream(String)

    Retrieves a writable stream from the storage.

    Declaration
    Task<IStorageStream> GetWriteStream(string identifier)
    Parameters
    Type Name Description
    System.String identifier

    The item identifier

    Returns
    Type Description
    System.Threading.Tasks.Task<IStorageStream>

    A writable storage stream wrapper

    | Improve this Doc View Source

    HasMetaData(String)

    Checks whether the specified item has meta data or not.

    Declaration
    Task<bool> HasMetaData(string identifier)
    Parameters
    Type Name Description
    System.String identifier

    The item identifier

    Returns
    Type Description
    System.Threading.Tasks.Task<System.Boolean>

    True if the specified item has meta data otherwise false

    | Improve this Doc View Source

    List(String, StorageListOptions)

    Lists items available at the specified location.

    Declaration
    Task<string[]> List(string identifier, StorageListOptions options)
    Parameters
    Type Name Description
    System.String identifier

    The location to look for items

    StorageListOptions options

    The list options

    Returns
    Type Description
    System.Threading.Tasks.Task<System.String[]>

    An array of items found at the specified location

    | Improve this Doc View Source

    ListAll()

    Lists all available items.

    Declaration
    Task<string[]> ListAll()
    Returns
    Type Description
    System.Threading.Tasks.Task<System.String[]>

    An array of all items found

    | Improve this Doc View Source

    LoadCatalog()

    Loads the catalog.

    Declaration
    Task<List<string>> LoadCatalog()
    Returns
    Type Description
    System.Threading.Tasks.Task<System.Collections.Generic.List<System.String>>

    A list of items available in the catalog

    | Improve this Doc View Source

    LoadMetaData(String)

    Loads the meta data for the specified item.

    Declaration
    Task<StorageMetaData> LoadMetaData(string identifier)
    Parameters
    Type Name Description
    System.String identifier

    The item identifier

    Returns
    Type Description
    System.Threading.Tasks.Task<StorageMetaData>

    The saved storage meta data if exists, otherwise returns a new instance of StorageMetaData

    | Improve this Doc View Source

    Move(String, String, Boolean)

    Declaration
    Task<StorageMoveOperationResult> Move(string oldIdentifier, string newIdentifier, bool replace)
    Parameters
    Type Name Description
    System.String oldIdentifier
    System.String newIdentifier
    System.Boolean replace
    Returns
    Type Description
    System.Threading.Tasks.Task<StorageMoveOperationResult>
    | Improve this Doc View Source

    ReadAllBytes(String)

    Reads all the binary data.

    Declaration
    Task<byte[]> ReadAllBytes(string identifier)
    Parameters
    Type Name Description
    System.String identifier

    The item identifier

    Returns
    Type Description
    System.Threading.Tasks.Task<System.Byte[]>

    The binary data

    | Improve this Doc View Source

    ReadAllText(String)

    Reads all the text data.

    Declaration
    Task<string> ReadAllText(string identifier)
    Parameters
    Type Name Description
    System.String identifier

    The item identifier

    Returns
    Type Description
    System.Threading.Tasks.Task<System.String>

    The text data

    | Improve this Doc View Source

    RestoreBackup(String, StorageBackup)

    Restores the backup for the storage item.

    Declaration
    Task<bool> RestoreBackup(string identifier, StorageBackup backup)
    Parameters
    Type Name Description
    System.String identifier

    The storage item identifier to restore backup

    StorageBackup backup

    The backup information

    Returns
    Type Description
    System.Threading.Tasks.Task<System.Boolean>

    True if operation was successful otherwise false

    | Improve this Doc View Source

    RestoreLatestBackup(String)

    Restores the latest backup for the storage item.

    Declaration
    Task<bool> RestoreLatestBackup(string identifier)
    Parameters
    Type Name Description
    System.String identifier

    The storage item identifier to restore backup

    Returns
    Type Description
    System.Threading.Tasks.Task<System.Boolean>

    True if operation was successful otherwise false

    | Improve this Doc View Source

    SaveCatalog(List<String>)

    Saves the catalog.

    Declaration
    Task SaveCatalog(List<string> catalog)
    Parameters
    Type Name Description
    System.Collections.Generic.List<System.String> catalog

    The catalog list

    Returns
    Type Description
    System.Threading.Tasks.Task
    | Improve this Doc View Source

    SaveMetaData(String, StorageMetaData)

    Saves the meta data for the specified item.

    Declaration
    Task SaveMetaData(string identifier, StorageMetaData metaData)
    Parameters
    Type Name Description
    System.String identifier

    The item identifier

    StorageMetaData metaData

    The meta data

    Returns
    Type Description
    System.Threading.Tasks.Task
    | Improve this Doc View Source

    UpdateMetaData(String, Boolean, Boolean)

    Updates the storage item meta data.

    Declaration
    Task UpdateMetaData(string identifier, bool isWrite, bool encrypted)
    Parameters
    Type Name Description
    System.String identifier

    The item identifier

    System.Boolean isWrite

    Specifies whether it is a write/read process

    System.Boolean encrypted

    Whether the item is encrypted or not

    Returns
    Type Description
    System.Threading.Tasks.Task
    | Improve this Doc View Source

    WriteAllBytes(String, Byte[])

    Writes all the binary data.

    Declaration
    Task WriteAllBytes(string identifier, byte[] data)
    Parameters
    Type Name Description
    System.String identifier

    The item identifier

    System.Byte[] data

    The binary data

    Returns
    Type Description
    System.Threading.Tasks.Task
    | Improve this Doc View Source

    WriteAllText(String, String)

    Writes all the text data.

    Declaration
    Task WriteAllText(string identifier, string data)
    Parameters
    Type Name Description
    System.String identifier

    The item identifier

    System.String data

    The text data

    Returns
    Type Description
    System.Threading.Tasks.Task
    • Improve this Doc
    • View Source
    • 0 Comments
    In This Article
    • Properties
      • BackupSuffix
      • CatalogIdentifier
      • MetaSuffix
      • TextEncoding
      • UseCatalog
      • UseMetaData
    • Methods
      • Clear()
      • CommitWriteStream(IStorageStream)
      • Copy(String, String, Boolean)
      • CreateBackup(String)
      • Delete(String)
      • DeleteBackup(String, StorageBackup)
      • DeleteBackups(String)
      • DeleteMetaData(String)
      • Exists(String)
      • GetBackups(String)
      • GetLatestBackup(String)
      • GetReadStream(String)
      • GetWriteStream(String)
      • HasMetaData(String)
      • List(String, StorageListOptions)
      • ListAll()
      • LoadCatalog()
      • LoadMetaData(String)
      • Move(String, String, Boolean)
      • ReadAllBytes(String)
      • ReadAllText(String)
      • RestoreBackup(String, StorageBackup)
      • RestoreLatestBackup(String)
      • SaveCatalog(List<String>)
      • SaveMetaData(String, StorageMetaData)
      • UpdateMetaData(String, Boolean, Boolean)
      • WriteAllBytes(String, Byte[])
      • WriteAllText(String, String)