2 * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the License);
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an AS IS BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
19 namespace Tizen.Content.MediaContent
22 /// Represents the storage information for media.
25 /// The system generates the storage ID when the external storage is added and manages the media information
26 /// in each of the storage by using the storage ID.
30 internal Storage(IntPtr handle)
32 Path = InteropHelper.GetString(handle, Interop.Storage.GetPath);
33 Id = InteropHelper.GetString(handle, Interop.Storage.GetId);
34 Type = InteropHelper.GetValue<StorageType>(handle, Interop.Storage.GetType);
37 internal static Storage FromHandle(IntPtr handle) => new Storage(handle);
40 /// Gets the ID of the storage.
42 /// <value>The unique ID of the storage.</value>
43 public string Id { get; }
46 /// Gets the path of the storage.
48 /// <value>The path of the storage.</value>
49 public string Path { get; }
52 /// Gets the type of the storage.
54 /// <value>The type of the storage.</value>
55 public StorageType Type { get; }
58 /// Returns a string representation of the storage.
60 /// <returns>A string representation of the current storage.</returns>
61 public override string ToString() =>
62 $"Id={Id}, Path={Path}, Type={Type}";