├── docs ├── styles │ ├── main.css │ ├── main.js │ ├── glyphicons-halflings-regular-ACNUA6UY.ttf │ ├── glyphicons-halflings-regular-JOUF32XT.woff │ ├── glyphicons-halflings-regular-PIHUWCJO.eot │ └── glyphicons-halflings-regular-W4DYDFZM.woff2 ├── favicon.ico ├── images │ ├── tree.png │ ├── burner.jpg │ ├── burner.png │ ├── index_tree1.png │ ├── index_tree2.png │ ├── index_tree3.png │ ├── index_tree4.png │ ├── index_tree5.png │ ├── index_tree6A.png │ ├── index_tree6B.png │ ├── index_tree6C.png │ ├── tree_banner_960x540.png │ ├── treetree_earthtones.webp │ ├── tree_banner_960x540_1.png │ ├── tree_banner_960x540_2.png │ ├── tree_banner_960x540_3.png │ ├── tree_banner_960x540_4.png │ ├── tree_banner_960x540_5.png │ ├── tree_banner_960x540_6.png │ ├── tree_earthtones_512x512.png │ └── tree_earthtones_240x240_trans.png ├── toc.json ├── logo.svg ├── toc.html ├── search-stopwords.json ├── api │ ├── AkiraNetwork.VirtualStorageLibrary.Localization.html │ ├── AkiraNetwork.VirtualStorageLibrary.Utilities.html │ ├── AkiraNetwork.VirtualStorageLibrary.WildcardMatchers.html │ └── AkiraNetwork.VirtualStorageLibrary.NotifyNodeDelegate.html └── licenses.html ├── project-specific-exclusion.dic ├── .github └── FUNDING.yml ├── tree.png ├── documents ├── docfx.json ├── images │ ├── tree.png │ ├── burner.jpg │ ├── burner.png │ ├── index_tree1.png │ ├── index_tree2.png │ ├── index_tree3.png │ ├── index_tree4.png │ ├── index_tree5.png │ ├── index_tree6A.png │ ├── index_tree6B.png │ ├── index_tree6C.png │ ├── tree_banner_960x540.png │ ├── treetree_earthtones.webp │ ├── tree_banner_960x540_1.png │ ├── tree_banner_960x540_2.png │ ├── tree_banner_960x540_3.png │ ├── tree_banner_960x540_4.png │ ├── tree_banner_960x540_5.png │ ├── tree_banner_960x540_6.png │ ├── tree_earthtones_512x512.png │ └── tree_earthtones_240x240_trans.png ├── templates │ ├── material.zip │ └── material │ │ └── public │ │ └── main.css ├── toc.yml ├── styles │ └── an_custom.css ├── api │ ├── AkiraNetwork.VirtualStorageLibrary.Localization.yml │ ├── AkiraNetwork.VirtualStorageLibrary.WildcardMatchers.yml │ ├── AkiraNetwork.VirtualStorageLibrary.Utilities.yml │ └── toc.yml ├── licenses.md ├── index.ja.md ├── getting-started.ja.md ├── getting-started.md ├── index.md ├── introduction.ja.md └── aboutme.ja.md ├── .mono └── registry │ └── CurrentUser │ └── software │ └── microsoft │ ├── sqmclient │ └── values.xml │ └── csdevkit │ ├── v1 │ └── pids │ │ ├── 11593_133566789417385095 │ │ └── values.xml │ │ ├── 1564_133568409541537463 │ │ └── values.xml │ │ ├── 1935_133565996645698602 │ │ └── values.xml │ │ ├── 2111_133565949853492116 │ │ └── values.xml │ │ ├── 2283_133589232894739480 │ │ └── values.xml │ │ ├── 2302_133589287495473640 │ │ └── values.xml │ │ ├── 2953_133591016211730142 │ │ └── values.xml │ │ ├── 30675_133591063362613678 │ │ └── values.xml │ │ ├── 34167_133565820866963956 │ │ └── values.xml │ │ ├── 3459_133573704351862780 │ │ └── values.xml │ │ ├── 4023_133567655026915645 │ │ └── values.xml │ │ ├── 40771_133589152595393282 │ │ └── values.xml │ │ └── 9606_133565924784205602 │ │ └── values.xml │ └── telemetry │ └── persistentpropertybag │ └── values.xml ├── .vscode └── tasks.json ├── .editorconfig ├── AkiraNetwork ├── VirtualStorageLibrary.Test │ ├── GlobalUsings.cs │ ├── VirtualStorageLibrary.Test.csproj │ ├── SimpleData.cs │ ├── VirtualIDTests.cs │ ├── VirtualCycleDetectorTests.cs │ ├── VirtualTestBase.cs │ ├── VirtualStorageSettingsTests.cs │ ├── WildcardMatchers │ │ └── PowerShellWildcardMatcherTests.cs │ ├── VirtualExceptionTests.cs │ └── VirtualStorageStateTests.cs └── VirtualStorageLibrary │ ├── GlobalUsings.cs │ ├── VirtualEnums.cs │ ├── VirtualID.cs │ ├── VirtualDelegates.cs │ ├── VS.Indexer.cs │ ├── VirtualSortCondition.cs │ ├── VirtualGroupCondition.cs │ ├── VirtualStorage.cs │ ├── VirtualCycleDetector.cs │ ├── VirtualNodeListConditions.cs │ ├── VirtualAdapter.cs │ ├── VirtualInterfaces.cs │ ├── VirtualNode.cs │ ├── VirtualStorageLibrary.csproj │ ├── WildcardMatchers │ └── DefaultWildcardMatcher.cs │ ├── VirtualExtensions.cs │ ├── VirtualException.cs │ ├── VirtualNodeContext.cs │ └── VirtualStorageSettings.cs ├── licenses ├── DocFX_Material_LICENSE.txt └── DocFX_LICENSE.txt ├── coverage.ps1 ├── COMMERCIAL_LICENSE ├── .gitattributes └── VirtualStorageLibrary.sln /docs/styles/main.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /project-specific-exclusion.dic: -------------------------------------------------------------------------------- 1 | Jamo 2 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: [AkiraNetwork] 2 | -------------------------------------------------------------------------------- /tree.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AkiraNetwork/VirtualStorageLibrary/HEAD/tree.png -------------------------------------------------------------------------------- /docs/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AkiraNetwork/VirtualStorageLibrary/HEAD/docs/favicon.ico -------------------------------------------------------------------------------- /docs/images/tree.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AkiraNetwork/VirtualStorageLibrary/HEAD/docs/images/tree.png -------------------------------------------------------------------------------- /documents/docfx.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AkiraNetwork/VirtualStorageLibrary/HEAD/documents/docfx.json -------------------------------------------------------------------------------- /docs/images/burner.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AkiraNetwork/VirtualStorageLibrary/HEAD/docs/images/burner.jpg -------------------------------------------------------------------------------- /docs/images/burner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AkiraNetwork/VirtualStorageLibrary/HEAD/docs/images/burner.png -------------------------------------------------------------------------------- /documents/images/tree.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AkiraNetwork/VirtualStorageLibrary/HEAD/documents/images/tree.png -------------------------------------------------------------------------------- /docs/images/index_tree1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AkiraNetwork/VirtualStorageLibrary/HEAD/docs/images/index_tree1.png -------------------------------------------------------------------------------- /docs/images/index_tree2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AkiraNetwork/VirtualStorageLibrary/HEAD/docs/images/index_tree2.png -------------------------------------------------------------------------------- /docs/images/index_tree3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AkiraNetwork/VirtualStorageLibrary/HEAD/docs/images/index_tree3.png -------------------------------------------------------------------------------- /docs/images/index_tree4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AkiraNetwork/VirtualStorageLibrary/HEAD/docs/images/index_tree4.png -------------------------------------------------------------------------------- /docs/images/index_tree5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AkiraNetwork/VirtualStorageLibrary/HEAD/docs/images/index_tree5.png -------------------------------------------------------------------------------- /docs/images/index_tree6A.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AkiraNetwork/VirtualStorageLibrary/HEAD/docs/images/index_tree6A.png -------------------------------------------------------------------------------- /docs/images/index_tree6B.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AkiraNetwork/VirtualStorageLibrary/HEAD/docs/images/index_tree6B.png -------------------------------------------------------------------------------- /docs/images/index_tree6C.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AkiraNetwork/VirtualStorageLibrary/HEAD/docs/images/index_tree6C.png -------------------------------------------------------------------------------- /documents/images/burner.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AkiraNetwork/VirtualStorageLibrary/HEAD/documents/images/burner.jpg -------------------------------------------------------------------------------- /documents/images/burner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AkiraNetwork/VirtualStorageLibrary/HEAD/documents/images/burner.png -------------------------------------------------------------------------------- /documents/images/index_tree1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AkiraNetwork/VirtualStorageLibrary/HEAD/documents/images/index_tree1.png -------------------------------------------------------------------------------- /documents/images/index_tree2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AkiraNetwork/VirtualStorageLibrary/HEAD/documents/images/index_tree2.png -------------------------------------------------------------------------------- /documents/images/index_tree3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AkiraNetwork/VirtualStorageLibrary/HEAD/documents/images/index_tree3.png -------------------------------------------------------------------------------- /documents/images/index_tree4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AkiraNetwork/VirtualStorageLibrary/HEAD/documents/images/index_tree4.png -------------------------------------------------------------------------------- /documents/images/index_tree5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AkiraNetwork/VirtualStorageLibrary/HEAD/documents/images/index_tree5.png -------------------------------------------------------------------------------- /documents/images/index_tree6A.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AkiraNetwork/VirtualStorageLibrary/HEAD/documents/images/index_tree6A.png -------------------------------------------------------------------------------- /documents/images/index_tree6B.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AkiraNetwork/VirtualStorageLibrary/HEAD/documents/images/index_tree6B.png -------------------------------------------------------------------------------- /documents/images/index_tree6C.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AkiraNetwork/VirtualStorageLibrary/HEAD/documents/images/index_tree6C.png -------------------------------------------------------------------------------- /documents/templates/material.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AkiraNetwork/VirtualStorageLibrary/HEAD/documents/templates/material.zip -------------------------------------------------------------------------------- /docs/images/tree_banner_960x540.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AkiraNetwork/VirtualStorageLibrary/HEAD/docs/images/tree_banner_960x540.png -------------------------------------------------------------------------------- /docs/images/treetree_earthtones.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AkiraNetwork/VirtualStorageLibrary/HEAD/docs/images/treetree_earthtones.webp -------------------------------------------------------------------------------- /docs/images/tree_banner_960x540_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AkiraNetwork/VirtualStorageLibrary/HEAD/docs/images/tree_banner_960x540_1.png -------------------------------------------------------------------------------- /docs/images/tree_banner_960x540_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AkiraNetwork/VirtualStorageLibrary/HEAD/docs/images/tree_banner_960x540_2.png -------------------------------------------------------------------------------- /docs/images/tree_banner_960x540_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AkiraNetwork/VirtualStorageLibrary/HEAD/docs/images/tree_banner_960x540_3.png -------------------------------------------------------------------------------- /docs/images/tree_banner_960x540_4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AkiraNetwork/VirtualStorageLibrary/HEAD/docs/images/tree_banner_960x540_4.png -------------------------------------------------------------------------------- /docs/images/tree_banner_960x540_5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AkiraNetwork/VirtualStorageLibrary/HEAD/docs/images/tree_banner_960x540_5.png -------------------------------------------------------------------------------- /docs/images/tree_banner_960x540_6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AkiraNetwork/VirtualStorageLibrary/HEAD/docs/images/tree_banner_960x540_6.png -------------------------------------------------------------------------------- /docs/images/tree_earthtones_512x512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AkiraNetwork/VirtualStorageLibrary/HEAD/docs/images/tree_earthtones_512x512.png -------------------------------------------------------------------------------- /documents/images/tree_banner_960x540.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AkiraNetwork/VirtualStorageLibrary/HEAD/documents/images/tree_banner_960x540.png -------------------------------------------------------------------------------- /documents/images/treetree_earthtones.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AkiraNetwork/VirtualStorageLibrary/HEAD/documents/images/treetree_earthtones.webp -------------------------------------------------------------------------------- /documents/images/tree_banner_960x540_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AkiraNetwork/VirtualStorageLibrary/HEAD/documents/images/tree_banner_960x540_1.png -------------------------------------------------------------------------------- /documents/images/tree_banner_960x540_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AkiraNetwork/VirtualStorageLibrary/HEAD/documents/images/tree_banner_960x540_2.png -------------------------------------------------------------------------------- /documents/images/tree_banner_960x540_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AkiraNetwork/VirtualStorageLibrary/HEAD/documents/images/tree_banner_960x540_3.png -------------------------------------------------------------------------------- /documents/images/tree_banner_960x540_4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AkiraNetwork/VirtualStorageLibrary/HEAD/documents/images/tree_banner_960x540_4.png -------------------------------------------------------------------------------- /documents/images/tree_banner_960x540_5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AkiraNetwork/VirtualStorageLibrary/HEAD/documents/images/tree_banner_960x540_5.png -------------------------------------------------------------------------------- /documents/images/tree_banner_960x540_6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AkiraNetwork/VirtualStorageLibrary/HEAD/documents/images/tree_banner_960x540_6.png -------------------------------------------------------------------------------- /documents/images/tree_earthtones_512x512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AkiraNetwork/VirtualStorageLibrary/HEAD/documents/images/tree_earthtones_512x512.png -------------------------------------------------------------------------------- /docs/images/tree_earthtones_240x240_trans.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AkiraNetwork/VirtualStorageLibrary/HEAD/docs/images/tree_earthtones_240x240_trans.png -------------------------------------------------------------------------------- /docs/styles/main.js: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | -------------------------------------------------------------------------------- /documents/images/tree_earthtones_240x240_trans.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AkiraNetwork/VirtualStorageLibrary/HEAD/documents/images/tree_earthtones_240x240_trans.png -------------------------------------------------------------------------------- /docs/styles/glyphicons-halflings-regular-ACNUA6UY.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AkiraNetwork/VirtualStorageLibrary/HEAD/docs/styles/glyphicons-halflings-regular-ACNUA6UY.ttf -------------------------------------------------------------------------------- /docs/styles/glyphicons-halflings-regular-JOUF32XT.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AkiraNetwork/VirtualStorageLibrary/HEAD/docs/styles/glyphicons-halflings-regular-JOUF32XT.woff -------------------------------------------------------------------------------- /docs/styles/glyphicons-halflings-regular-PIHUWCJO.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AkiraNetwork/VirtualStorageLibrary/HEAD/docs/styles/glyphicons-halflings-regular-PIHUWCJO.eot -------------------------------------------------------------------------------- /.mono/registry/CurrentUser/software/microsoft/sqmclient/values.xml: -------------------------------------------------------------------------------- 1 | 2 | {590FF855-1CD3-09EE-53AF-B18AB4BC32B0} 3 | -------------------------------------------------------------------------------- /docs/styles/glyphicons-halflings-regular-W4DYDFZM.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AkiraNetwork/VirtualStorageLibrary/HEAD/docs/styles/glyphicons-halflings-regular-W4DYDFZM.woff2 -------------------------------------------------------------------------------- /.mono/registry/CurrentUser/software/microsoft/csdevkit/v1/pids/11593_133566789417385095/values.xml: -------------------------------------------------------------------------------- 1 | 2 | 133566828568121437 3 | -------------------------------------------------------------------------------- /.mono/registry/CurrentUser/software/microsoft/csdevkit/v1/pids/1564_133568409541537463/values.xml: -------------------------------------------------------------------------------- 1 | 2 | 133568460744592646 3 | -------------------------------------------------------------------------------- /.mono/registry/CurrentUser/software/microsoft/csdevkit/v1/pids/1935_133565996645698602/values.xml: -------------------------------------------------------------------------------- 1 | 2 | 133565999814131018 3 | -------------------------------------------------------------------------------- /.mono/registry/CurrentUser/software/microsoft/csdevkit/v1/pids/2111_133565949853492116/values.xml: -------------------------------------------------------------------------------- 1 | 2 | 133565994954454365 3 | -------------------------------------------------------------------------------- /.mono/registry/CurrentUser/software/microsoft/csdevkit/v1/pids/2283_133589232894739480/values.xml: -------------------------------------------------------------------------------- 1 | 2 | 133589284017457437 3 | -------------------------------------------------------------------------------- /.mono/registry/CurrentUser/software/microsoft/csdevkit/v1/pids/2302_133589287495473640/values.xml: -------------------------------------------------------------------------------- 1 | 2 | 133589296614976907 3 | -------------------------------------------------------------------------------- /.mono/registry/CurrentUser/software/microsoft/csdevkit/v1/pids/2953_133591016211730142/values.xml: -------------------------------------------------------------------------------- 1 | 2 | 133591070327313689 3 | -------------------------------------------------------------------------------- /.mono/registry/CurrentUser/software/microsoft/csdevkit/v1/pids/30675_133591063362613678/values.xml: -------------------------------------------------------------------------------- 1 | 2 | 133591069466688049 3 | -------------------------------------------------------------------------------- /.mono/registry/CurrentUser/software/microsoft/csdevkit/v1/pids/34167_133565820866963956/values.xml: -------------------------------------------------------------------------------- 1 | 2 | 133565847975382442 3 | -------------------------------------------------------------------------------- /.mono/registry/CurrentUser/software/microsoft/csdevkit/v1/pids/3459_133573704351862780/values.xml: -------------------------------------------------------------------------------- 1 | 2 | 133573761521399041 3 | -------------------------------------------------------------------------------- /.mono/registry/CurrentUser/software/microsoft/csdevkit/v1/pids/4023_133567655026915645/values.xml: -------------------------------------------------------------------------------- 1 | 2 | 133567730118150038 3 | -------------------------------------------------------------------------------- /.mono/registry/CurrentUser/software/microsoft/csdevkit/v1/pids/40771_133589152595393282/values.xml: -------------------------------------------------------------------------------- 1 | 2 | 133589155715209270 3 | -------------------------------------------------------------------------------- /.mono/registry/CurrentUser/software/microsoft/csdevkit/v1/pids/9606_133565924784205602/values.xml: -------------------------------------------------------------------------------- 1 | 2 | 133565945931294211 3 | -------------------------------------------------------------------------------- /.mono/registry/CurrentUser/software/microsoft/csdevkit/telemetry/persistentpropertybag/values.xml: -------------------------------------------------------------------------------- 1 | 2 | 590ff8551cd309ee53afb18ab4bc32b0ff5b8c800f2dbdc2afc1a412fde29aa2 3 | -------------------------------------------------------------------------------- /documents/toc.yml: -------------------------------------------------------------------------------- 1 | - name: Introduction 2 | href: introduction.md 3 | - name: Getting Started 4 | href: getting-started.md 5 | - name: API Reference 6 | href: api/ 7 | - name: Licenses 8 | href: licenses.md 9 | - name: About Me 10 | href: aboutme.md 11 | -------------------------------------------------------------------------------- /documents/styles/an_custom.css: -------------------------------------------------------------------------------- 1 | .remarks { 2 | background-color: #f0f8ff; /* 背景色を指定 */ 3 | border-left: 4px solid #007acc; /* 左側のボーダーを指定 */ 4 | padding: 10px; /* 内側の余白を指定 */ 5 | margin-bottom: 10px; /* 下部の余白を指定 */ 6 | } 7 | 8 | .remarks p { 9 | margin: 0; /* 段落の余白をリセット */ 10 | } 11 | -------------------------------------------------------------------------------- /docs/toc.json: -------------------------------------------------------------------------------- 1 | 2 | {"items":[{"name":"Introduction","href":"introduction.html","topicHref":"introduction.html"},{"name":"Getting Started","href":"getting-started.html","topicHref":"getting-started.html"},{"name":"API Reference","href":"api/AkiraNetwork.VirtualStorageLibrary.html","tocHref":"api/toc.html","topicHref":"api/AkiraNetwork.VirtualStorageLibrary.html","topicUid":"AkiraNetwork.VirtualStorageLibrary"},{"name":"Licenses","href":"licenses.html","topicHref":"licenses.html"},{"name":"About Me","href":"aboutme.html","topicHref":"aboutme.html"}],"favicon":"images/tree.png","pdf":false,"site_name":"VirtualStorageLibrary"} 3 | -------------------------------------------------------------------------------- /.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0.0", 3 | "tasks": [ 4 | { 5 | "label": "coverage", 6 | "type": "shell", 7 | "windows": { 8 | "command": "powershell", 9 | "args": [ 10 | "-File", 11 | "${workspaceFolder}/coverage.ps1" 12 | ] 13 | }, 14 | "linux": { 15 | "command": "pwsh", 16 | "args": [ 17 | "-File", 18 | "${workspaceFolder}/coverage.ps1" 19 | ] 20 | }, 21 | "presentation": { 22 | "reveal": "always", 23 | "panel": "shared", 24 | "focus": false 25 | } 26 | } 27 | ] 28 | } 29 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | [*] 2 | spelling_exclusion_path = .\project-specific-exclusion.dic 3 | 4 | [*.cs] 5 | dotnet_diagnostic.IDE0290.severity = none 6 | file_header_template = This file is part of VirtualStorageLibrary.\n\nCopyright (C) 2024 Akira Shimodate\n\nVirtualStorageLibrary is free software, and it is distributed under the terms of \nthe GNU Lesser General Public License (version 3, or at your option, any later \nversion). This license is published by the Free Software Foundation.\n\nVirtualStorageLibrary is distributed in the hope that it will be useful, \nbut WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or \nFITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for \nmore details.\n\nYou should have received a copy of the GNU Lesser General Public License along \nwith VirtualStorageLibrary. If not, see https://www.gnu.org/licenses/. 7 | -------------------------------------------------------------------------------- /AkiraNetwork/VirtualStorageLibrary.Test/GlobalUsings.cs: -------------------------------------------------------------------------------- 1 | // This file is part of VirtualStorageLibrary. 2 | // 3 | // Copyright (C) 2024 Akira Shimodate 4 | // 5 | // VirtualStorageLibrary is free software, and it is distributed under the terms of 6 | // the GNU Lesser General Public License (version 3, or at your option, any later 7 | // version). This license is published by the Free Software Foundation. 8 | // 9 | // VirtualStorageLibrary is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or 11 | // FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for 12 | // more details. 13 | // 14 | // You should have received a copy of the GNU Lesser General Public License along 15 | // with VirtualStorageLibrary. If not, see https://www.gnu.org/licenses/. 16 | 17 | global using Microsoft.VisualStudio.TestTools.UnitTesting; -------------------------------------------------------------------------------- /AkiraNetwork/VirtualStorageLibrary.Test/VirtualStorageLibrary.Test.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net8.0 5 | enable 6 | enable 7 | false 8 | true 9 | AkiraNetwork.VirtualStorageLibrary.Test 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /documents/api/AkiraNetwork.VirtualStorageLibrary.Localization.yml: -------------------------------------------------------------------------------- 1 | ### YamlMime:ManagedReference 2 | items: 3 | - uid: AkiraNetwork.VirtualStorageLibrary.Localization 4 | commentId: N:AkiraNetwork.VirtualStorageLibrary.Localization 5 | id: AkiraNetwork.VirtualStorageLibrary.Localization 6 | children: 7 | - AkiraNetwork.VirtualStorageLibrary.Localization.Resources 8 | langs: 9 | - csharp 10 | - vb 11 | name: AkiraNetwork.VirtualStorageLibrary.Localization 12 | nameWithType: AkiraNetwork.VirtualStorageLibrary.Localization 13 | fullName: AkiraNetwork.VirtualStorageLibrary.Localization 14 | type: Namespace 15 | assemblies: 16 | - VirtualStorageLibrary 17 | references: 18 | - uid: AkiraNetwork.VirtualStorageLibrary.Localization.Resources 19 | commentId: T:AkiraNetwork.VirtualStorageLibrary.Localization.Resources 20 | href: AkiraNetwork.VirtualStorageLibrary.Localization.Resources.html 21 | name: Resources 22 | nameWithType: Resources 23 | fullName: AkiraNetwork.VirtualStorageLibrary.Localization.Resources 24 | -------------------------------------------------------------------------------- /AkiraNetwork/VirtualStorageLibrary.Test/SimpleData.cs: -------------------------------------------------------------------------------- 1 | // This file is part of VirtualStorageLibrary. 2 | // 3 | // Copyright (C) 2024 Akira Shimodate 4 | // 5 | // VirtualStorageLibrary is free software, and it is distributed under the terms of 6 | // the GNU Lesser General Public License (version 3, or at your option, any later 7 | // version). This license is published by the Free Software Foundation. 8 | // 9 | // VirtualStorageLibrary is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or 11 | // FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for 12 | // more details. 13 | // 14 | // You should have received a copy of the GNU Lesser General Public License along 15 | // with VirtualStorageLibrary. If not, see https://www.gnu.org/licenses/. 16 | 17 | namespace AkiraNetwork.VirtualStorageLibrary.Test 18 | { 19 | public class SimpleData(int value) 20 | { 21 | public int Value { get; set; } = value; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /AkiraNetwork/VirtualStorageLibrary/GlobalUsings.cs: -------------------------------------------------------------------------------- 1 | // This file is part of VirtualStorageLibrary. 2 | // 3 | // Copyright (C) 2024 Akira Shimodate 4 | // 5 | // VirtualStorageLibrary is free software, and it is distributed under the terms of 6 | // the GNU Lesser General Public License (version 3, or at your option, any later 7 | // version). This license is published by the Free Software Foundation. 8 | // 9 | // VirtualStorageLibrary is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or 11 | // FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for 12 | // more details. 13 | // 14 | // You should have received a copy of the GNU Lesser General Public License along 15 | // with VirtualStorageLibrary. If not, see https://www.gnu.org/licenses/. 16 | 17 | global using AkiraNetwork.VirtualStorageLibrary.WildcardMatchers; 18 | global using System.Collections; 19 | global using System.Diagnostics; 20 | global using System.Linq.Expressions; 21 | global using System.Text; 22 | global using System.Text.RegularExpressions; 23 | -------------------------------------------------------------------------------- /licenses/DocFX_Material_LICENSE.txt: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Oscar V叩squez 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /licenses/DocFX_LICENSE.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) .NET Foundation and Contributors 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /coverage.ps1: -------------------------------------------------------------------------------- 1 | # TestResults ディレクトリのパス 2 | $testResultsDir = "/workspace/VirtualStorageLibrary/AkiraNetwork/VirtualStorageLibrary.Test/TestResults" 3 | 4 | # TestResults 内の全てのGUID名ディレクトリを削除 5 | Get-ChildItem -Path $testResultsDir -Directory | 6 | Where-Object { $_.Name -match '^[{(]?[0-9A-F]{8}[-]([0-9A-F]{4}[-]){3}[0-9A-F]{12}[)}]?$' } | 7 | Remove-Item -Recurse -Force 8 | 9 | # dotnet test コマンドの実行 10 | dotnet test --collect:"XPlat Code Coverage" 11 | 12 | # 最新の coverage.cobertura.xml ファイルを検索 13 | $latestCoverageFile = Get-ChildItem -Path $testResultsDir -Recurse -Filter "coverage.cobertura.xml" | 14 | Sort-Object LastWriteTime -Descending | 15 | Select-Object -First 1 16 | 17 | # coverage.cobertura.xml ファイルの作成日時を表示 18 | if ($latestCoverageFile -ne $null) { 19 | Write-Host "Found coverage file: $($latestCoverageFile.FullName)" 20 | Write-Host "Creation time: $($latestCoverageFile.CreationTime)" 21 | 22 | # reportgenerator コマンドの実行 23 | $reportGeneratorCmd = "reportgenerator -reports:`"$($latestCoverageFile.FullName)`" -targetdir:`"coveragereport`" -reporttypes:lcov" 24 | Invoke-Expression $reportGeneratorCmd 25 | } else { 26 | Write-Host "No coverage file found." 27 | } 28 | -------------------------------------------------------------------------------- /docs/logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 8 | Created by Docfx 9 | 10 | 12 | 15 | 21 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /docs/toc.html: -------------------------------------------------------------------------------- 1 | 2 |
3 |
4 |
5 |
6 | 7 | 8 | 9 |
10 |
11 |
12 |
13 | 14 | 31 |
32 |
33 |
34 |
35 | -------------------------------------------------------------------------------- /documents/api/AkiraNetwork.VirtualStorageLibrary.WildcardMatchers.yml: -------------------------------------------------------------------------------- 1 | ### YamlMime:ManagedReference 2 | items: 3 | - uid: AkiraNetwork.VirtualStorageLibrary.WildcardMatchers 4 | commentId: N:AkiraNetwork.VirtualStorageLibrary.WildcardMatchers 5 | id: AkiraNetwork.VirtualStorageLibrary.WildcardMatchers 6 | children: 7 | - AkiraNetwork.VirtualStorageLibrary.WildcardMatchers.DefaultWildcardMatcher 8 | - AkiraNetwork.VirtualStorageLibrary.WildcardMatchers.PowerShellWildcardMatcher 9 | langs: 10 | - csharp 11 | - vb 12 | name: AkiraNetwork.VirtualStorageLibrary.WildcardMatchers 13 | nameWithType: AkiraNetwork.VirtualStorageLibrary.WildcardMatchers 14 | fullName: AkiraNetwork.VirtualStorageLibrary.WildcardMatchers 15 | type: Namespace 16 | assemblies: 17 | - VirtualStorageLibrary 18 | references: 19 | - uid: AkiraNetwork.VirtualStorageLibrary.WildcardMatchers.DefaultWildcardMatcher 20 | commentId: T:AkiraNetwork.VirtualStorageLibrary.WildcardMatchers.DefaultWildcardMatcher 21 | href: AkiraNetwork.VirtualStorageLibrary.WildcardMatchers.DefaultWildcardMatcher.html 22 | name: DefaultWildcardMatcher 23 | nameWithType: DefaultWildcardMatcher 24 | fullName: AkiraNetwork.VirtualStorageLibrary.WildcardMatchers.DefaultWildcardMatcher 25 | - uid: AkiraNetwork.VirtualStorageLibrary.WildcardMatchers.PowerShellWildcardMatcher 26 | commentId: T:AkiraNetwork.VirtualStorageLibrary.WildcardMatchers.PowerShellWildcardMatcher 27 | href: AkiraNetwork.VirtualStorageLibrary.WildcardMatchers.PowerShellWildcardMatcher.html 28 | name: PowerShellWildcardMatcher 29 | nameWithType: PowerShellWildcardMatcher 30 | fullName: AkiraNetwork.VirtualStorageLibrary.WildcardMatchers.PowerShellWildcardMatcher 31 | -------------------------------------------------------------------------------- /COMMERCIAL_LICENSE: -------------------------------------------------------------------------------- 1 | Commercial License for VirtualStorageLibrary 2 | 3 | Thank you for your interest in VirtualStorageLibrary! 4 | 5 | Current License 6 | 7 | VirtualStorageLibrary is currently distributed under the terms of the GNU Lesser General Public License (LGPL) v3.0 or later. This license allows you to use, modify, and distribute the library for both open-source and closed-source projects, as long as the conditions of the LGPL are met. 8 | 9 | Commercial License Option 10 | 11 | We are considering offering a commercial license for VirtualStorageLibrary in the future. A commercial license would provide an alternative to the LGPL and could offer additional benefits, such as: 12 | 13 | - No Copyleft Obligations: Use the library in your proprietary software without the need to disclose your source code. 14 | - Priority Support: Receive faster and more comprehensive support directly from the library developers. 15 | - Custom Licensing Terms: Negotiate specific licensing terms tailored to your organization's needs. 16 | 17 | If you are interested in using VirtualStorageLibrary under a commercial license or have any specific requirements, please contact us at [shimodateakira@i.softbank.jp]. 18 | 19 | Why a Commercial License? 20 | 21 | Offering a commercial license allows us to fund the continued development and maintenance of VirtualStorageLibrary while providing users with more flexibility in how they can use the library. 22 | 23 | Future Updates 24 | 25 | Please note that we may update the terms of this commercial license offer as our project evolves. Keep an eye on this document for any changes or reach out to us for the most up-to-date information. 26 | 27 | Thank you for supporting VirtualStorageLibrary! 28 | -------------------------------------------------------------------------------- /documents/licenses.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "License" 3 | --- 4 | 5 | ![burner.png](images/burner.png) 6 | 7 | # License 8 | 9 | ## VirtualStorageLibrary 10 | 11 | This project is licensed under the 12 | [GNU Lesser General Public License v3.0 or later (LGPL-3.0-or-later)](https://spdx.org/licenses/LGPL-3.0-or-later.html). 13 | 14 | Copyright (C) 2024 Akira Shimodate 15 | 16 | VirtualStorageLibrary is free software. This software is distributed under the terms of the GNU Lesser General 17 | Public License v3.0 or (at your option) any later version. VirtualStorageLibrary is distributed in 18 | the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 20 | A copy of the GNU Lesser General Public License is saved in the LICENSE file at the root of the repository. If 21 | not provided, you can also view it [here](https://www.gnu.org/licenses/lgpl-3.0.txt). 22 | 23 | ### Future Commercial License 24 | We are considering offering a commercial license for VirtualStorageLibrary in the future. For more details or to inquire about the commercial license, please contact us at [akiranetwork211@gmail.com](mailto:akiranetwork211@gmail.com). 25 | 26 | --- 27 | 28 | ## docfx 29 | 30 | This documentation uses DocFX, which is © 2019 Oscar Vásquez. 31 | It is licensed under the MIT License. For more details, please see the 32 | [docfx GitHub repository](https://github.com/dotnet/docfx). 33 | 34 | --- 35 | 36 | ## DocFX Material 37 | 38 | This documentation uses the DocFX Material theme, which is © 2019 Oscar Vázquez. 39 | It is licensed under the MIT License. For more details, please see the 40 | [DocFX Material GitHub repository](https://github.com/ovasquez/docfx-material). 41 | -------------------------------------------------------------------------------- /docs/search-stopwords.json: -------------------------------------------------------------------------------- 1 | [ 2 | "a", 3 | "able", 4 | "about", 5 | "across", 6 | "after", 7 | "all", 8 | "almost", 9 | "also", 10 | "am", 11 | "among", 12 | "an", 13 | "and", 14 | "any", 15 | "are", 16 | "as", 17 | "at", 18 | "be", 19 | "because", 20 | "been", 21 | "but", 22 | "by", 23 | "can", 24 | "cannot", 25 | "could", 26 | "dear", 27 | "did", 28 | "do", 29 | "does", 30 | "either", 31 | "else", 32 | "ever", 33 | "every", 34 | "for", 35 | "from", 36 | "get", 37 | "got", 38 | "had", 39 | "has", 40 | "have", 41 | "he", 42 | "her", 43 | "hers", 44 | "him", 45 | "his", 46 | "how", 47 | "however", 48 | "i", 49 | "if", 50 | "in", 51 | "into", 52 | "is", 53 | "it", 54 | "its", 55 | "just", 56 | "least", 57 | "let", 58 | "like", 59 | "likely", 60 | "may", 61 | "me", 62 | "might", 63 | "most", 64 | "must", 65 | "my", 66 | "neither", 67 | "no", 68 | "nor", 69 | "not", 70 | "of", 71 | "off", 72 | "often", 73 | "on", 74 | "only", 75 | "or", 76 | "other", 77 | "our", 78 | "own", 79 | "rather", 80 | "said", 81 | "say", 82 | "says", 83 | "she", 84 | "should", 85 | "since", 86 | "so", 87 | "some", 88 | "than", 89 | "that", 90 | "the", 91 | "their", 92 | "them", 93 | "then", 94 | "there", 95 | "these", 96 | "they", 97 | "this", 98 | "tis", 99 | "to", 100 | "too", 101 | "twas", 102 | "us", 103 | "wants", 104 | "was", 105 | "we", 106 | "were", 107 | "what", 108 | "when", 109 | "where", 110 | "which", 111 | "while", 112 | "who", 113 | "whom", 114 | "why", 115 | "will", 116 | "with", 117 | "would", 118 | "yet", 119 | "you", 120 | "your" 121 | ] 122 | -------------------------------------------------------------------------------- /AkiraNetwork/VirtualStorageLibrary/VirtualEnums.cs: -------------------------------------------------------------------------------- 1 | // This file is part of VirtualStorageLibrary. 2 | // 3 | // Copyright (C) 2024 Akira Shimodate 4 | // 5 | // VirtualStorageLibrary is free software, and it is distributed under the terms of 6 | // the GNU Lesser General Public License (version 3, or at your option, any later 7 | // version). This license is published by the Free Software Foundation. 8 | // 9 | // VirtualStorageLibrary is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or 11 | // FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for 12 | // more details. 13 | // 14 | // You should have received a copy of the GNU Lesser General Public License along 15 | // with VirtualStorageLibrary. If not, see https://www.gnu.org/licenses/. 16 | 17 | namespace AkiraNetwork.VirtualStorageLibrary 18 | { 19 | /// 20 | /// Specifies the types of virtual nodes. 21 | /// 22 | public enum VirtualNodeType 23 | { 24 | /// Represents a directory node. 25 | Directory = 0, 26 | 27 | /// Represents an item node with a user-defined type T. 28 | Item = 1, 29 | 30 | /// Represents a symbolic link node. 31 | SymbolicLink = 2, 32 | 33 | /// Represents an unspecified or unknown node type. 34 | None = 3 35 | } 36 | 37 | /// 38 | /// Specifies the filters for virtual node types. 39 | /// 40 | public enum VirtualNodeTypeFilter 41 | { 42 | /// No specific node type is specified. 43 | None = 0x00, 44 | 45 | /// Filter for item nodes with a user-defined type T. 46 | Item = 0x01, 47 | 48 | /// Filter for directory nodes. 49 | Directory = 0x02, 50 | 51 | /// Filter for symbolic link nodes. 52 | SymbolicLink = 0x04, 53 | 54 | /// Filter for all node types. 55 | All = Item | Directory | SymbolicLink 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /AkiraNetwork/VirtualStorageLibrary/VirtualID.cs: -------------------------------------------------------------------------------- 1 | // This file is part of VirtualStorageLibrary. 2 | // 3 | // Copyright (C) 2024 Akira Shimodate 4 | // 5 | // VirtualStorageLibrary is free software, and it is distributed under the terms of 6 | // the GNU Lesser General Public License (version 3, or at your option, any later 7 | // version). This license is published by the Free Software Foundation. 8 | // 9 | // VirtualStorageLibrary is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or 11 | // FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for 12 | // more details. 13 | // 14 | // You should have received a copy of the GNU Lesser General Public License along 15 | // with VirtualStorageLibrary. If not, see https://www.gnu.org/licenses/. 16 | 17 | namespace AkiraNetwork.VirtualStorageLibrary 18 | { 19 | /// 20 | /// A structure representing a unique identifier within the virtual storage library. 21 | /// This identifier is based on a randomly generated UUID version 4 (UUIDv4). UUIDv4 22 | /// is a 128-bit value that ensures high uniqueness and has strong cryptographic properties. 23 | /// 24 | public readonly record struct VirtualID 25 | { 26 | private readonly Guid _id; 27 | 28 | /// 29 | /// Gets the unique identifier. 30 | /// 31 | /// 32 | /// A value representing the unique identifier. 33 | /// 34 | public Guid ID => _id; 35 | 36 | /// 37 | /// Returns a string representation of this instance's unique identifier. 38 | /// 39 | /// A string that represents the unique identifier. 40 | public override string ToString() => _id.ToString(); 41 | 42 | /// 43 | /// Initializes a new instance of the structure, 44 | /// generating a unique identifier. 45 | /// 46 | public VirtualID() 47 | { 48 | _id = Guid.NewGuid(); 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /documents/api/AkiraNetwork.VirtualStorageLibrary.Utilities.yml: -------------------------------------------------------------------------------- 1 | ### YamlMime:ManagedReference 2 | items: 3 | - uid: AkiraNetwork.VirtualStorageLibrary.Utilities 4 | commentId: N:AkiraNetwork.VirtualStorageLibrary.Utilities 5 | id: AkiraNetwork.VirtualStorageLibrary.Utilities 6 | children: 7 | - AkiraNetwork.VirtualStorageLibrary.Utilities.VirtualTextFormatter 8 | langs: 9 | - csharp 10 | - vb 11 | name: AkiraNetwork.VirtualStorageLibrary.Utilities 12 | nameWithType: AkiraNetwork.VirtualStorageLibrary.Utilities 13 | fullName: AkiraNetwork.VirtualStorageLibrary.Utilities 14 | type: Namespace 15 | assemblies: 16 | - VirtualStorageLibrary 17 | references: 18 | - uid: AkiraNetwork.VirtualStorageLibrary.Utilities.VirtualTextFormatter 19 | commentId: T:AkiraNetwork.VirtualStorageLibrary.Utilities.VirtualTextFormatter 20 | parent: AkiraNetwork.VirtualStorageLibrary.Utilities 21 | href: AkiraNetwork.VirtualStorageLibrary.Utilities.VirtualTextFormatter.html 22 | name: VirtualTextFormatter 23 | nameWithType: VirtualTextFormatter 24 | fullName: AkiraNetwork.VirtualStorageLibrary.Utilities.VirtualTextFormatter 25 | - uid: AkiraNetwork.VirtualStorageLibrary.Utilities 26 | commentId: N:AkiraNetwork.VirtualStorageLibrary.Utilities 27 | href: AkiraNetwork.html 28 | name: AkiraNetwork.VirtualStorageLibrary.Utilities 29 | nameWithType: AkiraNetwork.VirtualStorageLibrary.Utilities 30 | fullName: AkiraNetwork.VirtualStorageLibrary.Utilities 31 | spec.csharp: 32 | - uid: AkiraNetwork 33 | name: AkiraNetwork 34 | href: AkiraNetwork.html 35 | - name: . 36 | - uid: AkiraNetwork.VirtualStorageLibrary 37 | name: VirtualStorageLibrary 38 | href: AkiraNetwork.VirtualStorageLibrary.html 39 | - name: . 40 | - uid: AkiraNetwork.VirtualStorageLibrary.Utilities 41 | name: Utilities 42 | href: AkiraNetwork.VirtualStorageLibrary.Utilities.html 43 | spec.vb: 44 | - uid: AkiraNetwork 45 | name: AkiraNetwork 46 | href: AkiraNetwork.html 47 | - name: . 48 | - uid: AkiraNetwork.VirtualStorageLibrary 49 | name: VirtualStorageLibrary 50 | href: AkiraNetwork.VirtualStorageLibrary.html 51 | - name: . 52 | - uid: AkiraNetwork.VirtualStorageLibrary.Utilities 53 | name: Utilities 54 | href: AkiraNetwork.VirtualStorageLibrary.Utilities.html 55 | -------------------------------------------------------------------------------- /AkiraNetwork/VirtualStorageLibrary/VirtualDelegates.cs: -------------------------------------------------------------------------------- 1 | // This file is part of VirtualStorageLibrary. 2 | // 3 | // Copyright (C) 2024 Akira Shimodate 4 | // 5 | // VirtualStorageLibrary is free software, and it is distributed under the terms of 6 | // the GNU Lesser General Public License (version 3, or at your option, any later 7 | // version). This license is published by the Free Software Foundation. 8 | // 9 | // VirtualStorageLibrary is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or 11 | // FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for 12 | // more details. 13 | // 14 | // You should have received a copy of the GNU Lesser General Public License along 15 | // with VirtualStorageLibrary. If not, see https://www.gnu.org/licenses/. 16 | 17 | namespace AkiraNetwork.VirtualStorageLibrary 18 | { 19 | /// 20 | /// A delegate used to notify the status of a specific node during node traversal. 21 | /// 22 | /// The virtual path of the node being notified. 23 | /// The instance of the node being notified. 24 | public delegate void NotifyNodeDelegate(VirtualPath path, VirtualNode? node); 25 | 26 | /// 27 | /// A delegate used to perform an action on a specific node during node traversal. 28 | /// 29 | /// The parent directory of the target node. 30 | /// The name of the target node. 31 | /// The path of the target node. 32 | /// 33 | /// Returns true to continue node traversal, or false to stop node traversal. 34 | /// 35 | public delegate bool ActionNodeDelegate(VirtualDirectory parentDirectory, VirtualNodeName nodeName, VirtualPath nodePath); 36 | 37 | /// 38 | /// A delegate used to determine if a node name matches a pattern. 39 | /// 40 | /// The name of the node to be matched. 41 | /// The pattern to match against. 42 | /// True if the node name matches the pattern; otherwise, false. 43 | public delegate bool PatternMatch(string nodeName, string pattern); 44 | } 45 | -------------------------------------------------------------------------------- /AkiraNetwork/VirtualStorageLibrary.Test/VirtualIDTests.cs: -------------------------------------------------------------------------------- 1 | // This file is part of VirtualStorageLibrary. 2 | // 3 | // Copyright (C) 2024 Akira Shimodate 4 | // 5 | // VirtualStorageLibrary is free software, and it is distributed under the terms of 6 | // the GNU Lesser General Public License (version 3, or at your option, any later 7 | // version). This license is published by the Free Software Foundation. 8 | // 9 | // VirtualStorageLibrary is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or 11 | // FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for 12 | // more details. 13 | // 14 | // You should have received a copy of the GNU Lesser General Public License along 15 | // with VirtualStorageLibrary. If not, see https://www.gnu.org/licenses/. 16 | 17 | using System.Globalization; 18 | 19 | namespace AkiraNetwork.VirtualStorageLibrary.Test 20 | { 21 | [TestClass] 22 | public class VirtualIDTests : VirtualTestBase 23 | { 24 | private const int GuidCount = 10000; 25 | 26 | [TestInitialize] 27 | public override void TestInitialize() 28 | { 29 | base.TestInitialize(); 30 | 31 | Thread.CurrentThread.CurrentUICulture = CultureInfo.InvariantCulture; 32 | 33 | VirtualStorageSettings.Initialize(); 34 | VirtualNodeName.ResetCounter(); 35 | } 36 | 37 | [TestMethod] 38 | public void VirtualID_ShouldReturnValidGuid() 39 | { 40 | // Act 41 | VirtualID vID = new(); 42 | Guid guid = vID.ID; 43 | 44 | // Assert 45 | Assert.AreNotEqual(Guid.Empty, guid); 46 | } 47 | 48 | [TestMethod] 49 | public void VirtualID_ShouldReturnUniqueGuids() 50 | { 51 | // Arrange 52 | HashSet guidSet = []; 53 | 54 | // Act 55 | for (int i = 0; i < GuidCount; i++) 56 | { 57 | VirtualID vID = new(); 58 | Guid newGuid = vID.ID; 59 | bool isAdded = guidSet.Add(newGuid); 60 | 61 | // Assert 62 | Assert.IsTrue(isAdded, $"Duplicate GUID found: {newGuid}"); 63 | } 64 | 65 | // Final Assert 66 | Assert.AreEqual(GuidCount, guidSet.Count); 67 | } 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /AkiraNetwork/VirtualStorageLibrary/VS.Indexer.cs: -------------------------------------------------------------------------------- 1 | // This file is part of VirtualStorageLibrary. 2 | // 3 | // Copyright (C) 2024 Akira Shimodate 4 | // 5 | // VirtualStorageLibrary is free software, and it is distributed under the terms of 6 | // the GNU Lesser General Public License (version 3, or at your option, any later 7 | // version). This license is published by the Free Software Foundation. 8 | // 9 | // VirtualStorageLibrary is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or 11 | // FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for 12 | // more details. 13 | // 14 | // You should have received a copy of the GNU Lesser General Public License along 15 | // with VirtualStorageLibrary. If not, see https://www.gnu.org/licenses/. 16 | 17 | using System.Runtime.CompilerServices; 18 | using AkiraNetwork.VirtualStorageLibrary.Localization; 19 | 20 | namespace AkiraNetwork.VirtualStorageLibrary 21 | { 22 | public partial class VirtualStorage 23 | { 24 | /// 25 | /// Gets or sets the virtual node corresponding to the specified virtual path. 26 | /// 27 | /// The virtual path 28 | /// Flag indicating whether to follow symbolic links 29 | /// The virtual node corresponding to the specified virtual path 30 | [IndexerName("Indexer")] 31 | public VirtualDirectory this[VirtualPath path, bool followLinks = true] 32 | { 33 | get 34 | { 35 | VirtualNode node = GetNode(path, followLinks); 36 | if (node is VirtualDirectory directory) 37 | { 38 | return directory; 39 | } 40 | else 41 | { 42 | throw new InvalidOperationException(string.Format(Resources.NodeIsNotVirtualDirectory, node.Name)); 43 | } 44 | } 45 | 46 | set 47 | { 48 | // Compare the node ID of the target with the source. 49 | if (GetNodeID(path) != value.VID) 50 | { 51 | // If they are different, set it. 52 | SetNode(path, value); 53 | } 54 | } 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /AkiraNetwork/VirtualStorageLibrary/VirtualSortCondition.cs: -------------------------------------------------------------------------------- 1 | // This file is part of VirtualStorageLibrary. 2 | // 3 | // Copyright (C) 2024 Akira Shimodate 4 | // 5 | // VirtualStorageLibrary is free software, and it is distributed under the terms of 6 | // the GNU Lesser General Public License (version 3, or at your option, any later 7 | // version). This license is published by the Free Software Foundation. 8 | // 9 | // VirtualStorageLibrary is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or 11 | // FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for 12 | // more details. 13 | // 14 | // You should have received a copy of the GNU Lesser General Public License along 15 | // with VirtualStorageLibrary. If not, see https://www.gnu.org/licenses/. 16 | 17 | namespace AkiraNetwork.VirtualStorageLibrary 18 | { 19 | /// 20 | /// Represents the conditions for sorting data, holding the property to sort by and the order (ascending or descending). 21 | /// 22 | /// The type of the entity to be sorted. 23 | public class VirtualSortCondition 24 | { 25 | /// 26 | /// Initializes a new instance of the class with the specified sorting property and order. 27 | /// 28 | /// The property to sort by. 29 | /// A value indicating whether the sorting order is ascending. 30 | public VirtualSortCondition(Expression> sortBy, bool ascending = true) 31 | { 32 | SortBy = sortBy; 33 | Ascending = ascending; 34 | } 35 | 36 | /// 37 | /// Gets or sets the property used for sorting. 38 | /// 39 | /// 40 | /// An expression that specifies the property to use for sorting. 41 | /// 42 | public Expression> SortBy { get; set; } 43 | 44 | /// 45 | /// Gets or sets a value indicating whether the sorting order is ascending. 46 | /// True if the order is ascending; otherwise, false. 47 | /// 48 | /// 49 | /// A boolean value indicating whether the sorting order is ascending. 50 | /// 51 | public bool Ascending { get; set; } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /AkiraNetwork/VirtualStorageLibrary/VirtualGroupCondition.cs: -------------------------------------------------------------------------------- 1 | // This file is part of VirtualStorageLibrary. 2 | // 3 | // Copyright (C) 2024 Akira Shimodate 4 | // 5 | // VirtualStorageLibrary is free software, and it is distributed under the terms of 6 | // the GNU Lesser General Public License (version 3, or at your option, any later 7 | // version). This license is published by the Free Software Foundation. 8 | // 9 | // VirtualStorageLibrary is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or 11 | // FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for 12 | // more details. 13 | // 14 | // You should have received a copy of the GNU Lesser General Public License along 15 | // with VirtualStorageLibrary. If not, see https://www.gnu.org/licenses/. 16 | 17 | namespace AkiraNetwork.VirtualStorageLibrary 18 | { 19 | /// 20 | /// Represents the conditions for grouping data, holding the property to group by and the order (ascending or descending). 21 | /// 22 | /// The type of the entity to be grouped. 23 | /// The type of the key used for grouping. 24 | public class VirtualGroupCondition 25 | { 26 | /// 27 | /// Initializes a new instance of the class with the specified grouping property and order. 28 | /// 29 | /// The property to group by. 30 | /// A value indicating whether the grouping order is ascending. 31 | public VirtualGroupCondition(Expression> groupBy, bool ascending = true) 32 | { 33 | GroupBy = groupBy; 34 | Ascending = ascending; 35 | } 36 | 37 | /// 38 | /// Gets or sets the property used for grouping. 39 | /// 40 | /// 41 | /// An expression that specifies the property to use for grouping. 42 | /// 43 | public Expression> GroupBy { get; set; } 44 | 45 | /// 46 | /// Gets or sets a value indicating whether the grouping order is ascending. 47 | /// True if the order is ascending; otherwise, false. 48 | /// 49 | /// 50 | /// A boolean value indicating whether the grouping order is ascending. 51 | /// 52 | public bool Ascending { get; set; } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /AkiraNetwork/VirtualStorageLibrary.Test/VirtualCycleDetectorTests.cs: -------------------------------------------------------------------------------- 1 | // This file is part of VirtualStorageLibrary. 2 | // 3 | // Copyright (C) 2024 Akira Shimodate 4 | // 5 | // VirtualStorageLibrary is free software, and it is distributed under the terms of 6 | // the GNU Lesser General Public License (version 3, or at your option, any later 7 | // version). This license is published by the Free Software Foundation. 8 | // 9 | // VirtualStorageLibrary is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or 11 | // FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for 12 | // more details. 13 | // 14 | // You should have received a copy of the GNU Lesser General Public License along 15 | // with VirtualStorageLibrary. If not, see https://www.gnu.org/licenses/. 16 | 17 | using System.Globalization; 18 | 19 | namespace AkiraNetwork.VirtualStorageLibrary.Test 20 | { 21 | [TestClass] 22 | public class VirtualCycleDetectorTests : VirtualTestBase 23 | { 24 | [TestInitialize] 25 | public override void TestInitialize() 26 | { 27 | base.TestInitialize(); 28 | 29 | Thread.CurrentThread.CurrentUICulture = CultureInfo.InvariantCulture; 30 | 31 | VirtualStorageSettings.Initialize(); 32 | VirtualNodeName.ResetCounter(); 33 | 34 | } 35 | 36 | [TestMethod] 37 | public void IsNodeInCycle_NodeNotInCycle_ReturnsFalseAndAddsNode() 38 | { 39 | // Arrange 40 | VirtualCycleDetector detector = new(); 41 | VirtualSymbolicLink link = new("link"); 42 | 43 | // Act 44 | bool result = detector.IsNodeInCycle(link); 45 | 46 | // Assert 47 | Assert.IsFalse(result); 48 | Assert.IsTrue(detector.CycleDictionary.ContainsKey(link.VID)); 49 | } 50 | 51 | [TestMethod] 52 | public void IsNodeInCycle_NodeInCycle_ReturnsTrue() 53 | { 54 | // Arrange 55 | VirtualCycleDetector detector = new(); 56 | VirtualSymbolicLink link = new("link"); 57 | detector.IsNodeInCycle(link); 58 | 59 | // Act 60 | bool result = detector.IsNodeInCycle(link); 61 | 62 | // Assert 63 | Assert.IsTrue(result); 64 | } 65 | 66 | [TestMethod] 67 | public void Clear_RemovesAllNodes() 68 | { 69 | // Arrange 70 | VirtualCycleDetector detector = new(); 71 | VirtualSymbolicLink link = new("link"); 72 | detector.IsNodeInCycle(link); 73 | 74 | // Act 75 | detector.Clear(); 76 | 77 | // Assert 78 | Assert.AreEqual(0, detector.Count); 79 | } 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /AkiraNetwork/VirtualStorageLibrary.Test/VirtualTestBase.cs: -------------------------------------------------------------------------------- 1 | // This file is part of VirtualStorageLibrary. 2 | // 3 | // Copyright (C) 2024 Akira Shimodate 4 | // 5 | // VirtualStorageLibrary is free software, and it is distributed under the terms of 6 | // the GNU Lesser General Public License (version 3, or at your option, any later 7 | // version). This license is published by the Free Software Foundation. 8 | // 9 | // VirtualStorageLibrary is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or 11 | // FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for 12 | // more details. 13 | // 14 | // You should have received a copy of the GNU Lesser General Public License along 15 | // with VirtualStorageLibrary. If not, see https://www.gnu.org/licenses/. 16 | 17 | using System.Diagnostics; 18 | 19 | namespace AkiraNetwork.VirtualStorageLibrary.Test 20 | { 21 | [TestClass] 22 | public class VirtualTestBase 23 | { 24 | private static TextWriter? originalOutput; 25 | private static StreamWriter? logWriter; 26 | private static string? logDirectory; 27 | private static string? logFilePath; 28 | public TestContext? TestContext { get; set; } 29 | 30 | [AssemblyInitialize] 31 | public static void AssemblyInit(TestContext context) 32 | { 33 | // ログディレクトリを設定 34 | logDirectory = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "TestLog"); 35 | if (!Directory.Exists(logDirectory)) 36 | { 37 | Directory.CreateDirectory(logDirectory); 38 | } 39 | 40 | // 日時を含むログファイル名を設定 41 | string timestamp = DateTime.Now.ToString("yyyyMMdd-HHmmss"); 42 | logFilePath = Path.Combine(logDirectory, $"TestLog-{timestamp}.txt"); 43 | 44 | // 元の出力を保存 45 | originalOutput = Console.Out; 46 | 47 | // ログファイルを作成 48 | logWriter = new(logFilePath) 49 | { 50 | AutoFlush = true 51 | }; 52 | 53 | // 標準出力と標準エラー出力をリダイレクト 54 | Console.SetOut(logWriter); 55 | Console.SetError(logWriter); 56 | 57 | // Debugの出力もリダイレクト 58 | Trace.Listeners.Add(new TextWriterTraceListener(logWriter)); 59 | } 60 | 61 | [AssemblyCleanup] 62 | public static void AssemblyCleanup() 63 | { 64 | // 元の出力がnullでない場合のみ戻す 65 | if (originalOutput != null) 66 | { 67 | Console.SetOut(originalOutput); 68 | Console.SetError(originalOutput); 69 | } 70 | 71 | // Debugのリスナーをクリア 72 | Trace.Listeners.Clear(); 73 | 74 | // ログファイルがnullでない場合のみ閉じる 75 | logWriter?.Close(); 76 | } 77 | 78 | [TestInitialize] 79 | public virtual void TestInitialize() 80 | { 81 | // テストメソッド名をデバッグ出力 82 | Debug.WriteLine($"\n\n{TestContext?.TestName}() :"); 83 | } 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /AkiraNetwork/VirtualStorageLibrary/VirtualStorage.cs: -------------------------------------------------------------------------------- 1 | // This file is part of VirtualStorageLibrary. 2 | // 3 | // Copyright (C) 2024 Akira Shimodate 4 | // 5 | // VirtualStorageLibrary is free software, and it is distributed under the terms of 6 | // the GNU Lesser General Public License (version 3, or at your option, any later 7 | // version). This license is published by the Free Software Foundation. 8 | // 9 | // VirtualStorageLibrary is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or 11 | // FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for 12 | // more details. 13 | // 14 | // You should have received a copy of the GNU Lesser General Public License along 15 | // with VirtualStorageLibrary. If not, see https://www.gnu.org/licenses/. 16 | 17 | namespace AkiraNetwork.VirtualStorageLibrary 18 | { 19 | /// 20 | /// Manages virtual storage containing user-defined type T item data. 21 | /// 22 | /// The user-defined type within the virtual storage 23 | public partial class VirtualStorage 24 | { 25 | private readonly VirtualDirectory _root; 26 | 27 | /// 28 | /// Gets the root directory of the virtual storage. 29 | /// 30 | /// The root directory of the virtual storage 31 | public VirtualDirectory Root => _root; 32 | 33 | /// 34 | /// Gets or sets the current virtual path. 35 | /// 36 | /// The current virtual path 37 | public VirtualPath CurrentPath { get; private set; } 38 | 39 | /// 40 | /// Gets the cycle detector class used for the WalkPathToTarget method. 41 | /// 42 | /// An instance of the cycle detector class 43 | public VirtualCycleDetector CycleDetectorForTarget { get; } = new(); 44 | 45 | /// 46 | /// Gets the cycle detector class used for the WalkPathTree method. 47 | /// 48 | /// An instance of the cycle detector class 49 | public VirtualCycleDetector CycleDetectorForTree { get; } = new(); 50 | 51 | /// 52 | /// Gets the adapter providing operations for virtual items. 53 | /// 54 | /// An instance of 55 | public VirtualItemAdapter Item { get; } 56 | 57 | /// 58 | /// Gets the adapter providing operations for virtual symbolic links. 59 | /// 60 | /// An instance of 61 | public VirtualSymbolicLinkAdapter Link { get; } 62 | 63 | /// 64 | /// Initializes a new instance of the VirtualStorage class. 65 | /// 66 | public VirtualStorage() 67 | { 68 | _root = new(VirtualPath.Root) 69 | { 70 | IsReferencedInStorage = true 71 | }; 72 | 73 | CurrentPath = VirtualPath.Root; 74 | 75 | _linkDictionary = []; 76 | 77 | Item = new(this); 78 | Link = new(this); 79 | } 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /AkiraNetwork/VirtualStorageLibrary/VirtualCycleDetector.cs: -------------------------------------------------------------------------------- 1 | // This file is part of VirtualStorageLibrary. 2 | // 3 | // Copyright (C) 2024 Akira Shimodate 4 | // 5 | // VirtualStorageLibrary is free software, and it is distributed under the terms of 6 | // the GNU Lesser General Public License (version 3, or at your option, any later 7 | // version). This license is published by the Free Software Foundation. 8 | // 9 | // VirtualStorageLibrary is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or 11 | // FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for 12 | // more details. 13 | // 14 | // You should have received a copy of the GNU Lesser General Public License along 15 | // with VirtualStorageLibrary. If not, see https://www.gnu.org/licenses/. 16 | 17 | namespace AkiraNetwork.VirtualStorageLibrary 18 | { 19 | /// 20 | /// Class for detecting cycles in virtual symbolic links. 21 | /// Determines if a given link is part of a cycle. 22 | /// 23 | public class VirtualCycleDetector 24 | { 25 | /// 26 | /// Dictionary of detected cycles. The keys are s, and the values are the 27 | /// corresponding s. 28 | /// 29 | private readonly Dictionary _cycleDictionary; 30 | 31 | /// 32 | /// Gets the dictionary of detected cycles. 33 | /// 34 | /// 35 | /// A dictionary where the keys are s and the values are the corresponding 36 | /// s. 37 | /// 38 | public Dictionary CycleDictionary => _cycleDictionary; 39 | 40 | /// 41 | /// Gets the number of detected cycles. 42 | /// 43 | /// 44 | /// The number of detected cycles. 45 | /// 46 | public int Count => _cycleDictionary.Count; 47 | 48 | /// 49 | /// Initializes a new instance of the class. 50 | /// 51 | public VirtualCycleDetector() 52 | { 53 | _cycleDictionary = []; 54 | } 55 | 56 | /// 57 | /// Clears the dictionary of detected cycles. 58 | /// 59 | public void Clear() 60 | { 61 | _cycleDictionary.Clear(); 62 | } 63 | 64 | /// 65 | /// Determines whether the specified is part of a cycle. 66 | /// 67 | /// The to check. 68 | /// True if the link is part of a cycle; otherwise, false. 69 | public bool IsNodeInCycle(VirtualSymbolicLink link) 70 | { 71 | if (_cycleDictionary.ContainsKey(link.VID)) 72 | { 73 | // A cycle has been detected 74 | return true; 75 | } 76 | 77 | _cycleDictionary.Add(link.VID, link); 78 | 79 | // No cycle detected 80 | return false; 81 | } 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /documents/index.ja.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "HOMEPAGE" 3 | _layout: landing 4 | --- 5 | 6 | ![burner.png](images/burner.png) 7 | 8 |
9 | Language: Japanese 10 | 14 |
15 | 16 | # **VirtualStorageLibrary へようこそ!** 17 | 18 | --- 19 | 20 | ## **.NET開発者の為のツリー構造コレクション** 21 | 22 | `VirtualStorageLibrary`は、完全にオンメモリで動作し、**ツリー構造コレクション**を提供する.NETライブラリです。 23 | このライブラリは、**データの階層的な構造を管理するための基盤**を提供し、**ユーザー定義型**`T`を内包するアイテム、ディレクトリ、シンボリックリンクをサポートします。 24 | このライブラリは**ファイルシステムではありません。** 25 | 従来のファイルシステムの概念を参考にしつつ、より柔軟で使いやすいツリー構造を実現するために**ゼロから再設計**しました。 26 | このライブラリは、ユーザーが**パスの指定による**ノードの参照、探索、操作を **直感的** に行えるようにすることを目的としています。 27 | 28 | ![tree_256x256.svg](images/tree_256x256.svg) 29 | 30 | ## 主な機能 31 | 32 | ### 柔軟なツリー構造 33 | 34 | 親子関係に基づく階層的なデータ構造を提供し、柔軟なノード管理が可能です。 35 | 36 | ![index_tree1.png](images/index_tree1.png) 37 | 38 | ### 多様なノードのサポート 39 | 40 | ユーザー定義型`T`を含むアイテム、ディレクトリ、シンボリックリンクをサポートします。 41 | 42 | アイテムはジェネリック型であり、`T`はアイテムが内包するユーザー定義型`T`を表しています。 43 | 44 | リンクは一般的なシンボリックリンクに似た機能を備えており、リンク先のターゲットパスを内包しています。 45 | 46 | ![index_tree2.png](images/index_tree2.png) 47 | 48 | ### パスによる直感的なノード操作 49 | 50 | パスを指定することでノードの参照、探索、追加、削除、変名、コピーおよび、移動が容易に行え、使いやすいAPIを提供します。 51 | 52 | - フルパス指定 53 | "/dir1/item1" 54 | 55 | - 相対指定 56 | "item1" 57 | 58 | - 相対指定(ドット) 59 | "./item" 60 | 61 | - 相対指定(ドットドット) 62 | "../item" 63 | 64 | ### リンク管理 65 | 66 | 一般のファイルシステムと同じようにシンボリックリンクを備えています。 67 | 存在していないノードをターゲットパスとして指定しシンボリックリンクを作成する事も可能です。また、ターゲーットパスとして`null`を指定する事も可能です。この様なシンボリックリンクを`VirtualStorageLibrary`では`nullリンク`と呼んでいます。 68 | パス探索時、リンク解決が指定された状態でターゲットパスが存在していない場合は例外がスローされます。また、`nullリンク`の場合は、リンク解決が指定されていても解決は行いません(例外はスローされません)。 69 | 70 | ![index_tree3.png](images/index_tree3.png) 71 | 72 | リンク辞書を使ったシンボリックリンクの変更を管理し、ターゲットパスの変更を追跡します。 73 | 74 | ![index_tree4.png](images/index_tree4.png) 75 | 76 | ### 循環参照防止 77 | 78 | シンボリックリンクを含んだパスを探索時、ディレクトリを循環参照するような構造を検出した場合、例外をスローします。`VirtualStorageLibrary`では、循環参照チェック用辞書にパスを解決した際のリンク情報のみを記録していく方式を採用しています。 79 | 循環参照するリンクを作成する事は可能です。 80 | 81 | ![index_tree5.png](images/index_tree5.png) 82 | 83 | パス探索時、1回目のパス解決で辞書にリンク情報を登録します。2回目のパス解決で辞書にリンク情報があるか確認し、あれば循環参照と判断します。 84 | 85 | ### 柔軟なノードリストの取得 86 | 87 | ディレクトリ内のノードのリストを取得する際、指定されたノードタイプでフィルタ、グルーピングし、指定されたプロパティでソートした結果を取得することができます。 88 | 89 | - デフォルト: ノードタイプでグルーピングされ、名前でソートされます。 90 | 91 | ![index_tree6A.png](images/index_tree6A.png) 92 | 93 | - フィルタリング: 特定のノードタイプだけを取得する事ができます。 94 | 95 | ![index_tree6B.png](images/index_tree6B.png) 96 | 97 | - ソート: 特定のプロパティでソートし取得する事ができます。 98 | 99 | ![index_tree6C.png](images/index_tree6C.png) 100 | 101 | ## ドキュメント 102 | 103 | このライブラリの詳細な使用方法やリファレンスについては、以下のドキュメントを参照してください。 104 | 105 | - [Introduction](introduction.md) 106 | ライブラリの概要と設計思想を説明しています。 107 | どのような目的で開発されたのか、その基本的な機能と特徴を紹介します。 108 | 新しいユーザーがライブラリの全体像を把握するための入門ガイドです。 109 | 110 | - [Getting Started](getting-started.md) 111 | ライブラリを使い始めるためのステップバイステップガイドです。 112 | インストール方法から初期設定、簡単なサンプルコードまで、ライブラリを導入するために必要な基本的な手順を説明します。 113 | 114 | - [APIリファレンス](xref:AkiraNetwork.VirtualStorageLibrary) 115 | ライブラリに含まれる全てのクラス、メソッド、およびプロパティについての詳細な情報を提供しています。 116 | 各メンバーの使用方法やパラメータについての説明が含まれており、ライブラリの具体的な使い方を確認するのに役立ちます。 117 | 118 | - チュートリアル (執筆予定) 119 | 実際のユースケースに基づいた詳細な使用例を提供し、ライブラリの応用的な使い方を学ぶためのガイドです。今後追加予定です。 120 | 121 | - [ライセンス](licenses.md) 122 | このライブラリのライセンスと使用しているライブラリ、ツール、CSS等のライセンスについて情報を提供しています。 123 | 124 | ## リポジトリ 125 | 126 | [VirtualStorageLibrary GitHub](https://github.com/AkiraNetwork/VirtualStorageLibrary) 127 | -------------------------------------------------------------------------------- /AkiraNetwork/VirtualStorageLibrary/VirtualNodeListConditions.cs: -------------------------------------------------------------------------------- 1 | // This file is part of VirtualStorageLibrary. 2 | // 3 | // Copyright (C) 2024 Akira Shimodate 4 | // 5 | // VirtualStorageLibrary is free software, and it is distributed under the terms of 6 | // the GNU Lesser General Public License (version 3, or at your option, any later 7 | // version). This license is published by the Free Software Foundation. 8 | // 9 | // VirtualStorageLibrary is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or 11 | // FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for 12 | // more details. 13 | // 14 | // You should have received a copy of the GNU Lesser General Public License along 15 | // with VirtualStorageLibrary. If not, see https://www.gnu.org/licenses/. 16 | 17 | namespace AkiraNetwork.VirtualStorageLibrary 18 | { 19 | /// 20 | /// Represents the conditions for creating a list of virtual nodes. 21 | /// 22 | public struct VirtualNodeListConditions 23 | { 24 | /// 25 | /// Specifies the filter criteria, determining which types of virtual nodes 26 | /// to include. 27 | /// 28 | /// 29 | /// The filter specifying the types of virtual nodes. The default value is 30 | /// . 31 | /// 32 | public VirtualNodeTypeFilter Filter { get; set; } 33 | 34 | /// 35 | /// Specifies the grouping condition, determining how to group the virtual 36 | /// nodes. 37 | /// 38 | /// 39 | /// The condition for grouping virtual nodes. The default value is null. 40 | /// You can specify null if no grouping condition is needed. 41 | /// 42 | public VirtualGroupCondition? GroupCondition { get; set; } 43 | 44 | /// 45 | /// Specifies the sorting conditions, determining the order in which the 46 | /// virtual nodes are arranged. 47 | /// 48 | /// 49 | /// A list of conditions for sorting the virtual nodes. The default value is 50 | /// null. You can specify null if no sorting condition is needed. 51 | /// 52 | public List>? SortConditions { get; set; } 53 | 54 | /// 55 | /// Initializes a new instance of the 56 | /// class with default conditions. 57 | /// 58 | public VirtualNodeListConditions() 59 | { 60 | Filter = VirtualNodeTypeFilter.All; 61 | GroupCondition = null; 62 | SortConditions = null; 63 | } 64 | 65 | /// 66 | /// Initializes a new instance of the 67 | /// class with the specified conditions. 68 | /// 69 | /// The filter criteria for the virtual nodes. 70 | /// The grouping condition for the virtual 71 | /// nodes. 72 | /// The sorting conditions for the virtual 73 | /// nodes. 74 | public VirtualNodeListConditions(VirtualNodeTypeFilter filter, 75 | VirtualGroupCondition? groupCondition, 76 | List>? sortConditions) 77 | { 78 | Filter = filter; 79 | GroupCondition = groupCondition; 80 | SortConditions = sortConditions; 81 | } 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /documents/api/toc.yml: -------------------------------------------------------------------------------- 1 | ### YamlMime:TableOfContent 2 | items: 3 | - uid: AkiraNetwork.VirtualStorageLibrary 4 | name: AkiraNetwork.VirtualStorageLibrary 5 | items: 6 | - uid: AkiraNetwork.VirtualStorageLibrary.ActionNodeDelegate 7 | name: ActionNodeDelegate 8 | - uid: AkiraNetwork.VirtualStorageLibrary.IVirtualDeepCloneable`1 9 | name: IVirtualDeepCloneable 10 | - uid: AkiraNetwork.VirtualStorageLibrary.IVirtualWildcardMatcher 11 | name: IVirtualWildcardMatcher 12 | - uid: AkiraNetwork.VirtualStorageLibrary.NotifyNodeDelegate 13 | name: NotifyNodeDelegate 14 | - uid: AkiraNetwork.VirtualStorageLibrary.PatternMatch 15 | name: PatternMatch 16 | - uid: AkiraNetwork.VirtualStorageLibrary.VirtualCycleDetector 17 | name: VirtualCycleDetector 18 | - uid: AkiraNetwork.VirtualStorageLibrary.VirtualDirectory 19 | name: VirtualDirectory 20 | - uid: AkiraNetwork.VirtualStorageLibrary.VirtualException 21 | name: VirtualException 22 | - uid: AkiraNetwork.VirtualStorageLibrary.VirtualGroupCondition`2 23 | name: VirtualGroupCondition 24 | - uid: AkiraNetwork.VirtualStorageLibrary.VirtualID 25 | name: VirtualID 26 | - uid: AkiraNetwork.VirtualStorageLibrary.VirtualItem 27 | name: VirtualItem 28 | - uid: AkiraNetwork.VirtualStorageLibrary.VirtualItemAdapter`1 29 | name: VirtualItemAdapter 30 | - uid: AkiraNetwork.VirtualStorageLibrary.VirtualItem`1 31 | name: VirtualItem 32 | - uid: AkiraNetwork.VirtualStorageLibrary.VirtualNode 33 | name: VirtualNode 34 | - uid: AkiraNetwork.VirtualStorageLibrary.VirtualNodeContext 35 | name: VirtualNodeContext 36 | - uid: AkiraNetwork.VirtualStorageLibrary.VirtualNodeExtensions 37 | name: VirtualNodeExtensions 38 | - uid: AkiraNetwork.VirtualStorageLibrary.VirtualNodeListConditions 39 | name: VirtualNodeListConditions 40 | - uid: AkiraNetwork.VirtualStorageLibrary.VirtualNodeName 41 | name: VirtualNodeName 42 | - uid: AkiraNetwork.VirtualStorageLibrary.VirtualNodeNotFoundException 43 | name: VirtualNodeNotFoundException 44 | - uid: AkiraNetwork.VirtualStorageLibrary.VirtualNodeType 45 | name: VirtualNodeType 46 | - uid: AkiraNetwork.VirtualStorageLibrary.VirtualNodeTypeFilter 47 | name: VirtualNodeTypeFilter 48 | - uid: AkiraNetwork.VirtualStorageLibrary.VirtualNotFoundException 49 | name: VirtualNotFoundException 50 | - uid: AkiraNetwork.VirtualStorageLibrary.VirtualPath 51 | name: VirtualPath 52 | - uid: AkiraNetwork.VirtualStorageLibrary.VirtualPathNotFoundException 53 | name: VirtualPathNotFoundException 54 | - uid: AkiraNetwork.VirtualStorageLibrary.VirtualSortCondition`1 55 | name: VirtualSortCondition 56 | - uid: AkiraNetwork.VirtualStorageLibrary.VirtualStorageExtensions 57 | name: VirtualStorageExtensions 58 | - uid: AkiraNetwork.VirtualStorageLibrary.VirtualStorageSettings 59 | name: VirtualStorageSettings 60 | - uid: AkiraNetwork.VirtualStorageLibrary.VirtualStorageState 61 | name: VirtualStorageState 62 | - uid: AkiraNetwork.VirtualStorageLibrary.VirtualStorage`1 63 | name: VirtualStorage 64 | - uid: AkiraNetwork.VirtualStorageLibrary.VirtualSymbolicLink 65 | name: VirtualSymbolicLink 66 | - uid: AkiraNetwork.VirtualStorageLibrary.VirtualSymbolicLinkAdapter`1 67 | name: VirtualSymbolicLinkAdapter 68 | - uid: AkiraNetwork.VirtualStorageLibrary.Utilities 69 | name: AkiraNetwork.VirtualStorageLibrary.Utilities 70 | items: 71 | - uid: AkiraNetwork.VirtualStorageLibrary.Utilities.VirtualTextFormatter 72 | name: VirtualTextFormatter 73 | - uid: AkiraNetwork.VirtualStorageLibrary.WildcardMatchers 74 | name: AkiraNetwork.VirtualStorageLibrary.WildcardMatchers 75 | items: 76 | - uid: AkiraNetwork.VirtualStorageLibrary.WildcardMatchers.DefaultWildcardMatcher 77 | name: DefaultWildcardMatcher 78 | - uid: AkiraNetwork.VirtualStorageLibrary.WildcardMatchers.PowerShellWildcardMatcher 79 | name: PowerShellWildcardMatcher 80 | memberLayout: SamePage 81 | -------------------------------------------------------------------------------- /AkiraNetwork/VirtualStorageLibrary/VirtualAdapter.cs: -------------------------------------------------------------------------------- 1 | // This file is part of VirtualStorageLibrary. 2 | // 3 | // Copyright (C) 2024 Akira Shimodate 4 | // 5 | // VirtualStorageLibrary is free software, and it is distributed under the terms of 6 | // the GNU Lesser General Public License (version 3, or at your option, any later 7 | // version). This license is published by the Free Software Foundation. 8 | // 9 | // VirtualStorageLibrary is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or 11 | // FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for 12 | // more details. 13 | // 14 | // You should have received a copy of the GNU Lesser General Public License along 15 | // with VirtualStorageLibrary. If not, see https://www.gnu.org/licenses/. 16 | 17 | namespace AkiraNetwork.VirtualStorageLibrary 18 | { 19 | /// 20 | /// Adapter class to simplify operations on virtual items. 21 | /// Reduces the need for casting and simplifies code, allowing 22 | /// users to easily manage specific node types. 23 | /// 24 | /// The type of item stored in the virtual storage. 25 | public class VirtualItemAdapter 26 | { 27 | private readonly VirtualStorage _storage; 28 | 29 | /// 30 | /// Initializes a new instance of the class. 31 | /// 32 | /// The virtual storage instance. 33 | public VirtualItemAdapter(VirtualStorage storage) 34 | { 35 | _storage = storage; 36 | } 37 | 38 | /// 39 | /// Gets or sets the virtual item corresponding to the specified path. 40 | /// 41 | /// The path of the item. 42 | /// A flag indicating whether to follow links. 43 | /// The corresponding to the specified path. 44 | public VirtualItem this[VirtualPath path, bool followLinks = true] 45 | { 46 | get => _storage.GetItem(path, followLinks); 47 | set => _storage.SetNode(path, value); 48 | } 49 | } 50 | 51 | /// 52 | /// Adapter class to simplify operations on virtual symbolic links. 53 | /// Reduces the need for casting and simplifies code, allowing 54 | /// users to easily manage specific node types. 55 | /// 56 | /// The type of item stored in the virtual storage. 57 | public class VirtualSymbolicLinkAdapter 58 | { 59 | private readonly VirtualStorage _storage; 60 | 61 | /// 62 | /// Initializes a new instance of the class. 63 | /// 64 | /// The virtual storage instance. 65 | public VirtualSymbolicLinkAdapter(VirtualStorage storage) 66 | { 67 | _storage = storage; 68 | } 69 | 70 | /// 71 | /// Gets or sets the virtual symbolic link corresponding to the specified path. 72 | /// 73 | /// The path of the symbolic link. 74 | /// The corresponding to the specified path. 75 | /// 76 | /// This adapter directly operates on the symbolic link itself and does not resolve the link to its target. 77 | /// Ensure that this behavior is desired, as any operations will affect the symbolic link rather than the linked item. 78 | /// 79 | public VirtualSymbolicLink this[VirtualPath path] 80 | { 81 | get => _storage.GetSymbolicLink(path); 82 | set => _storage.SetNode(path, value); 83 | } 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /AkiraNetwork/VirtualStorageLibrary/VirtualInterfaces.cs: -------------------------------------------------------------------------------- 1 | // This file is part of VirtualStorageLibrary. 2 | // 3 | // Copyright (C) 2024 Akira Shimodate 4 | // 5 | // VirtualStorageLibrary is free software, and it is distributed under the terms of 6 | // the GNU Lesser General Public License (version 3, or at your option, any later 7 | // version). This license is published by the Free Software Foundation. 8 | // 9 | // VirtualStorageLibrary is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or 11 | // FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for 12 | // more details. 13 | // 14 | // You should have received a copy of the GNU Lesser General Public License along 15 | // with VirtualStorageLibrary. If not, see https://www.gnu.org/licenses/. 16 | 17 | using System.Collections.ObjectModel; 18 | 19 | namespace AkiraNetwork.VirtualStorageLibrary 20 | { 21 | /// 22 | /// Provides functionality to create deep clones of type T. 23 | /// 24 | /// The type of the object to clone. 25 | public interface IVirtualDeepCloneable 26 | { 27 | /// 28 | /// Creates a deep clone of the object. 29 | /// 30 | /// 31 | /// Indicates whether to recursively clone nested objects. If true, a recursive 32 | /// clone is performed; if false, only the object itself is cloned. This parameter 33 | /// is only relevant for VirtualDirectory, and is ignored for VirtualItem{T} and 34 | /// VirtualSymbolicLink. 35 | /// 36 | /// The cloned object. 37 | T DeepClone(bool recursive = false); 38 | } 39 | 40 | /// 41 | /// Provides functionality for wildcard matching. 42 | /// 43 | public interface IVirtualWildcardMatcher 44 | { 45 | /// 46 | /// Gets a dictionary of wildcards and their corresponding regex patterns. 47 | /// 48 | /// 49 | /// A read-only dictionary containing wildcards as keys and their corresponding 50 | /// regex patterns as values. 51 | /// 52 | ReadOnlyDictionary WildcardDictionary { get; } 53 | 54 | /// 55 | /// Gets a collection of available wildcards. 56 | /// 57 | /// 58 | /// An enumerable collection of strings representing the available wildcards. 59 | /// 60 | IEnumerable Wildcards { get; } 61 | 62 | /// 63 | /// Gets a collection of available patterns. 64 | /// 65 | /// 66 | /// An enumerable collection of strings representing the available patterns. 67 | /// 68 | IEnumerable Patterns { get; } 69 | 70 | /// 71 | /// Gets the number of wildcards. 72 | /// 73 | /// 74 | /// An integer representing the number of wildcards available. 75 | /// 76 | int Count { get; } 77 | 78 | /// 79 | /// Determines whether the specified node name matches the specified pattern. 80 | /// 81 | /// The node name to check. 82 | /// The pattern to compare against. 83 | /// True if the node name matches the pattern; otherwise, false. 84 | bool PatternMatcher(string nodeName, string pattern); 85 | 86 | /// 87 | /// Checks if the provided wildcard pattern is valid. 88 | /// 89 | /// The wildcard pattern to validate. 90 | /// True if the pattern is valid; otherwise, false. 91 | bool IsValidWildcardPattern(string pattern); 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /documents/getting-started.ja.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Getting Started" 3 | --- 4 | 5 | ![burner.png](images/burner.png) 6 | 7 |
8 | Language: Japanese 9 | 13 |
14 | 15 | # Getting Started 16 | 17 | VirtualStorageLibraryへようこそ!このガイドでは、ライブラリを迅速かつ効果的にセットアップし、使用を開始する方法を説明します。 18 | 19 | ## 前提条件 20 | 21 | 使用を開始する前に、以下のソフトウェアがインストールされていることを確認してください。 22 | 23 | - .NET 8 以降 24 | 25 | - C# 12 以降 26 | 27 | - Visual Studio 2022 または Visual Studio Code 28 | 29 | - 基本的なC#と.NETの知識 30 | 31 | ## インストール方法 32 | 33 | ### Visual Studio 2022 でのインストール 34 | 35 | #### **NuGet パッケージマネージャーからインストール**する方法: 36 | 37 | - Visual Studio 2022 のソリューションエクスプローラーで、プロジェクトを右クリックし、「NuGet パッケージの管理」を選択します。 38 | - 「参照」タブで `AkiraNetwork.VirtualStorageLibrary` を検索し、選択してインストールします。 39 | 40 | #### **パッケージマネージャーコンソールからインストール**する方法: 41 | - Visual Studio 2022 のメニューから「ツール」>「NuGet パッケージマネージャー」>「パッケージマネージャーコンソール」を選択します。 42 | - パッケージマネージャーコンソールで以下のコマンドを入力し、インストールします。 43 | 44 | ```powershell 45 | Install-Package AkiraNetwork.VirtualStorageLibrary 46 | ``` 47 | 48 | ### .NET CLIを使用したインストール 49 | 50 | - コマンドラインで、プロジェクトファイル (`.csproj`) があるディレクトリに移動します。 51 | - Visual Studio 2022が起動していないことを確認してください。 52 | - 以下のコマンドを入力して、`VirtualStorageLibrary` をインストールします。 53 | この方法でプロジェクトファイルに自動的にパッケージが追加されます。 54 | 55 | ```bash 56 | dotnet add package AkiraNetwork.VirtualStorageLibrary 57 | ``` 58 | 59 | ### インストールの確認 60 | 61 | インストールが成功すると、プロジェクトの依存関係に `VirtualStorageLibrary` が追加され、使用できるようになります。 62 | インストール後、必要に応じて `using` ディレクティブを追加してライブラリを参照してください。 63 | 64 | 65 | 66 | ![tree_256x256.svg](images/tree_256x256.svg) 67 | 68 | 69 | 70 | ## クイックスタート 71 | 72 | まずは簡単なサンプルから始めましょう。 73 | VSLSample01という名前のソリューション、プロジェクトを作成して、以下のソースコードを入力して実行してください。 74 | このサンプルは仮想ストレージの初期化と作成、ノードの作成と取得を実行するサンプルです。 75 | 76 | ```csharp 77 | using AkiraNetwork.VirtualStorageLibrary; 78 | 79 | namespace VSLSample01 80 | { 81 | // User-defined class 82 | public class Person 83 | { 84 | public string Name { get; set; } = string.Empty; 85 | public int Age { get; set; } = 0; 86 | } 87 | 88 | internal class Program 89 | { 90 | static void Main() 91 | { 92 | // Initialize the VirtualStorageSettings 93 | VirtualStorageSettings.Initialize(); 94 | 95 | // Create a VirtualStorage instance 96 | VirtualStorage vs = new(); 97 | 98 | // Create a Person object 99 | Person person1 = new() { Name = "John", Age = 20 }; 100 | 101 | // Create a VirtualItem instance 102 | VirtualItem item1 = new("item1", person1); 103 | 104 | // Add the directory and item to the VirtualStorage instance 105 | vs.AddDirectory("/home1"); 106 | vs.AddItem("/home1", item1); 107 | 108 | // Retrieve the Person object from the VirtualStorage instance 109 | Person result = vs.GetItem("/home1/item1").ItemData!; 110 | 111 | // Display the retrieved Person object 112 | Console.WriteLine($"Name: {result.Name}, Age: {result.Age}"); 113 | } 114 | } 115 | } 116 | ``` 117 | 118 | このコードは、以下のことを実行します。 119 | 120 | 1. 仮想ストレージを初期化します。 121 | 122 | 2. 仮想ストレージを作成します。この時、ルートディレクトリは自動的に作成された状態です。 123 | 124 | 3. ユーザー定義オブジェクト`person1`を作成します。 125 | 126 | 4. ユーザー定義オブジェクト`person1`を含むアイテム`item1`を作成します。 127 | 128 | 5. ディレクトリ`/home1`を作成します。 129 | 130 | 6. ディレクトリ`/home1`にアイテム`item1`を追加します。 131 | 132 | 7. パス`/home1/item1`からユーザー定義オブジェクト`result`を取得します。 133 | 134 | 8. ユーザー定義オブジェクト`result`の`Name`プロパティと`Age`プロパティを表示します。 135 | 136 | ## 次のステップ 137 | 138 | 基本を理解したら、次のステップとして以下を探索してみてください。 139 | 140 | - [APIリファレンス](xref:AkiraNetwork.VirtualStorageLibrary) 141 | 142 | - [Introduction](introduction.md) 143 | 144 | - チュートリアル (執筆予定) 145 | 146 | ## サポートとフィードバック 147 | 148 | 問題が発生したり、提案がある場合は、[Issue](https://github.com/shimodateakira/VirtualStorageLibrary/issues)を作成するか、[ディスカッション](https://github.com/shimodateakira/VirtualStorageLibrary/discussions)に参加してください。 149 | -------------------------------------------------------------------------------- /documents/templates/material/public/main.css: -------------------------------------------------------------------------------- 1 | @import url('https://fonts.googleapis.com/css2?family=Roboto:wght@100;400;700&display=swap'); 2 | 3 | :root { 4 | --bs-font-sans-serif: 'Roboto'; 5 | --bs-border-radius: 10px; 6 | 7 | --border-radius-button: 40px; 8 | --card-box-shadow: 0 1px 2px 0 #3d41440f, 0 1px 3px 1px #3d414429; 9 | 10 | --material-yellow-light: #e6dfbf; 11 | --material-yellow-dark: #5a5338; 12 | 13 | --material-blue-light: #c4d9f1; 14 | --material-blue-dark: #383e5a; 15 | 16 | --material-red-light: #f1c4c4; 17 | --material-red-dark: #5a3838; 18 | 19 | --material-warning-header: #f57f171a; 20 | --material-warning-background: #f6e8bd; 21 | --material-warning-background-dark: #57502c; 22 | 23 | --material-info-header: #1976d21a; 24 | --material-info-background: #e3f2fd; 25 | --material-info-background-dark: #2c4557; 26 | 27 | --material-danger-header: #d32f2f1a; 28 | --material-danger-background: #ffebee; 29 | --material-danger-background-dark: #572c2c; 30 | } 31 | 32 | /* HEADINGS */ 33 | 34 | h1 { 35 | font-weight: 600; 36 | font-size: 32px; 37 | } 38 | 39 | h2 { 40 | font-weight: 600; 41 | font-size: 24px; 42 | line-height: 1.8; 43 | } 44 | 45 | h3 { 46 | font-weight: 600; 47 | font-size: 20px; 48 | line-height: 1.8; 49 | } 50 | 51 | h5 { 52 | font-size: 14px; 53 | padding: 10px 0px; 54 | } 55 | 56 | article h2, 57 | article h3, 58 | article h4 { 59 | margin-top: 15px; 60 | margin-bottom: 15px; 61 | } 62 | 63 | article h4 { 64 | padding-bottom: 8px; 65 | border-bottom: 2px solid #ddd; 66 | } 67 | 68 | /** IMAGES **/ 69 | img { 70 | border-radius: var(--bs-border-radius); 71 | box-shadow: var(--card-box-shadow); 72 | } 73 | 74 | /** NAVBAR **/ 75 | .navbar-brand > img { 76 | box-shadow: none; 77 | color: var(--bs-nav-link-color); 78 | } 79 | 80 | [data-bs-theme='light'] nav.navbar { 81 | background-color: var(--bs-primary-bg-subtle); 82 | } 83 | 84 | [data-bs-theme='dark'] nav.navbar { 85 | background-color: var(--bs-tertiary-bg); 86 | } 87 | 88 | .navbar-nav > li > a { 89 | border-radius: var(--border-radius-button); 90 | transition: 200ms; 91 | } 92 | 93 | .navbar-nav a.nav-link:focus, 94 | .navbar-nav a.nav-link:hover { 95 | background-color: var(--bs-primary-border-subtle); 96 | } 97 | 98 | .navbar-nav .nav-link.active, 99 | .navbar-nav .nav-link.show { 100 | color: var(--bs-link-hover-color); 101 | } 102 | 103 | /** SEARCH AND FILTER **/ 104 | input.form-control { 105 | border-radius: var(--border-radius-button); 106 | } 107 | 108 | form.filter { 109 | margin: 0.3rem; 110 | } 111 | 112 | /** ALERTS **/ 113 | .alert { 114 | padding: 0; 115 | border: none; 116 | box-shadow: var(--card-box-shadow); 117 | } 118 | 119 | .alert > p { 120 | padding: 0.2rem 0.7rem 0.7rem 1rem; 121 | } 122 | 123 | .alert > ul { 124 | margin-bottom: 0; 125 | padding: 5px 40px; 126 | } 127 | 128 | .alert > h5 { 129 | padding: 0.5rem 0.7rem 0.7rem 1rem; 130 | border-radius: var(--bs-border-radius) var(--bs-border-radius) 0 0; 131 | font-weight: bold; 132 | text-transform: capitalize; 133 | } 134 | 135 | .alert-info { 136 | color: var(--material-blue-dark); 137 | background-color: var(--material-info-background); 138 | } 139 | 140 | [data-bs-theme='dark'] .alert-info { 141 | color: var(--material-blue-light); 142 | background-color: var(--material-info-background-dark); 143 | } 144 | 145 | .alert-info > h5 { 146 | background-color: var(--material-info-header); 147 | } 148 | 149 | .alert-warning { 150 | color: var(--material-yellow-dark); 151 | background-color: var(--material-warning-background); 152 | } 153 | 154 | [data-bs-theme='dark'] .alert-warning { 155 | color: var(--material-yellow-light); 156 | background-color: var(--material-warning-background-dark); 157 | } 158 | 159 | .alert-warning > h5 { 160 | background-color: var(--material-warning-header); 161 | } 162 | 163 | .alert-danger { 164 | color: var(--material-red-dark); 165 | background-color: var(--material-danger-background); 166 | } 167 | 168 | [data-bs-theme='dark'] .alert-danger { 169 | color: var(--material-red-light); 170 | background-color: var(--material-danger-background-dark); 171 | } 172 | 173 | .alert-danger > h5 { 174 | background-color: var(--material-danger-header); 175 | } 176 | 177 | /* CODE HIGHLIGHT */ 178 | code { 179 | border-radius: var(--bs-border-radius); 180 | margin: 4px 2px; 181 | box-shadow: var(--card-box-shadow); 182 | } 183 | -------------------------------------------------------------------------------- /AkiraNetwork/VirtualStorageLibrary.Test/VirtualStorageSettingsTests.cs: -------------------------------------------------------------------------------- 1 | // This file is part of VirtualStorageLibrary. 2 | // 3 | // Copyright (C) 2024 Akira Shimodate 4 | // 5 | // VirtualStorageLibrary is free software, and it is distributed under the terms of 6 | // the GNU Lesser General Public License (version 3, or at your option, any later 7 | // version). This license is published by the Free Software Foundation. 8 | // 9 | // VirtualStorageLibrary is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or 11 | // FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for 12 | // more details. 13 | // 14 | // You should have received a copy of the GNU Lesser General Public License along 15 | // with VirtualStorageLibrary. If not, see https://www.gnu.org/licenses/. 16 | 17 | using AkiraNetwork.VirtualStorageLibrary.WildcardMatchers; 18 | using System.Globalization; 19 | 20 | namespace AkiraNetwork.VirtualStorageLibrary.Test 21 | { 22 | [TestClass] 23 | public class VirtualStorageSettingsTests : VirtualTestBase 24 | { 25 | private static readonly HashSet InvalidCharsForTest = ['*', '?']; 26 | 27 | [TestInitialize] 28 | public override void TestInitialize() 29 | { 30 | base.TestInitialize(); 31 | 32 | Thread.CurrentThread.CurrentUICulture = CultureInfo.InvariantCulture; 33 | } 34 | 35 | [TestMethod] 36 | public void Initialize_DefaultValues_Correct() 37 | { 38 | // Arrange 39 | VirtualStorageSettings.Initialize(); 40 | 41 | // Act 42 | var settings = VirtualStorageSettings.Settings; 43 | 44 | // Assert 45 | HashSet expectedInvalidNodeNameCharacters = [settings.PathSeparator]; 46 | HashSet expectedInvalidNodeNames = [settings.PathDot, settings.PathDotDot]; 47 | 48 | Assert.AreEqual('/', settings.PathSeparator); 49 | Assert.AreEqual("/", settings.PathRoot); 50 | Assert.AreEqual(".", settings.PathDot); 51 | Assert.AreEqual("..", settings.PathDotDot); 52 | Assert.IsTrue(settings.InvalidNodeNameCharacters.SetEquals(expectedInvalidNodeNameCharacters)); 53 | Assert.IsTrue(settings.InvalidNodeNames.SetEquals(expectedInvalidNodeNames)); 54 | Assert.IsNotNull(settings.WildcardMatcher); 55 | Assert.AreEqual("item", settings.PrefixItem); 56 | Assert.AreEqual("dir", settings.PrefixDirectory); 57 | Assert.AreEqual("link", settings.PrefixSymbolicLink); 58 | } 59 | 60 | [TestMethod] 61 | public void Initialize_ResetsSettings_Correct() 62 | { 63 | // Arrange 64 | VirtualStorageSettings.Settings.PathSeparator = '\\'; 65 | VirtualStorageSettings.Settings.PrefixItem = "customItem"; 66 | 67 | // Act 68 | VirtualStorageSettings.Initialize(); 69 | var settings = VirtualStorageSettings.Settings; 70 | 71 | // Assert 72 | Assert.AreEqual('/', settings.PathSeparator); 73 | Assert.AreEqual("item", settings.PrefixItem); 74 | } 75 | 76 | [TestMethod] 77 | public void SetPathSeparator_UpdatesValue_Correct() 78 | { 79 | // Arrange 80 | VirtualStorageSettings.Initialize(); 81 | var settings = VirtualStorageSettings.Settings; 82 | 83 | // Act 84 | settings.PathSeparator = '\\'; 85 | 86 | // Assert 87 | Assert.AreEqual('\\', settings.PathSeparator); 88 | } 89 | 90 | [TestMethod] 91 | public void SetInvalidNodeNameCharacters_UpdatesValue_Correct() 92 | { 93 | // Arrange 94 | VirtualStorageSettings.Initialize(); 95 | var settings = VirtualStorageSettings.Settings; 96 | 97 | // Act 98 | settings.InvalidNodeNameCharacters = InvalidCharsForTest; 99 | 100 | // Assert 101 | Assert.IsTrue(InvalidCharsForTest.SetEquals(settings.InvalidNodeNameCharacters)); 102 | } 103 | 104 | [TestMethod] 105 | public void SetWildcardMatcher_UpdatesValue_Correct() 106 | { 107 | // Arrange 108 | VirtualStorageSettings.Initialize(); 109 | var settings = VirtualStorageSettings.Settings; 110 | 111 | // Act 112 | var customMatcher = new DefaultWildcardMatcher(); 113 | settings.WildcardMatcher = customMatcher; 114 | 115 | // Assert 116 | Assert.AreEqual(customMatcher, settings.WildcardMatcher); 117 | } 118 | } 119 | } 120 | -------------------------------------------------------------------------------- /AkiraNetwork/VirtualStorageLibrary/VirtualNode.cs: -------------------------------------------------------------------------------- 1 | // This file is part of VirtualStorageLibrary. 2 | // 3 | // Copyright (C) 2024 Akira Shimodate 4 | // 5 | // VirtualStorageLibrary is free software, and it is distributed under the terms of 6 | // the GNU Lesser General Public License (version 3, or at your option, any later 7 | // version). This license is published by the Free Software Foundation. 8 | // 9 | // VirtualStorageLibrary is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or 11 | // FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for 12 | // more details. 13 | // 14 | // You should have received a copy of the GNU Lesser General Public License along 15 | // with VirtualStorageLibrary. If not, see https://www.gnu.org/licenses/. 16 | 17 | namespace AkiraNetwork.VirtualStorageLibrary 18 | { 19 | /// 20 | /// Represents an abstract class for nodes. 21 | /// 22 | public abstract class VirtualNode : IVirtualDeepCloneable 23 | { 24 | /// 25 | /// Gets the name of node. 26 | /// 27 | public VirtualNodeName Name { get; internal set; } 28 | 29 | /// 30 | /// Gets the created date of the node. This date represents when the node was first created. 31 | /// 32 | public DateTime CreatedDate { get; internal set; } 33 | 34 | /// 35 | /// Gets the updated date of the node. This date represents the last time the node was modified. 36 | /// It is set to the current date and time at the moment of instantiation or cloning. 37 | /// 38 | public DateTime UpdatedDate { get; internal set; } 39 | 40 | /// 41 | /// Gets the node type of node. 42 | /// 43 | public abstract VirtualNodeType NodeType { get; } 44 | 45 | /// 46 | /// Gets the VID of node. 47 | /// 48 | public VirtualID VID { get; private set; } = new VirtualID(); 49 | 50 | /// 51 | /// Creates a deep clone of the entity. However, the CreatedDate and UpdatedDate 52 | /// should not be cloned as they are set to the current date and time at the time 53 | /// of cloning. 54 | /// 55 | /// 56 | /// When true, all child nodes are also cloned, creating a 57 | /// deep copy of the entire tree. The default is false. 58 | /// The CreatedDate and UpdatedDate properties are not preserved. 59 | /// They are set to the current date and time at the moment of instantiation or cloning. 60 | /// 61 | /// Cloned instance 62 | public abstract VirtualNode DeepClone(bool recursive = false); 63 | 64 | /// 65 | /// Updates the . 66 | /// 67 | /// Value to update 68 | public abstract void Update(VirtualNode node); 69 | 70 | /// 71 | /// Gets a value indicating whether referenced in storage. 72 | /// If this property is true, the node is referenced from storage. Otherwise, it is not. 73 | /// 74 | public bool IsReferencedInStorage { get; internal set; } = false; 75 | 76 | /// 77 | /// Initializes a new instance of the class. 78 | /// 79 | /// The name of node. 80 | protected VirtualNode(VirtualNodeName name) 81 | { 82 | Name = name; 83 | CreatedDate = UpdatedDate = DateTime.Now; 84 | } 85 | 86 | /// 87 | /// Initializes a new instance of the class. 88 | /// 89 | /// The name of node. 90 | /// The created date of node. 91 | protected VirtualNode(VirtualNodeName name, DateTime createdDate) 92 | { 93 | Name = name; 94 | CreatedDate = UpdatedDate = createdDate; 95 | } 96 | 97 | /// 98 | /// Initializes a new instance of the class. 99 | /// 100 | /// The name of node. 101 | /// The created date of node. 102 | /// The updated date of node. 103 | protected VirtualNode(VirtualNodeName name, DateTime createdDate, DateTime updatedDate) 104 | { 105 | Name = name; 106 | CreatedDate = createdDate; 107 | UpdatedDate = updatedDate; 108 | } 109 | } 110 | } 111 | -------------------------------------------------------------------------------- /documents/getting-started.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Getting Started" 3 | --- 4 | 5 | ![burner.png](images/burner.png) 6 | 7 |
8 | Language: English 9 | 13 |
14 | 15 | # Getting Started 16 | 17 | Welcome to the VirtualStorageLibrary! This guide will help you quickly and effectively set up and start using the library. 18 | 19 | ## Prerequisites 20 | 21 | Before getting started, make sure you have the following software installed: 22 | 23 | - .NET 8 or later 24 | 25 | - C# 12 or later 26 | 27 | - Visual Studio 2022 or Visual Studio Code 28 | 29 | - Basic knowledge of C# and .NET 30 | 31 | ## Installation 32 | 33 | ### Installing with Visual Studio 2022 34 | 35 | #### **Installing via the NuGet Package Manager**: 36 | 37 | - In Visual Studio 2022, right-click on your project in the Solution Explorer and select "Manage NuGet Packages". 38 | - In the "Browse" tab, search for `AkiraNetwork.VirtualStorageLibrary`, select it, and install it. 39 | 40 | #### **Installing via the Package Manager Console**: 41 | - From the menu in Visual Studio 2022, go to "Tools" > "NuGet Package Manager" > "Package Manager Console". 42 | - In the Package Manager Console, enter the following command to install the package: 43 | 44 | ```powershell 45 | Install-Package AkiraNetwork.VirtualStorageLibrary 46 | ``` 47 | 48 | ### Installing with .NET CLI 49 | 50 | - Navigate to the directory containing your project file (`.csproj`) in the command line. 51 | - Ensure that Visual Studio 2022 is not running. 52 | - Enter the following command to install `VirtualStorageLibrary`. 53 | This will automatically add the package to your project file. 54 | 55 | ```bash 56 | dotnet add package AkiraNetwork.VirtualStorageLibrary 57 | ``` 58 | 59 | ### Verifying the Installation 60 | 61 | Once the installation is successful, the `VirtualStorageLibrary` will be added to your project's dependencies and will be ready to use. 62 | After installation, make sure to add the necessary `using` directives to reference the library. 63 | 64 | ![tree_256x256.svg](images/tree_256x256.svg) 65 | 66 | ## Quick Start 67 | 68 | Let's start with a simple example. 69 | Create a solution and project named `VSLSample01`, and enter the following source code to run it. 70 | This example demonstrates the initialization and creation of virtual storage, as well as the creation and retrieval of nodes. 71 | 72 | ```csharp 73 | using AkiraNetwork.VirtualStorageLibrary; 74 | 75 | namespace VSLSample01 76 | { 77 | // User-defined class 78 | public class Person 79 | { 80 | public string Name { get; set; } = string.Empty; 81 | public int Age { get; set; } = 0; 82 | } 83 | 84 | internal class Program 85 | { 86 | static void Main() 87 | { 88 | // Initialize the VirtualStorageSettings 89 | VirtualStorageSettings.Initialize(); 90 | 91 | // Create a VirtualStorage instance 92 | VirtualStorage vs = new(); 93 | 94 | // Create a Person object 95 | Person person1 = new() { Name = "John", Age = 20 }; 96 | 97 | // Create a VirtualItem instance 98 | VirtualItem item1 = new("item1", person1); 99 | 100 | // Add the directory and item to the VirtualStorage instance 101 | vs.AddDirectory("/home1"); 102 | vs.AddItem("/home1", item1); 103 | 104 | // Retrieve the Person object from the VirtualStorage instance 105 | Person result = vs.GetItem("/home1/item1").ItemData!; 106 | 107 | // Display the retrieved Person object 108 | Console.WriteLine($"Name: {result.Name}, Age: {result.Age}"); 109 | } 110 | } 111 | } 112 | ``` 113 | 114 | This code performs the following steps: 115 | 116 | 1. Initializes the virtual storage. 117 | 118 | 2. Creates the virtual storage, with the root directory automatically created. 119 | 120 | 3. Creates a user-defined object `person1`. 121 | 122 | 4. Creates an item `item1` containing the user-defined object `person1`. 123 | 124 | 5. Creates the directory `/home1`. 125 | 126 | 6. Adds the item `item1` to the directory `/home1`. 127 | 128 | 7. Retrieves the user-defined object `result` from the path `/home1/item1`. 129 | 130 | 8. Displays the `Name` and `Age` properties of the user-defined object `result`. 131 | 132 | ## Next Steps 133 | 134 | Once you've understood the basics, explore the following: 135 | 136 | - [API Reference](xref:AkiraNetwork.VirtualStorageLibrary) 137 | 138 | - [Introduction](introduction.md) 139 | 140 | - Tutorial (Coming Soon) 141 | 142 | ## Support and Feedback 143 | 144 | If you encounter any issues or have suggestions, please [create an issue](https://github.com/shimodateakira/VirtualStorageLibrary/issues) or join the [discussion](https://github.com/shimodateakira/VirtualStorageLibrary/discussions). 145 | -------------------------------------------------------------------------------- /AkiraNetwork/VirtualStorageLibrary/VirtualStorageLibrary.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net8.0 5 | enable 6 | enable 7 | AkiraNetwork.VirtualStorageLibrary 8 | True 9 | Virtual Storage Library 10 | 0.9.2.0 11 | Akira Shimodate 12 | AkiraNetwork 13 | VirtualStorageLibrary is a fully in-memory .NET library that provides a tree-structured collection. 14 | It offers a foundation for managing hierarchical data structures and supports items, directories, and symbolic links with user-defined types. 15 | This library is not a file system; instead, it is inspired by traditional file system concepts but redesigned to be more flexible and user-friendly. 16 | Users can intuitively reference, traverse, and manipulate nodes by specifying paths, making it ideal for applications needing a high-performance virtual storage solution. 17 | © 2024 Akira Shimodate 18 | https://shimodateakira.github.io/VirtualStorageLibrary/ 19 | tree.png 20 | README.md 21 | https://github.com/shimodateakira/VirtualStorageLibrary.git 22 | git 23 | tree;collection;library;virtual;akiranet;akiranetwork 24 | Version 0.9.1 - Prerelease 25 | 26 | This is the prerelease of the project, focusing on bug fixes, enhancements, and new features. 27 | 28 | Issues: 29 | 30 | - #189: Add adapter for item and symbolic link in indexer. 31 | 32 | Version 0.9.0.3 - Prerelease 33 | 34 | This is the prerelease of the project, focusing on bug fixes and enhancements. 35 | 36 | Issues: 37 | 38 | - #188: When updating symbolic links, the link dictionary was not being updated. 39 | 40 | Version 0.9.0 - Prerelease 41 | 42 | This is the prerelease of the project, focusing on bug fixes and enhancements. 43 | 44 | Bug Fixes and Enhancements: 45 | 46 | - #56: Introduced validity checks during link creation to ensure the integrity of the links. 47 | - #69: Considered deprecating GetNodes and GetNodesWithPath methods, evaluating alternative approaches for future versions. 48 | - #86: Resolved an issue in AddLinkToDictionary where ConvertToAbsolutePath was not functioning as expected. 49 | - #144: Corrected an issue where the current path could be deleted in the RemoveNode method, preventing potential data loss. 50 | - #145: Added validation checks for incorrectly specified regular expressions to prevent runtime errors. 51 | - #146: Added additional information to exceptions when a node is not found, improving error diagnostics. 52 | - #147: Implemented a mechanism to dynamically switch wildcard matchers, enhancing the flexibility of pattern matching. 53 | - #148: Improved the organization of DebuggerStepThrough attributes across the codebase for a better debugging experience. 54 | - #158: Fixed an initialization bug in the VirtualPath class that could cause unexpected behavior during setup. 55 | - #184: Fixed an exception that occurred when copying items under a symbolic link in the CopyNode method. 56 | 57 | Please refer to the VirtualStorageLibrary homepage for more details: 58 | 59 | https://shimodateakira.github.io/VirtualStorageLibrary/index.html 60 | 61 | True 62 | True 63 | LGPL-3.0-or-later 64 | True 65 | ../../packages 66 | 0.9.2.0 67 | 0.9.2.0 68 | True 69 | ..\..\..\Signature\VirtualStorageLibrary.snk 70 | AkiraNetwork.VirtualStorageLibrary 71 | snupkg 72 | 73 | 74 | 75 | 76 | True 77 | \ 78 | 79 | 80 | True 81 | \ 82 | 83 | 84 | 85 | 86 | 87 | True 88 | True 89 | Resources.resx 90 | 91 | 92 | 93 | 94 | 95 | ResXFileCodeGenerator 96 | Resources.Designer.cs 97 | 98 | 99 | 100 | -------------------------------------------------------------------------------- /docs/api/AkiraNetwork.VirtualStorageLibrary.Localization.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Namespace AkiraNetwork.VirtualStorageLibrary.Localization | VirtualStorageLibrary 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 |
26 | 27 | 50 | 51 | 58 |
59 |
60 | 61 |
62 |
Search Results for
63 |
64 |

65 |
66 |
    67 |
    68 |
    69 | 106 | 107 |
    108 |
    109 | 118 |
    119 |
    120 | 121 | 122 | 123 | 124 | 125 | 126 | -------------------------------------------------------------------------------- /docs/api/AkiraNetwork.VirtualStorageLibrary.Utilities.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Namespace AkiraNetwork.VirtualStorageLibrary.Utilities | VirtualStorageLibrary 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 |
    25 |
    26 | 27 | 50 | 51 | 58 |
    59 |
    60 | 61 |
    62 |
    Search Results for
    63 |
    64 |

    65 |
    66 |
      67 |
      68 |
      69 | 107 | 108 |
      109 |
      110 | 119 |
      120 |
      121 | 122 | 123 | 124 | 125 | 126 | 127 | -------------------------------------------------------------------------------- /AkiraNetwork/VirtualStorageLibrary.Test/WildcardMatchers/PowerShellWildcardMatcherTests.cs: -------------------------------------------------------------------------------- 1 | // This file is part of VirtualStorageLibrary. 2 | // 3 | // Copyright (C) 2024 Akira Shimodate 4 | // 5 | // VirtualStorageLibrary is free software, and it is distributed under the terms of 6 | // the GNU Lesser General Public License (version 3, or at your option, any later 7 | // version). This license is published by the Free Software Foundation. 8 | // 9 | // VirtualStorageLibrary is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or 11 | // FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for 12 | // more details. 13 | // 14 | // You should have received a copy of the GNU Lesser General Public License along 15 | // with VirtualStorageLibrary. If not, see https://www.gnu.org/licenses/. 16 | 17 | using AkiraNetwork.VirtualStorageLibrary.WildcardMatchers; 18 | 19 | namespace AkiraNetwork.VirtualStorageLibrary.Test.WildcardMatchers 20 | { 21 | [TestClass] 22 | public class PowerShellWildcardMatcherTests 23 | { 24 | [TestMethod] 25 | public void WildcardDictionary_ContainsExpectedPatterns() 26 | { 27 | var matcher = new PowerShellWildcardMatcher(); 28 | var dictionary = matcher.WildcardDictionary; 29 | 30 | Assert.AreEqual(4, dictionary.Count); 31 | Assert.AreEqual(".*", dictionary["*"]); 32 | Assert.AreEqual(".", dictionary["?"]); 33 | Assert.AreEqual("[", dictionary["["]); 34 | Assert.AreEqual("]", dictionary["]"]); 35 | } 36 | 37 | [TestMethod] 38 | public void Wildcards_ContainsExpectedKeys() 39 | { 40 | var matcher = new PowerShellWildcardMatcher(); 41 | var wildcards = matcher.Wildcards.ToList(); 42 | 43 | Assert.AreEqual(4, wildcards.Count); 44 | CollectionAssert.Contains(wildcards, "*"); 45 | CollectionAssert.Contains(wildcards, "?"); 46 | CollectionAssert.Contains(wildcards, "["); 47 | CollectionAssert.Contains(wildcards, "]"); 48 | } 49 | 50 | [TestMethod] 51 | public void Patterns_ContainsExpectedValues() 52 | { 53 | var matcher = new PowerShellWildcardMatcher(); 54 | var patterns = matcher.Patterns.ToList(); 55 | 56 | Assert.AreEqual(4, patterns.Count); 57 | CollectionAssert.Contains(patterns, ".*"); 58 | CollectionAssert.Contains(patterns, "."); 59 | CollectionAssert.Contains(patterns, "["); 60 | CollectionAssert.Contains(patterns, "]"); 61 | } 62 | 63 | [TestMethod] 64 | public void Count_ReturnsCorrectValue() 65 | { 66 | var matcher = new PowerShellWildcardMatcher(); 67 | Assert.AreEqual(4, matcher.Count); 68 | } 69 | 70 | [TestMethod] 71 | public void PatternMatcher_MatchesCorrectly() 72 | { 73 | var matcher = new PowerShellWildcardMatcher(); 74 | 75 | // "*" matches zero or more characters 76 | Assert.IsTrue(matcher.PatternMatcher("test.txt", "*")); 77 | Assert.IsTrue(matcher.PatternMatcher("test.txt", "t*")); 78 | Assert.IsTrue(matcher.PatternMatcher("test.txt", "*t")); 79 | Assert.IsTrue(matcher.PatternMatcher("test.txt", "test*")); 80 | Assert.IsTrue(matcher.PatternMatcher("test.txt", "*txt")); 81 | Assert.IsFalse(matcher.PatternMatcher("test.txt", "testX*")); 82 | 83 | // "?" matches exactly one character 84 | Assert.IsTrue(matcher.PatternMatcher("test.txt", "t?st.txt")); 85 | Assert.IsTrue(matcher.PatternMatcher("test.txt", "te?t.txt")); 86 | Assert.IsFalse(matcher.PatternMatcher("test.txt", "test?.txt")); 87 | 88 | // "[" and "]" for character class 89 | Assert.IsTrue(matcher.PatternMatcher("test.txt", "tes[stu].txt")); 90 | Assert.IsFalse(matcher.PatternMatcher("test.txt", "tes[pqr].txt")); 91 | } 92 | 93 | [TestMethod] 94 | public void IsValidWildcardPattern_ReturnsTrueForValidPatterns() 95 | { 96 | var matcher = new PowerShellWildcardMatcher(); 97 | 98 | // Valid patterns 99 | Assert.IsTrue(matcher.IsValidWildcardPattern("*")); // Matches zero or more characters 100 | Assert.IsTrue(matcher.IsValidWildcardPattern("?")); // Matches any single character 101 | Assert.IsTrue(matcher.IsValidWildcardPattern("[a-z]")); // Character class 102 | Assert.IsTrue(matcher.IsValidWildcardPattern("test*")); // Matches "test" followed by any characters 103 | Assert.IsTrue(matcher.IsValidWildcardPattern("file[1-5].txt")); // Matches "file1.txt" to "file5.txt" 104 | Assert.IsTrue(matcher.IsValidWildcardPattern("a`*b")); // Escaped asterisk as literal '*' 105 | } 106 | 107 | [TestMethod] 108 | public void IsValidWildcardPattern_ReturnsFalseForInvalidPatterns() 109 | { 110 | var matcher = new PowerShellWildcardMatcher(); 111 | 112 | // Invalid patterns 113 | Assert.IsFalse(matcher.IsValidWildcardPattern("[a-z")); // Missing closing bracket in character class 114 | Assert.IsFalse(matcher.IsValidWildcardPattern("test[`]")); // Improper escape within character class 115 | Assert.IsFalse(matcher.IsValidWildcardPattern("file[`")); // Unclosed escape character 116 | } 117 | } 118 | } 119 | -------------------------------------------------------------------------------- /AkiraNetwork/VirtualStorageLibrary.Test/VirtualExceptionTests.cs: -------------------------------------------------------------------------------- 1 | // This file is part of VirtualStorageLibrary. 2 | // 3 | // Copyright (C) 2024 Akira Shimodate 4 | // 5 | // VirtualStorageLibrary is free software, and it is distributed under the terms of 6 | // the GNU Lesser General Public License (version 3, or at your option, any later 7 | // version). This license is published by the Free Software Foundation. 8 | // 9 | // VirtualStorageLibrary is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or 11 | // FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for 12 | // more details. 13 | // 14 | // You should have received a copy of the GNU Lesser General Public License along 15 | // with VirtualStorageLibrary. If not, see https://www.gnu.org/licenses/. 16 | 17 | using System.Globalization; 18 | 19 | namespace AkiraNetwork.VirtualStorageLibrary.Test 20 | { 21 | [TestClass] 22 | public class VirtualExceptionTests : VirtualTestBase 23 | { 24 | [TestInitialize] 25 | public override void TestInitialize() 26 | { 27 | base.TestInitialize(); 28 | 29 | Thread.CurrentThread.CurrentUICulture = CultureInfo.InvariantCulture; 30 | 31 | VirtualStorageSettings.Initialize(); 32 | VirtualNodeName.ResetCounter(); 33 | } 34 | 35 | [TestMethod] 36 | public void DefaultConstructor_CreatesInstance() 37 | { 38 | VirtualNodeNotFoundException exception = new(); 39 | Assert.IsNotNull(exception); 40 | } 41 | 42 | [TestMethod] 43 | public void ConstructorWithMessage_CreatesInstanceWithMessage() 44 | { 45 | string message = "Test message"; 46 | VirtualNodeNotFoundException exception = new(message); 47 | 48 | Assert.IsNotNull(exception); 49 | Assert.AreEqual(message, exception.Message); 50 | } 51 | 52 | [TestMethod] 53 | public void ConstructorWithMessageAndInnerException_CreatesInstanceWithMessageAndInnerException() 54 | { 55 | string message = "Test message"; 56 | Exception innerException = new("Inner exception"); 57 | VirtualNodeNotFoundException exception = new(message, innerException); 58 | 59 | Assert.IsNotNull(exception); 60 | Assert.AreEqual(message, exception.Message); 61 | Assert.AreEqual(innerException, exception.InnerException); 62 | } 63 | } 64 | 65 | [TestClass] 66 | public class VirtualNotFoundExceptionTests : VirtualTestBase 67 | { 68 | [TestInitialize] 69 | public override void TestInitialize() 70 | { 71 | base.TestInitialize(); 72 | 73 | Thread.CurrentThread.CurrentUICulture = CultureInfo.InvariantCulture; 74 | 75 | VirtualStorageSettings.Initialize(); 76 | VirtualNodeName.ResetCounter(); 77 | } 78 | 79 | [TestMethod] 80 | public void DefaultConstructor_CreatesInstance() 81 | { 82 | VirtualNotFoundException exception = new(); 83 | Assert.IsNotNull(exception); 84 | } 85 | 86 | [TestMethod] 87 | public void ConstructorWithMessage_CreatesInstanceWithMessage() 88 | { 89 | string message = "Test message"; 90 | VirtualNotFoundException exception = new(message); 91 | 92 | Assert.IsNotNull(exception); 93 | Assert.AreEqual(message, exception.Message); 94 | } 95 | 96 | [TestMethod] 97 | public void ConstructorWithMessageAndInnerException_CreatesInstanceWithMessageAndInnerException() 98 | { 99 | string message = "Test message"; 100 | Exception innerException = new("Inner exception"); 101 | VirtualNotFoundException exception = new(message, innerException); 102 | 103 | Assert.IsNotNull(exception); 104 | Assert.AreEqual(message, exception.Message); 105 | Assert.AreEqual(innerException, exception.InnerException); 106 | } 107 | } 108 | 109 | [TestClass] 110 | public class VirtualPathNotFoundExceptionTests : VirtualTestBase 111 | { 112 | [TestInitialize] 113 | public override void TestInitialize() 114 | { 115 | base.TestInitialize(); 116 | 117 | Thread.CurrentThread.CurrentUICulture = CultureInfo.InvariantCulture; 118 | 119 | VirtualStorageSettings.Initialize(); 120 | VirtualNodeName.ResetCounter(); 121 | } 122 | 123 | [TestMethod] 124 | public void DefaultConstructor_CreatesInstance() 125 | { 126 | VirtualPathNotFoundException exception = new(); 127 | Assert.IsNotNull(exception); 128 | } 129 | 130 | [TestMethod] 131 | public void ConstructorWithMessage_CreatesInstanceWithMessage() 132 | { 133 | string message = "Test message"; 134 | VirtualPathNotFoundException exception = new(message); 135 | 136 | Assert.IsNotNull(exception); 137 | Assert.AreEqual(message, exception.Message); 138 | } 139 | 140 | [TestMethod] 141 | public void ConstructorWithMessageAndInnerException_CreatesInstanceWithMessageAndInnerException() 142 | { 143 | string message = "Test message"; 144 | Exception innerException = new("Inner exception"); 145 | VirtualPathNotFoundException exception = new(message, innerException); 146 | 147 | Assert.IsNotNull(exception); 148 | Assert.AreEqual(message, exception.Message); 149 | Assert.AreEqual(innerException, exception.InnerException); 150 | } 151 | } 152 | } 153 | -------------------------------------------------------------------------------- /documents/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "HOMEPAGE" 3 | _layout: landing 4 | --- 5 | 6 | ![burner.png](images/burner.png) 7 | 8 |
      9 | Language: English 10 | 14 |
      15 | 16 | # **Welcome to VirtualStorageLibrary!** 17 | 18 | --- 19 | 20 | ## **Tree Structure Collection for .NET Developers** 21 | 22 | `VirtualStorageLibrary` is a .NET library that operates entirely in memory and provides a 23 | **tree structure collection**. 24 | This library offers a **foundation for managing hierarchical data structures**, 25 | supporting items, directories, and symbolic links that encapsulate user-defined types `T`. 26 | This library is **not a file system**. 27 | Inspired by traditional file systems, it has been **redesigned from scratch** to offer a 28 | more flexible and user-friendly tree structure. 29 | The library aims to enable users to **intuitively** reference, traverse, and manipulate 30 | nodes via **path specification**. 31 | 32 | ![tree_256x256.svg](images/tree_256x256.svg) 33 | 34 | ## Main Features 35 | 36 | ### Flexible Tree Structure 37 | 38 | Provides a hierarchical data structure based on parent-child relationships, enabling 39 | flexible node management. 40 | 41 | ![index_tree1.png](images/index_tree1.png) 42 | 43 | ### Support for Various Node Types 44 | 45 | Supports items, directories, and symbolic links containing user-defined types `T`. 46 | 47 | Items are of a generic type, with `T` representing the user-defined type encapsulated by 48 | the item. 49 | 50 | Links function similarly to traditional symbolic links and contain the target path they 51 | point to. 52 | 53 | ![index_tree2.png](images/index_tree2.png) 54 | 55 | ### Intuitive Node Operations via Paths 56 | 57 | Allows easy referencing, traversing, adding, deleting, renaming, copying, and moving of 58 | nodes through path specification, offering a user-friendly API. 59 | 60 | - Full Path Specification 61 | "/dir1/item1" 62 | 63 | - Relative Path Specification 64 | "item1" 65 | 66 | - Relative Path (Dot) 67 | "./item" 68 | 69 | - Relative Path (Dot Dot) 70 | "../item" 71 | 72 | ### Link Management 73 | 74 | Just like general file systems, symbolic links are supported. 75 | You can create symbolic links by specifying a target path for nodes that do not exist. 76 | It is also possible to specify `null` as the target path, creating what 77 | `VirtualStorageLibrary` refers to as `null links`. 78 | If link resolution is specified during path traversal and the target path does not exist, 79 | an exception will be thrown. In the case of a `null link`, even if link resolution is 80 | specified, it will not resolve (no exception will be thrown). 81 | 82 | ![index_tree3.png](images/index_tree3.png) 83 | 84 | Manages changes to symbolic links using a link dictionary, tracking changes to the target path. 85 | 86 | ![index_tree4.png](images/index_tree4.png) 87 | 88 | ### Prevention of Circular References 89 | 90 | When traversing paths that include symbolic links, if a structure that would result in 91 | circular directory references is detected, an exception will be thrown. 92 | `VirtualStorageLibrary` employs a method of recording only the link information at the 93 | time of path resolution in a circular reference check dictionary. 94 | It is possible to create links that would result in circular references. 95 | 96 | ![index_tree5.png](images/index_tree5.png) 97 | 98 | When traversing paths, the link information is registered in the dictionary during the first path resolution. During the second path resolution, the dictionary is checked for the link information, and if it is found, it is considered a circular reference. 99 | 100 | ### Flexible Node List Retrieval 101 | 102 | When retrieving a list of nodes within a directory, you can filter and group by the 103 | specified node type and retrieve the sorted results based on the specified properties. 104 | 105 | - Default: Nodes are grouped by node type and sorted by name. 106 | 107 | ![index_tree6A.png](images/index_tree6A.png) 108 | 109 | - Filtering: You can retrieve only specific node types. 110 | 111 | ![index_tree6B.png](images/index_tree6B.png) 112 | 113 | - Sorting: You can retrieve nodes sorted by specific properties. 114 | 115 | ![index_tree6C.png](images/index_tree6C.png) 116 | 117 | ## Documentation 118 | 119 | For detailed usage and reference information about this library, please refer to the 120 | following documents. 121 | 122 | - [Introduction](introduction.md) 123 | An overview and design philosophy of the library. 124 | It explains the purpose behind its development, introduces its basic functions and 125 | features, and serves as an introductory guide for new users to understand the library 126 | as a whole. 127 | 128 | - [Getting Started](getting-started.md) 129 | A step-by-step guide to getting started with the library. 130 | It explains the basic steps necessary to install, configure, and use the library, from 131 | installation to sample code. 132 | 133 | - [API Reference](xref:AkiraNetwork.VirtualStorageLibrary) 134 | Detailed information about all classes, methods, and properties included in the 135 | library. 136 | It includes explanations of how to use each member and its parameters, helping you 137 | understand the specific usage of the library. 138 | 139 | - Tutorial (Coming Soon) 140 | A guide based on real-world use cases, providing detailed examples to help you learn 141 | how to apply the library in practice. This will be added soon. 142 | 143 | - [Licenses](licenses.md) 144 | Information about the license for this library and the licenses for the libraries, 145 | tools, CSS, etc., used. 146 | 147 | ## Repository 148 | 149 | [VirtualStorageLibrary GitHub](https://github.com/AkiraNetwork/VirtualStorageLibrary) 150 | -------------------------------------------------------------------------------- /AkiraNetwork/VirtualStorageLibrary.Test/VirtualStorageStateTests.cs: -------------------------------------------------------------------------------- 1 | // This file is part of VirtualStorageLibrary. 2 | // 3 | // Copyright (C) 2024 Akira Shimodate 4 | // 5 | // VirtualStorageLibrary is free software, and it is distributed under the terms of 6 | // the GNU Lesser General Public License (version 3, or at your option, any later 7 | // version). This license is published by the Free Software Foundation. 8 | // 9 | // VirtualStorageLibrary is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or 11 | // FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for 12 | // more details. 13 | // 14 | // You should have received a copy of the GNU Lesser General Public License along 15 | // with VirtualStorageLibrary. If not, see https://www.gnu.org/licenses/. 16 | 17 | using AkiraNetwork.VirtualStorageLibrary.WildcardMatchers; 18 | using System.Diagnostics; 19 | using System.Globalization; 20 | 21 | namespace AkiraNetwork.VirtualStorageLibrary.Test 22 | { 23 | [TestClass] 24 | public class VirtualStorageStateTests : VirtualTestBase 25 | { 26 | [TestInitialize] 27 | public override void TestInitialize() 28 | { 29 | base.TestInitialize(); 30 | 31 | Thread.CurrentThread.CurrentUICulture = CultureInfo.InvariantCulture; 32 | 33 | VirtualStorageSettings.Initialize(); 34 | VirtualNodeName.ResetCounter(); 35 | } 36 | 37 | [TestMethod] 38 | public void SetNodeListConditions_UpdatesConditionsCorrectly() 39 | { 40 | // Arrange 41 | var filter = VirtualNodeTypeFilter.Item | VirtualNodeTypeFilter.SymbolicLink; 42 | var groupCondition = new VirtualGroupCondition(node => node.NodeType, true); 43 | var sortConditions = new List> 44 | { 45 | new(node => node.Name, true) 46 | }; 47 | 48 | // Act 49 | VirtualStorageState.SetNodeListConditions(new VirtualNodeListConditions(filter, groupCondition, sortConditions)); 50 | var state = VirtualStorageState.State; 51 | 52 | // Assert 53 | Assert.AreEqual(filter, state.NodeListConditions.Filter); 54 | Assert.AreEqual(groupCondition, state.NodeListConditions.GroupCondition); 55 | CollectionAssert.AreEqual(sortConditions, state.NodeListConditions.SortConditions!.ToList()); 56 | } 57 | 58 | [TestMethod] 59 | public void SetNodeListConditions_IndividualParameters_UpdatesConditionsCorrectly() 60 | { 61 | // Arrange 62 | var filter = VirtualNodeTypeFilter.Directory; // ディレクトリのみを対象とするフィルター 63 | var groupCondition = new VirtualGroupCondition(node => node.CreatedDate, false); // 作成日時で降順にグループ化 64 | var sortConditions = new List> 65 | { 66 | new(node => node.Name, true) 67 | }; 68 | 69 | // Act 70 | VirtualStorageState.SetNodeListConditions(filter, groupCondition, sortConditions); 71 | var state = VirtualStorageState.State; 72 | 73 | // Assert 74 | Assert.AreEqual(filter, state.NodeListConditions.Filter); 75 | Assert.AreEqual(groupCondition, state.NodeListConditions.GroupCondition); 76 | CollectionAssert.AreEqual(sortConditions, state.NodeListConditions.SortConditions!.ToList()); 77 | } 78 | 79 | [TestMethod] 80 | public void SetWildcardMatcher_UpdatesMatcherCorrectly() 81 | { 82 | // Arrange 83 | VirtualStorage vs = new(); 84 | DefaultWildcardMatcher matcher = new DefaultWildcardMatcher(); 85 | 86 | // Act 87 | VirtualStorageState.SetWildcardMatcher(matcher); 88 | 89 | // Assert 90 | Assert.AreEqual(matcher, VirtualStorageState.State.WildcardMatcher); 91 | 92 | // Arrange 93 | vs.AddDirectory("/dir1"); 94 | vs.AddItem("/dir1/item1.txt"); 95 | vs.AddItem("/dir1/item2.txt"); 96 | vs.AddItem("/dir1/item3.bin"); 97 | 98 | // Act 99 | var paths = vs.ExpandPath(@"/dir1/item.*\.txt").ToList(); 100 | 101 | // デバッグ出力 102 | Debug.WriteLine("*:"); 103 | foreach (var node in paths) 104 | { 105 | Debug.WriteLine(node); 106 | } 107 | 108 | // Assert 109 | Assert.AreEqual(2, paths.Count); 110 | Assert.AreEqual("/dir1/item1.txt", (string)paths[0]); 111 | Assert.AreEqual("/dir1/item2.txt", (string)paths[1]); 112 | 113 | // Act 114 | paths = vs.ExpandPath(@"/dir1/item.?\.txt").ToList(); 115 | 116 | // デバッグ出力 117 | Debug.WriteLine("\n?:"); 118 | foreach (var node in paths) 119 | { 120 | Debug.WriteLine(node); 121 | } 122 | 123 | // Assert 124 | Assert.AreEqual(2, paths.Count); 125 | Assert.AreEqual("/dir1/item1.txt", (string)paths[0]); 126 | Assert.AreEqual("/dir1/item2.txt", (string)paths[1]); 127 | 128 | // Act 129 | paths = vs.ExpandPath(@"/dir1/item.+\.txt").ToList(); 130 | 131 | // デバッグ出力 132 | Debug.WriteLine("\n+:"); 133 | foreach (var node in paths) 134 | { 135 | Debug.WriteLine(node); 136 | } 137 | 138 | // Assert 139 | Assert.AreEqual(2, paths.Count); 140 | Assert.AreEqual("/dir1/item1.txt", (string)paths[0]); 141 | Assert.AreEqual("/dir1/item2.txt", (string)paths[1]); 142 | } 143 | } 144 | } 145 | -------------------------------------------------------------------------------- /VirtualStorageLibrary.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.9.34414.90 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "VirtualStorageLibrary", "AkiraNetwork\VirtualStorageLibrary\VirtualStorageLibrary.csproj", "{5A5196A7-5006-40ED-9FEE-45830834E4D4}" 7 | EndProject 8 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "VirtualStorageLibrary.Test", "AkiraNetwork\VirtualStorageLibrary.Test\VirtualStorageLibrary.Test.csproj", "{0663E095-E958-44A4-8137-174F9872CC5F}" 9 | EndProject 10 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "documents", "documents", "{3C77738F-41D5-4A1B-A323-A8A813B7ECE6}" 11 | ProjectSection(SolutionItems) = preProject 12 | documents\aboutme.ja.md = documents\aboutme.ja.md 13 | documents\aboutme.md = documents\aboutme.md 14 | documents\docfx.json = documents\docfx.json 15 | documents\getting-started.ja.md = documents\getting-started.ja.md 16 | documents\getting-started.md = documents\getting-started.md 17 | documents\index.ja.md = documents\index.ja.md 18 | documents\index.md = documents\index.md 19 | documents\introduction.ja.md = documents\introduction.ja.md 20 | documents\introduction.md = documents\introduction.md 21 | documents\licenses.md = documents\licenses.md 22 | documents\toc.yml = documents\toc.yml 23 | EndProjectSection 24 | EndProject 25 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "images", "images", "{33E318B8-D84D-4F65-A581-89EA442E3E41}" 26 | ProjectSection(SolutionItems) = preProject 27 | documents\images\burner.png = documents\images\burner.png 28 | documents\images\index_tree1.png = documents\images\index_tree1.png 29 | documents\images\index_tree2.png = documents\images\index_tree2.png 30 | documents\images\index_tree3.png = documents\images\index_tree3.png 31 | documents\images\index_tree4.png = documents\images\index_tree4.png 32 | documents\images\index_tree5.png = documents\images\index_tree5.png 33 | documents\images\index_tree6A.png = documents\images\index_tree6A.png 34 | documents\images\index_tree6B.png = documents\images\index_tree6B.png 35 | documents\images\index_tree6C.png = documents\images\index_tree6C.png 36 | documents\images\tree.png = documents\images\tree.png 37 | documents\images\treetree_earthtones.webp = documents\images\treetree_earthtones.webp 38 | documents\images\tree_256x256.svg = documents\images\tree_256x256.svg 39 | documents\images\tree_32x32.svg = documents\images\tree_32x32.svg 40 | documents\images\tree_51x51.svg = documents\images\tree_51x51.svg 41 | documents\images\tree_banner_960x540.png = documents\images\tree_banner_960x540.png 42 | documents\images\tree_banner_960x540_1.png = documents\images\tree_banner_960x540_1.png 43 | documents\images\tree_banner_960x540_2.png = documents\images\tree_banner_960x540_2.png 44 | documents\images\tree_banner_960x540_3.png = documents\images\tree_banner_960x540_3.png 45 | documents\images\tree_banner_960x540_4.png = documents\images\tree_banner_960x540_4.png 46 | documents\images\tree_banner_960x540_5.png = documents\images\tree_banner_960x540_5.png 47 | documents\images\tree_banner_960x540_6.png = documents\images\tree_banner_960x540_6.png 48 | documents\images\tree_earthtones_240x240_trans.png = documents\images\tree_earthtones_240x240_trans.png 49 | documents\images\tree_earthtones_512x512.png = documents\images\tree_earthtones_512x512.png 50 | EndProjectSection 51 | EndProject 52 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "styles", "styles", "{9E8DC177-DE75-41E0-871A-141E672A7499}" 53 | ProjectSection(SolutionItems) = preProject 54 | documents\styles\an_custom.css = documents\styles\an_custom.css 55 | EndProjectSection 56 | EndProject 57 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "templates", "templates", "{D732F07F-FD10-473B-AEA1-2CD979B1248E}" 58 | EndProject 59 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "material", "material", "{2A3765A1-0A3B-44A2-97B2-2B8389858FFF}" 60 | EndProject 61 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "public", "public", "{07FA2120-C263-484B-AB25-FF9B853A81A5}" 62 | ProjectSection(SolutionItems) = preProject 63 | documents\templates\material\public\main.css = documents\templates\material\public\main.css 64 | EndProjectSection 65 | EndProject 66 | Global 67 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 68 | Debug|Any CPU = Debug|Any CPU 69 | Release|Any CPU = Release|Any CPU 70 | EndGlobalSection 71 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 72 | {5A5196A7-5006-40ED-9FEE-45830834E4D4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 73 | {5A5196A7-5006-40ED-9FEE-45830834E4D4}.Debug|Any CPU.Build.0 = Debug|Any CPU 74 | {5A5196A7-5006-40ED-9FEE-45830834E4D4}.Release|Any CPU.ActiveCfg = Release|Any CPU 75 | {5A5196A7-5006-40ED-9FEE-45830834E4D4}.Release|Any CPU.Build.0 = Release|Any CPU 76 | {0663E095-E958-44A4-8137-174F9872CC5F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 77 | {0663E095-E958-44A4-8137-174F9872CC5F}.Debug|Any CPU.Build.0 = Debug|Any CPU 78 | {0663E095-E958-44A4-8137-174F9872CC5F}.Release|Any CPU.ActiveCfg = Release|Any CPU 79 | {0663E095-E958-44A4-8137-174F9872CC5F}.Release|Any CPU.Build.0 = Release|Any CPU 80 | EndGlobalSection 81 | GlobalSection(SolutionProperties) = preSolution 82 | HideSolutionNode = FALSE 83 | EndGlobalSection 84 | GlobalSection(NestedProjects) = preSolution 85 | {33E318B8-D84D-4F65-A581-89EA442E3E41} = {3C77738F-41D5-4A1B-A323-A8A813B7ECE6} 86 | {9E8DC177-DE75-41E0-871A-141E672A7499} = {3C77738F-41D5-4A1B-A323-A8A813B7ECE6} 87 | {D732F07F-FD10-473B-AEA1-2CD979B1248E} = {3C77738F-41D5-4A1B-A323-A8A813B7ECE6} 88 | {2A3765A1-0A3B-44A2-97B2-2B8389858FFF} = {D732F07F-FD10-473B-AEA1-2CD979B1248E} 89 | {07FA2120-C263-484B-AB25-FF9B853A81A5} = {2A3765A1-0A3B-44A2-97B2-2B8389858FFF} 90 | EndGlobalSection 91 | GlobalSection(ExtensibilityGlobals) = postSolution 92 | SolutionGuid = {6A8605B9-7762-4E7E-A370-79CD7536FFC8} 93 | EndGlobalSection 94 | EndGlobal 95 | -------------------------------------------------------------------------------- /AkiraNetwork/VirtualStorageLibrary/WildcardMatchers/DefaultWildcardMatcher.cs: -------------------------------------------------------------------------------- 1 | // This file is part of VirtualStorageLibrary. 2 | // 3 | // Copyright (C) 2024 Akira Shimodate 4 | // 5 | // VirtualStorageLibrary is free software, and it is distributed under the terms of 6 | // the GNU Lesser General Public License (version 3, or at your option, any later 7 | // version). This license is published by the Free Software Foundation. 8 | // 9 | // VirtualStorageLibrary is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or 11 | // FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for 12 | // more details. 13 | // 14 | // You should have received a copy of the GNU Lesser General Public License along 15 | // with VirtualStorageLibrary. If not, see https://www.gnu.org/licenses/. 16 | 17 | using System.Collections.ObjectModel; 18 | 19 | namespace AkiraNetwork.VirtualStorageLibrary.WildcardMatchers 20 | { 21 | /// 22 | /// Implements default wildcard matching using regular expression patterns. 23 | /// Provides a straightforward mapping of regular expression symbols. 24 | /// 25 | public class DefaultWildcardMatcher : IVirtualWildcardMatcher 26 | { 27 | /// 28 | /// Dictionary mapping regular expression symbols to their literal equivalents. 29 | /// 30 | /// 31 | /// A read-only dictionary where the keys are regular expression symbols and the values 32 | /// are their literal equivalents. 33 | /// 34 | private static readonly ReadOnlyDictionary _wildcardDictionary = new( 35 | new Dictionary 36 | { 37 | { @".", @"." }, // Matches any single character 38 | { @"*", @"*" }, // Matches zero or more characters 39 | { @"+", @"+" }, // Matches one or more characters 40 | { @"?", @"?" }, // Matches zero or one character 41 | { @"^", @"^" }, // Start of line 42 | { @"$", @"$" }, // End of line 43 | { @"|", @"|" }, // OR condition 44 | { @"(", @"(" }, // Start of group 45 | { @")", @")" }, // End of group 46 | { @"[", @"[" }, // Start of character class 47 | { @"]", @"]" }, // End of character class 48 | { @"{", @"{" }, // Start of repetition 49 | { @"}", @"}" }, // End of repetition 50 | { @"\", @"\" } // Escape character 51 | }); 52 | 53 | /// 54 | /// Gets the dictionary of regular expression symbols and their corresponding literals. 55 | /// 56 | /// 57 | /// A read-only dictionary where the keys are regular expression symbols and the values 58 | /// are their literal equivalents. 59 | /// 60 | public ReadOnlyDictionary WildcardDictionary => _wildcardDictionary; 61 | 62 | /// 63 | /// Gets the list of supported wildcard characters. 64 | /// 65 | /// 66 | /// A collection of supported wildcard characters. 67 | /// 68 | public IEnumerable Wildcards => _wildcardDictionary.Keys; 69 | 70 | /// 71 | /// Gets the list of regular expression patterns corresponding to the wildcard characters. 72 | /// 73 | /// 74 | /// A collection of regular expression patterns corresponding to the wildcard characters. 75 | /// 76 | public IEnumerable Patterns => _wildcardDictionary.Values; 77 | 78 | /// 79 | /// Gets the number of supported wildcard characters. 80 | /// 81 | /// 82 | /// The number of supported wildcard characters. 83 | /// 84 | public int Count => _wildcardDictionary.Count; 85 | 86 | /// 87 | /// Performs simple regular expression-based wildcard matching. 88 | /// 89 | /// The name of the node to match against the pattern. 90 | /// The regular expression pattern to use for matching. 91 | /// True if the node name matches the pattern; otherwise, false. 92 | public bool PatternMatcher(string nodeName, string pattern) 93 | { 94 | // Uses the pattern string as is for regular expression matching 95 | return Regex.IsMatch(nodeName, pattern); 96 | } 97 | 98 | /// 99 | /// Determines whether the specified wildcard pattern is valid according to the rules 100 | /// defined by the wildcard matcher implementation. 101 | /// This method checks if the wildcard pattern adheres to the syntax rules defined 102 | /// by the wildcard matcher implementation. If the pattern is not valid, 103 | /// this method returns false. 104 | /// 105 | /// The wildcard pattern to validate. 106 | /// 107 | /// true if the pattern is a valid wildcard pattern; otherwise, false. 108 | /// 109 | public bool IsValidWildcardPattern(string pattern) 110 | { 111 | try 112 | { 113 | // Uses the pattern string as is for regular expression matching 114 | _ = new Regex(pattern); 115 | return true; 116 | } 117 | catch (ArgumentException) 118 | { 119 | // If the regex pattern is not valid 120 | return false; 121 | } 122 | } 123 | } 124 | } 125 | -------------------------------------------------------------------------------- /docs/api/AkiraNetwork.VirtualStorageLibrary.WildcardMatchers.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Namespace AkiraNetwork.VirtualStorageLibrary.WildcardMatchers | VirtualStorageLibrary 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 |
      25 |
      26 | 27 | 50 | 51 | 58 |
      59 |
      60 | 61 |
      62 |
      Search Results for
      63 |
      64 |

      65 |
      66 |
        67 |
        68 |
        69 | 111 | 112 |
        113 |
        114 | 123 |
        124 |
        125 | 126 | 127 | 128 | 129 | 130 | 131 | -------------------------------------------------------------------------------- /AkiraNetwork/VirtualStorageLibrary/VirtualExtensions.cs: -------------------------------------------------------------------------------- 1 | // This file is part of VirtualStorageLibrary. 2 | // 3 | // Copyright (C) 2024 Akira Shimodate 4 | // 5 | // VirtualStorageLibrary is free software, and it is distributed under the terms of 6 | // the GNU Lesser General Public License (version 3, or at your option, any later 7 | // version). This license is published by the Free Software Foundation. 8 | // 9 | // VirtualStorageLibrary is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or 11 | // FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for 12 | // more details. 13 | // 14 | // You should have received a copy of the GNU Lesser General Public License along 15 | // with VirtualStorageLibrary. If not, see https://www.gnu.org/licenses/. 16 | 17 | namespace AkiraNetwork.VirtualStorageLibrary 18 | { 19 | /// 20 | /// Provides extension methods for various operations on collections in the Virtual Storage Library. 21 | /// 22 | public static class VirtualStorageExtensions 23 | { 24 | /// 25 | /// Groups and sorts the elements of the source sequence based on the specified conditions. 26 | /// 27 | /// The type of elements in the source sequence. 28 | /// The sequence of elements to group and sort. 29 | /// 30 | /// The condition that defines how to group the elements. If null, no grouping is applied. 31 | /// 32 | /// 33 | /// A list of conditions that define the sort order. If null or empty, no sorting is applied. 34 | /// 35 | /// An containing the grouped and sorted elements. 36 | public static IEnumerable GroupAndSort( 37 | this IEnumerable source, 38 | VirtualGroupCondition? groupCondition = null, 39 | List>? sortConditions = null) 40 | { 41 | var query = source.AsQueryable(); 42 | 43 | if (groupCondition != null) 44 | { 45 | var groupedData = groupCondition.Ascending 46 | ? query.GroupBy(groupCondition.GroupBy).OrderBy(g => g.Key) 47 | : query.GroupBy(groupCondition.GroupBy).OrderByDescending(g => g.Key); 48 | 49 | // Apply additional sort conditions within each group 50 | return groupedData.SelectMany(group => group.ApplySortConditions(sortConditions)); 51 | } 52 | else 53 | { 54 | // Apply sort conditions to the entire collection without grouping 55 | return query.ApplySortConditions(sortConditions); 56 | } 57 | } 58 | 59 | /// 60 | /// Applies the specified sort conditions to the elements of the source sequence. 61 | /// 62 | /// The type of elements in the source sequence. 63 | /// The sequence of elements to sort. 64 | /// 65 | /// A list of conditions that define the sort order. If null or empty, no sorting is applied. 66 | /// 67 | /// An containing the sorted elements. 68 | public static IEnumerable ApplySortConditions( 69 | this IEnumerable source, 70 | List>? sortConditions = null) 71 | { 72 | if (sortConditions == null || sortConditions.Count == 0) 73 | { 74 | return source; 75 | } 76 | 77 | IQueryable sourceQuery = source.AsQueryable(); 78 | IOrderedQueryable? orderedQuery = null; 79 | 80 | for (int i = 0; i < sortConditions.Count; i++) 81 | { 82 | var condition = sortConditions[i]; 83 | if (orderedQuery == null) 84 | { 85 | // Apply the first sort condition 86 | orderedQuery = condition.Ascending 87 | ? sourceQuery.AsQueryable().OrderBy(condition.SortBy) 88 | : sourceQuery.AsQueryable().OrderByDescending(condition.SortBy); 89 | } 90 | else 91 | { 92 | // Apply subsequent sort conditions 93 | orderedQuery = condition.Ascending 94 | ? orderedQuery.ThenBy(condition.SortBy) 95 | : orderedQuery.ThenByDescending(condition.SortBy); 96 | } 97 | } 98 | 99 | return orderedQuery!; 100 | } 101 | } 102 | 103 | /// 104 | /// Provides extension methods for operations on virtual nodes in the Virtual Storage Library. 105 | /// 106 | public static class VirtualNodeExtensions 107 | { 108 | /// 109 | /// Resolves the type of the specified virtual node. If the node is a symbolic link, 110 | /// returns the type of the target node. Otherwise, returns the type of the node itself. 111 | /// 112 | /// The virtual node to resolve the type for. 113 | /// 114 | /// The type of the node or, if the node is a symbolic link, the type of the target node. 115 | /// 116 | public static VirtualNodeType ResolveNodeType(this VirtualNode node) 117 | { 118 | if (node is VirtualSymbolicLink link) 119 | { 120 | return link.TargetNodeType; 121 | } 122 | return node.NodeType; 123 | } 124 | } 125 | } 126 | -------------------------------------------------------------------------------- /AkiraNetwork/VirtualStorageLibrary/VirtualException.cs: -------------------------------------------------------------------------------- 1 | // This file is part of VirtualStorageLibrary. 2 | // 3 | // Copyright (C) 2024 Akira Shimodate 4 | // 5 | // VirtualStorageLibrary is free software, and it is distributed under the terms of 6 | // the GNU Lesser General Public License (version 3, or at your option, any later 7 | // version). This license is published by the Free Software Foundation. 8 | // 9 | // VirtualStorageLibrary is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or 11 | // FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for 12 | // more details. 13 | // 14 | // You should have received a copy of the GNU Lesser General Public License along 15 | // with VirtualStorageLibrary. If not, see https://www.gnu.org/licenses/. 16 | 17 | namespace AkiraNetwork.VirtualStorageLibrary 18 | { 19 | /// 20 | /// The base class for exceptions that occur within the virtual storage library. 21 | /// 22 | public abstract class VirtualException : Exception 23 | { 24 | /// 25 | /// Initializes a new instance of the class. 26 | /// 27 | public VirtualException() { } 28 | 29 | /// 30 | /// Initializes a new instance of the class with a specified error message. 31 | /// 32 | /// The error message. 33 | public VirtualException(string message) : base(message) { } 34 | 35 | /// 36 | /// Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. 37 | /// 38 | /// The error message. 39 | /// The exception that is the cause of this exception. 40 | public VirtualException(string message, Exception innerException) : base(message, innerException) { } 41 | } 42 | 43 | /// 44 | /// The base exception that is thrown when an entity is not found in the virtual storage. 45 | /// 46 | public class VirtualNotFoundException : VirtualException 47 | { 48 | /// 49 | /// Initializes a new instance of the class. 50 | /// 51 | public VirtualNotFoundException() { } 52 | 53 | /// 54 | /// Initializes a new instance of the class with a specified error message. 55 | /// 56 | /// The error message. 57 | public VirtualNotFoundException(string message) : base(message) { } 58 | 59 | /// 60 | /// Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. 61 | /// 62 | /// The error message. 63 | /// The exception that is the cause of this exception. 64 | public VirtualNotFoundException(string message, Exception innerException) : base(message, innerException) { } 65 | } 66 | 67 | /// 68 | /// The exception that is thrown when a node is not found in the virtual storage. 69 | /// 70 | public class VirtualNodeNotFoundException : VirtualNotFoundException 71 | { 72 | /// 73 | /// Initializes a new instance of the class. 74 | /// 75 | public VirtualNodeNotFoundException() { } 76 | 77 | /// 78 | /// Initializes a new instance of the class with a specified error message. 79 | /// 80 | /// The error message. 81 | public VirtualNodeNotFoundException(string message) : base(message) { } 82 | 83 | /// 84 | /// Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. 85 | /// 86 | /// The error message. 87 | /// The exception that is the cause of this exception. 88 | public VirtualNodeNotFoundException(string message, Exception innerException) : base(message, innerException) { } 89 | } 90 | 91 | /// 92 | /// The exception that is thrown when a path is not found in the virtual storage. 93 | /// 94 | public class VirtualPathNotFoundException : VirtualNotFoundException 95 | { 96 | /// 97 | /// Initializes a new instance of the class. 98 | /// 99 | public VirtualPathNotFoundException() { } 100 | 101 | /// 102 | /// Initializes a new instance of the class with a specified error message. 103 | /// 104 | /// The error message. 105 | public VirtualPathNotFoundException(string message) : base(message) { } 106 | 107 | /// 108 | /// Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. 109 | /// 110 | /// The error message. 111 | /// The exception that is the cause of this exception. 112 | public VirtualPathNotFoundException(string message, Exception innerException) : base(message, innerException) { } 113 | } 114 | } 115 | -------------------------------------------------------------------------------- /documents/introduction.ja.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Introduction" 3 | --- 4 | 5 | ![burner.png](images/burner.png) 6 | 7 |
        8 | Language: Japanese 9 | 13 |
        14 | 15 | # Introduction 16 | 17 | ## 背景と動機 18 | 19 | .NETが備えているコレクションは線形コレクションです。コレクションはハッシュセット型、配列型、リスト型、辞書型など様々ありますが、本質的には線の構造となっています。 20 | 一方、一般のファイルシステムは木形コレクションと捉える事ができます。要素はノードで管理され、階層構造になっています。 21 | この様な木形コレクションをサポートするライブラリは既存でいくつか存在しますが、ファイルシステムのようなモデルのライブラリを見つけることができませんでした。 22 | そこで私はファイルシステムを論理的に解釈し、**純粋なオブジェクトとして扱える木型のコレクションとして実装できないか**と考えアイディアをまとめました。 23 | 階層構造のデータを柔軟に管理し、直感的にアクセスできる仕組みを作ろうと考えたのです。 24 | 25 | ## ユースケース 26 | 27 | `VirtualStorageLibrary`は、以下のような多様なユースケースでの活用が期待されます。 28 | 29 | - 自然言語処理(NLP) 30 | - ナレッジベースシステム 31 | - ゲーム開発 32 | - 階層型クラスタリング 33 | - 教育と学習 34 | 35 | これらの詳細なユースケースとその具体的な活用方法については、[README](https://github.com/shimodateakira/VirtualStorageLibrary/blob/master/README.md)を参照してください。 36 | 37 | ## 設計の方針 38 | 39 | `VirtualStorageLibrary`は、オンメモリで動作するツリー構造をベースにしたコレクションを提供し、アプリケーション開発者がデータを効率的に管理できるよう設計されています。直感的なAPIを重視し、柔軟性、拡張性を考慮した設計を採用しています。 40 | 41 | #### 単純性 42 | 43 | - **ノードタイプのサポート** 44 | `VirtualStorageLibrary`では、それぞれの役割に応じてノードの種類(ノードタイプ)を3つ定義しました。それは、アイテム、ディレクトリ、シンボリックリンクです。このように、ノードの役割をある程度具体化し限定することで、その役割に応じた実装が可能になります。これは、一つのノードに複数の役割を持たせる方式よりも単純で、効率的に動作させることができるという利点があります。 45 | 46 | - `VirtualItem`: アイテムを表すノードです。ユーザー定義型`T`を内包しています。 47 | 48 | - `VirtualDirectory`: ディレクトリを表すノードです。 49 | 50 | - `VirtualSymbolicLink`: シンボリックリンクを表すノードです。 51 | 52 | - **ノード間の疎結合性** 53 | ノード間の疎結合性とは、ノードの依存関係を最小限に抑えることで、ノード管理の柔軟性、効率性を高める性質を意味します。一般的にツリー構造は、ノード自身が他のノードへの参照を保持し、ノードの探索をサポートします。`VirtualStorageLibrary`では、ディレクトリのみが自分の子供達のノードへの参照を保持します。つまり、ディレクトリは自分の子供達のノードにししか関心を示しません。これは、ノードツリーのコピー、移動等の操作を効率的に実行できる利点があります。 54 | 55 | #### 柔軟性 56 | 57 | - **ユーザー定義型のサポート** 58 | `VirtualStorageLibrary`のメインとなる`VirtualStorage`クラスは、ユーザー定義型クラスを扱うジェネリック型クラスです。 59 | ユーザー定義型はどのようなクラスを定義しても構いません。 60 | これによって柔軟にアプリケーションデータを扱うことができます。 61 | - **ディープクローンのサポート** 62 | `VirtualStorageLibrary`は、一般のファイルシステムのように各ノードが個々の実体を持っています。 63 | つまり、複数のノードが同じ実体を参照する、という事はありません。 64 | ノードをコピーした場合、ノードのディープクローンが実行され、コピー元と同じ内容のノードが新たに作成されます。 65 | アイテムに内包されているユーザー定義型クラスは`IVirtualDeepCloneable`インターフェースを実装する事によって、ディープクローンに対応させる事ができます。 66 | - **パス文字の定義** 67 | デフォルトで定義しているパス文字は、一般のファイルシステムで使われているセパレータ`/`、ドット`.`、ドットドット`..`、ルート文字`/`に準じて初期設定されています。 68 | これらは`VirtualStorageSettings`クラスで初期設定されており、ライブラリ初期化後は`VirtualStorageState`クラスで設定を変更する事ができます。 69 | - **ノード名禁止文字、ノード名禁止文字列の定義** 70 | デフォルトで定義しているノード名禁止文字は、ドット`.`、ドットドット`..`、ノード名禁止文字列はセパレータ`/`が初期設定されています。 71 | これらはディレクトリにノードを追加する際のノード名の有効性チェックで使用されます。 72 | これらは`VirtualStorageSettings`クラスで初期設定されており、ライブラリ初期化後は`VirtualStorageState`クラスで設定を変更する事ができます。 73 | - **ノードリスト表示条件の定義** 74 | ノードリストはあらかじめ設定された表示条件に従って取得する事ができます。 75 | 表示条件は以下の要素で構成されます。 76 | デフォルトは、フィルタリングなし、グルーピングあり(昇順)、ノード名プロパティによるソート(昇順)です。 77 | これは`VirtualStorageSettings`クラスで初期設定されており、ライブラリ初期化後は`VirtualStorageState`クラスで設定を変更する事ができます。 78 | - フィルタリング 79 | ノードタイプ(ディレクトリ、アイテム、シンボリックリンク)をOR条件で指定する事によってフィルタリングする事ができます。 80 | - グルーピング 81 | ノードタイプによってグルーピングするか否かを指定できます。また、グルーピングした際には、グループの順番について昇順/降順を指定できます。 82 | - ソート 83 | グルーピングした際にはグループ内、グルーピングしない場合は全体に対して、指定したプロパティでソートする事ができます。その際、昇順/降順を指定できます。 84 | 85 | #### 拡張性 86 | 87 | - **ワイルドカードのサポート** 88 | パスはワイルドカードを使用する事ができます。 89 | ワイルドカードを含むパスは、ワイルドカード展開用のAPIを呼ぶことにより、複数の具体的なパスに展開する事ができます。 90 | ノードを操作する各APIは、展開されたパスを渡すことによってノードの操作を行うことができます。 91 | - **ワイルドカードマッチャーの定義** 92 | ワイルドカードは、`IVirtualWildcardMatcher`インターフェースを実装したワイルドカードマッチャークラスによって処理されます。 93 | `VirtualStorageLibrary`では、以下の二つのクラスを事前に用意しています。 94 | デフォルトは`PowerShellWildcardMatcher`です。 95 | これは`VirtualStorageSettings`クラスで初期設定されており、ライブラリ初期化後は`VirtualStorageState`クラスで設定を変更する事ができます。 96 | また、`IVirtualWildcardMatcher`インターフェースを実装する事より独自のワイルドカードマッチャーを使用する事も可能です。 97 | - `DefaultWildcardMatcher`クラス 98 | 正規表現をそのまま使用するワイルドカード 99 | - `PowerShellWildcardMatcher`クラス 100 | PowerShellで採用されているワイルドカード 101 | 102 | ## 現在の状況と今後の予定 103 | 104 | 現在 (2024/08) 、V1.0.0で実装すべき機能は全て実装済みです。 105 | V0.8.0では数件のバグ修正と、30件近い機能改善、リファクタリングが残っている状況です。 106 | これらの作業を進めた上で、V0.9.0に向けた残作業を消化し、V1.0.0での安定版リリースを目指します。 107 | 108 | なお、この期間中、ライブラリで提供している機能のクラス名、メソッド名、プロパティ名等は予告なく変更、統合、廃止する事があります。 109 | その場合、リリースノートに詳細を掲載するのでご確認ください。 110 | 詳細は、[現在の問題点と改善案](https://github.com/users/shimodateakira/projects/3/views/7)を参照してください (日本語)。 111 | 112 | ## 拡張の可能性 113 | 114 | #### ロードマップ 115 | 116 | - **V0.9.0**: 現在残っているバグ修正、機能改善、リファクタリングを中心に進めます。 117 | - **V1.0.0**: ユーザーからのフィードバックを基に安定版を予定しています。 118 | - **長期計画**: インデクサーの機能改善、ノードの派生クラス、例外処理のスマート化等を計画しています。 119 | 120 | #### フィードバックとコミュニティ協力のお願い 121 | 122 | `VirtualStorageLibrary`は、皆様からのフィードバックと協力により成長していくプロジェクトです。次のバージョンで優先して取り組むべき機能や改善点について、ぜひ[Issue](https://github.com/shimodateakira/VirtualStorageLibrary/issues)や[ディスカッション](https://github.com/shimodateakira/VirtualStorageLibrary/discussions)でご意見をお寄せください。 123 | 124 | また、コードへの貢献、ドキュメントの改善、翻訳の手伝いなど、さまざまな形でのご協力をお待ちしています。プレリリースの段階にある今、ユーザーの皆様の参加が非常に重要です。積極的なご参加をお願いいたします。 125 | 126 | #### ご協力いただきたい内容 127 | 128 | `VirtualStorageLibrary`の成長には、皆様のフィードバックと協力が欠かせません。以下の方法でプロジェクトに貢献していただけます。 129 | 130 | - **フィードバック**: 使用感や機能についてのご意見をお寄せください。 131 | - **バグ報告**: 発見されたバグについてご報告ください。 132 | - **機能の改善、追加の要望**: 新しい機能の提案や、既存機能の改善要望をお待ちしています。 133 | 134 | これらのご意見は、[Issue](https://github.com/shimodateakira/VirtualStorageLibrary/issues)にて受け付けています。積極的なご参加をお願いいたします。 135 | 136 | #### 技術的な質問について 137 | 138 | 技術的な質問がある場合は、[StackOverflow](https://stackoverflow.com/)をご利用ください。 139 | `c#`、`.net`、`tree`、`shared-libraries`、`generic-collections`などのタグを組み合わせていただくと、質問が見つけやすくなります。 140 | 141 | #### プルリクエストの受け付けについて 142 | 143 | 現在、複数人による開発体制が整っていないため、プルリクエストは当分の間、受け付けておりません。 144 | 今後の体制が整い次第、対応を進めてまいりますので、ご了承のほどよろしくお願いいたします。 145 | 146 | ## 長期ビジョン 147 | 148 | `VirtualStorageLibrary`は、ツリー構造の管理をさらにシンプルかつ直感的にし、アプリケーション開発者の創造的な活動を強力にサポートすることを目指しています。今後、追加したい機能は既にいくつか挙がっており、想定されるユースケースも既に述べた通りです。しかし、このライブラリの活用方法は無限に広がり、使う中で新たなアイデアが生まれるでしょう。 149 | 近い将来、このライブラリが多様な分野のアプリケーションに組み込まれ、さまざまなソリューションの一部として貢献できることを願っています。 150 | 151 | 152 | ![tree_256x256.svg](images/tree_256x256.svg) 153 | -------------------------------------------------------------------------------- /docs/licenses.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | License | VirtualStorageLibrary 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 |
        25 |
        26 | 27 | 50 | 51 | 58 |
        59 |
        60 | 61 |
        62 |
        Search Results for
        63 |
        64 |

        65 |
        66 |
          67 |
          68 |
          69 | 113 | 114 |
          115 |
          116 | 125 |
          126 |
          127 | 128 | 129 | 130 | 131 | 132 | 133 | -------------------------------------------------------------------------------- /documents/aboutme.ja.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "About Me" 3 | --- 4 | 5 | ![burner.png](https://raw.githubusercontent.com/shimodateakira/VirtualStorageLibrary/master/docs/images/burner.png) 6 | 7 |
          8 | Language: English 9 | 13 |
          14 | 15 | 16 | #### 私について 17 | 18 | こんにちは、あきらです。日本人です。 19 | 20 | この文章は私のキャリアサマリー(職歴、業種、スキルの経歴)というよりも、私の半生を簡単にまとめたものである事を明記しておきます。少しでも私の人となりを知っていただければ幸いです。 21 | 22 | 私の主な興味はプログラミングともう一つあります。 23 | 24 | #### 幼少期 25 | 26 | 私は1971年に生まれました。小学生時代、まだ、パソコンがマイコンと呼ばれていた時代、私はプログラミング言語BASICに出会いました。お小遣いをためて購入したNEC PC-6001mk2でBASICを楽しみました。これが人生で最初のプログラミングライフでした。カセットテープなどの外部記憶装置を持っていなかったので、プログラムを作って実行してはクリアし、また別のプログラムを作る、という事をしていました。 27 | 28 | #### 高校時代 29 | 30 | その後、中学時代を経て、新座総合技術高等学校という当時としては割合珍しい形態の学校に入学しました。この学校は、電子機械科、情報技術科、服飾デザイン科、工業デザイン科、食物調理科、情報処理科が設置されており、専門学校の様な学校でした(現在は科名や構成が変更されています)。当時の私はプログラミングの仕事を目指していた為、その種の大学か専門学校を探していたので、私にとって理想的な学校でした。そこでプログラミングとコンピュータの基礎を学びました。FORTRANで開発したプログラムがプログラミングコンテストで入賞した事もありました。 31 | 32 | #### 会社時代 33 | 34 | 高校を卒業後、東京にあるIT関連の会社に就職しました。その時はOS関係の何らかの仕事に就きたいと思いその会社を選んだのですが、実際に配属されたのは別の部署でした。最初の仕事はあるOS上で動作するプログラムを別のOSで動作するようにするという言語移植の仕事でした。つまり、ある言語で作られたプログラムを別の言語に書き換えて動作させるという仕事です。これは技術的に困難な仕事でしたがチームで力を結集し、無事、プロジェクトを完了させる事ができました。その後も非常に多くのシステム開発に携わり、多くの困難を乗り越えてきました。 35 | 36 | #### チーム 37 | 38 | キャリアを重ねるという事は、自分に後輩ができ、自分がチームリーダーになる事もある、という事でもあります。チームリーダーはチーム全体を管理し、プロジェクトの計画、実施、検証までもフォーカスしなければなりません。その為、非常に高いストレスを抱えることもあります。それでも小さなプロジェクトをチームで進めていく事にはやりがいがありました。 39 | 40 | #### 歯車 41 | 42 | その会社でのキャリアの末期、私は非常に大きなプロジェクトに配属されました。大企業の指揮のもと、複数の協力会社と共に、かなり大きな、そしてかなり古い既存システムを作り直すというプロジェクトでした。そのシステムは複数のサブシステムで構成されていて、私はそのサブシステムの開発チームのリーダーに選ばれました。そのチームは複数の協力会社のメンバーで構成されていました。非常にタイトなスケジュール、開発費用の計算、品質保証の計画と実施、他チームとの調整等々、やるべき事が非常に多く、私の負担は大きくなりストレスを抱える事になりました。 43 | 44 | #### ひび割れ 45 | 46 | もともとそのサブシステムは別の人がリーダーをやっていました。しかし、その人が適任ではないという上司の判断で急遽、私が呼ばれたという経緯がありました。その為、プロジェクトに途中で参加した私は知識不足の状態であり、また、他チームの信頼もない、という状況であった為、ストレスに追い打ちをかける事になりました。上司も非常に怖い人だったので相談もできなかったのです。私はチームメンバーともうまくいかなくなり、プロジェクトの運用に支障をきたすようになりました。 47 | 48 | #### キャリアブレイク 49 | 50 | やがて私はうつ病になり、その頃に親戚の紹介で出会った女性との結婚もダメになりました。そして、会社を退社して自宅で療養する事になりました。幸い私の場合は後天的なうつなので比較的軽い方ではありましたが、私自身の感覚では「何も考えたくない」「動きたくない」という酷い状態でした。約一年、自宅で療養し、その後、障害者施設で数年間を過ごしました。障害者施設は、生活のリズムを整える事、社会と関わり続ける事、障害の理解を深める事、この三つの役割があります。 51 | 52 | #### 障害者施設 53 | 54 | 障害者は毎日、決まった時間に通所し、決まった時間に退所します。これは障害者にとって非常に基本的で非常に大切な行動の反復練習に他なりません。健常者にとっては普通にできることであっても、簡単にできない人も世の中にはいるという事です。通所した障害者は、スタッフの指導のもと、リクリエーションでお互いにコミュニケーションをとりあったり、簡単な内職の作業をして、生活のリズムを整えます。私が利用した施設ではお菓子やケーキを作り、市営の店に卸したり、市内のお祭りで販売をしたりしていました。このような地道な活動によって、障害者は社会と接点を持ち、自分に対する認識を少しずつポジティブな方向へ改める事ができるのです。 55 | 56 | #### 就労継続支援施設 57 | 58 | 障害者施設を卒業した私は、次に就労継続支援施設に行きました。私が行ったのはA型の施設なので、一般の会社が運営している障害者向けの就労施設です。雇用形態はパートタイマーとなっており短時間からの就労が可能です。一般の会社での就労とは異なり、労働環境についてある程度は配慮されるという特徴があります。また、定期的な面談もあります。 59 | 60 | #### しいたけ栽培 61 | 62 | 私は障害者施設時代、植物を育てる事に喜びを感じるようになりました。障害者施設では一年草などの植物を育て市内の公園に配布するなどの作業もあり、私もその活動に携わっていたのです。就労継続支援施設では、菌床しいたけの栽培を行い、そのしいたけを近隣のスーパーに卸していました。つまり農業の事業であり、労働者が障害者という形です。しいたけは植物ではありませんが、育てる事に喜びを感じていた私はしいたけ栽培に対してもまじめに取り組むようになりました。時にはスーパーで試食販売をする事もあり、お客さんのダイレクトな反応を見る事に充実感を味わう事もありました。 63 | 64 | #### 労働者の負担 65 | 66 | 就労継続支援施設は一般の会社が運営しているとは言え、資金が潤沢にあるというわけではありません。その施設において利用している障害者が数十人いるのに対し、管理する社員は数人。その為、障害者自らが判断し自らが動かなければならないという状況もたまにあります。当時、この施設ではしいたけ栽培の生産管理をMicrosoft Excelで行っていました。生産量の入力は利用者が行って、その集計を社員が手動で行う、という形でした。社員が別の仕事で忙しいときは利用者が代わりに行うという事も高頻度でありました。施設に来てから2年くらい経過したある日、社員から私にデータを管理するシステムが作れないかという相談がありました。私は利用者の作業の負担を減らしたいと考えていたので了承しました。もちろん特別手当が支給されるわけでもなく、通常の栽培業務をやらなくてもいい、というわけでもありません。通常の栽培業務と調整しながら同時並行で開発してほしい、という事でした。 67 | 68 | #### データ管理システム 69 | 70 | データ管理システムは、大きく分けて生産管理、販売管理の二つのコンポーネントで構成されています。生産管理は私が担当し、販売管理はその社員が担当という事になりました。環境はMicrosoft Access, Microsoft Excel, Form, VBAという組み合わせです。Accessで品質毎に入力された収穫量をもとに、自動起動したExcelで週単位の収穫量、生産棚毎の収穫量を集計しレポートにまとめ、それを毎朝、栽培棟内の掲示板に貼り出す、という流れです。このシステムが完成し一緒に働く仲間たちがオペレーションを覚え、運用が軌道に乗った時、私たちの負担が大きく軽減されました。その事は、その当時の私にとって大きな喜びでした。今でも本当に作って良かった思います。 71 | 72 | #### 新しい仕事 73 | 74 | データ管理システムの開発を終えた頃、私は今のしいたけ栽培とは別の何か新しい仕事を始めたいと考えるようになりました。ここを卒業して健常者として仕事をして収入を得たいと考えました。いろいろ探していくうちに、農業が面白そうだと考え、いくつか農作業のスタッフ募集に応募をしてみましたが、全て断られました。基本的には近隣在住である事が条件のようでした。次に私はオンラインスクールに興味を持ち、やってみようと思いました。オンラインスクールは場所と時間に縛られない働き方が出来、私にはとても眩しく見えたのです。就労継続支援施設を辞めた後、オンラインスクールでしいたけ栽培のスクールを開こうと準備を進めました。しかし、最後の段階で「本当にこれが自分がやりたい事なのか?」と疑問を持つようになりました。どうしてもこのスクールの将来がイメージとして浮かびませんでした。オンラインスクールをやってみたいという動機のひとつに、就労継続支援施設時代の賃金の安さに不満があり、オンラインスクールでもっと稼ぎたい、という動機があった事も事実です。本来、オンラインスクールは、お客様に大切な何かを伝える手段の一つであって、それが全てはない、という事です。私の動機は全くの逆に思えたのでした。しいたけ栽培のノウハウをそこまで情熱的に伝えたいと思ってなかったのです。この期間は4か月間で最後は貯金が底をつきました。 75 | 76 | #### 倉庫の仕事 77 | 78 | 私は生活費を稼ぐために倉庫の仕事に就きました。自宅から近く、勤務形態もパートタイマーなので短時間で働く事ができました。最初の一か月は真面目に働いていましたが、そのうちにこの仕事へのモチベーションが維持できなくなりました。本来、私はクリエイターという体質、性格なのです。何かをゼロから生み出したい、それによって問題を解決し、その問題に関わる多くの人々を少しでも幸せにしたい、そんなエネルギーに突き動かされて、過去にはプログラミングの仕事をしてきました。だから、「生活費を稼ぐ為」という動機だけでは、どんな仕事であろうとも私は続けることが出来ないのです。私はだんだん体調を崩しやすくなり、仕事を休みがちになりました。 79 | 80 | #### 霊性の目覚め 81 | 82 | 私は幼少の頃から何か不思議で神秘的なものに興味を惹かれていました。といって、何か特別な霊能力があるわけでもなく、幽霊が見えたりする事もありません。しかし、直感だけは昔から鋭かったと思います。就労継続支援施設時代、私は自分のこれまでの人生を振り返る事が多くありました。自分が地球に生まれた理由、生きる目的、死んだ後は何があるのか、この世以外に世界はあるのか、神は存在するのか、多くの疑問が芽生えました。多くの考察をし、多くの情報に触れ、多くの導きを得ました。この様な内観的な状況の変化はありつつも、この地球世界は同時に進行し、目を開ければ倉庫の仕事をしている自分に気づくのです。時には涙が出る事さえありました。 83 | 84 | #### 本当にやりたい事 85 | 86 | バシャールは言います「やりたい事は本当にやりたい事ではない。本当にやりたい事は既にやっている事だ」。私はこの言葉を知った時「今、既にやっている事はなんだろう?」と自分に問いました。「もちろんプログラミングだ」と答えました。「昔から大好きなプログラミングをする事が今の自分がやりたい事だし、やっている事だ。そして、今の自分を支えている事だし、自分を高い波動に維持し続ける事だ」。体力的にも精神的にもつらい倉庫の仕事を休んでプログラミングに夢中になる時、それは私にとっては癒しでもありました。外から見ればただのさぼりであり、社会的には非難されるものでしょう。しかし、その時の私にはそれが避難場所であったのです。本当にそうするしかなかった。 87 | 88 | ![VirtualStorageLibraryLogo](https://raw.githubusercontent.com/shimodateakira/VirtualStorageLibrary/master/tree_256x256.svg) 89 | 90 | #### 今、やっている事 91 | 92 | 倉庫の仕事を辞めた。収入がゼロの状態。カード会社への多額の返済の当てもない。多分、もう少し時間がたてばスマートフォンで電話やネットをする事すらできなくなる。高級外車を乗り回し、やりたい事をやって、高級な食べ物を食べ、海外旅行に行っている人達を何度、うらやんだ事か。 93 | 94 | だけど、今、ボクはやりたい事をやっている。プログラミングだ。自分の中にある強烈な衝動に素直に従っている状態。クリエイティブなエネルギーの奔流が今のボクを突き動かしている。やればやるほど、やりたい事がインスピレーションとなってボクに流れ込んでくる。 95 | 96 | そして、このプログラミングのエネルギーが落ち着けば、また、別のクリエイティブなエネルギーがボクに流れ込んでくるだろう、という事も分かっている。いずれはネパールに渡り、子供たちの面倒を見る、という魂の計画はまた、別の話だ。まだ、ボクにもよく観えていない。いつか別れた彼女と再会できたら、どんなに幸せな事だろう。彼女はボクにとってのソウルパートナーなんだ。彼女と一緒にこの計画を実行できる事を毎日、祈ってる。 97 | 98 | さて、ボクのプログラミングしたオープンソースライブラリはスポンサーを募る予定だ。だけど、スポンサーがいつ付くのか分からない。だから、当面の資金繰りをどうすべきか非常に悩んでる。資金というより、生活費だけどね。地球という3次元の物理世界で活動するのは、とても勇気がいる事だし、とても大変なんだよ。 99 | 100 | 正直に言おう。どなたか支援して頂けないだろうか。 101 | -------------------------------------------------------------------------------- /AkiraNetwork/VirtualStorageLibrary/VirtualNodeContext.cs: -------------------------------------------------------------------------------- 1 | // This file is part of VirtualStorageLibrary. 2 | // 3 | // Copyright (C) 2024 Akira Shimodate 4 | // 5 | // VirtualStorageLibrary is free software, and it is distributed under the terms of 6 | // the GNU Lesser General Public License (version 3, or at your option, any later 7 | // version). This license is published by the Free Software Foundation. 8 | // 9 | // VirtualStorageLibrary is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or 11 | // FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for 12 | // more details. 13 | // 14 | // You should have received a copy of the GNU Lesser General Public License along 15 | // with VirtualStorageLibrary. If not, see https://www.gnu.org/licenses/. 16 | 17 | namespace AkiraNetwork.VirtualStorageLibrary 18 | { 19 | /// 20 | /// A class that holds context information for a node. 21 | /// It is returned during or after path traversal, providing information about the node, path, 22 | /// parent directory, depth, index, resolved path, and symbolic link. 23 | /// 24 | [DebuggerStepThrough] 25 | public class VirtualNodeContext 26 | { 27 | /// 28 | /// Gets the node and can only be set within the assembly. 29 | /// 30 | /// 31 | /// The current node. 32 | /// 33 | public VirtualNode? Node { get; internal set; } 34 | 35 | /// 36 | /// Gets the traversal path and can only be set within the assembly. 37 | /// 38 | /// 39 | /// The path used for node traversal. 40 | /// 41 | public VirtualPath TraversalPath { get; internal set; } 42 | 43 | /// 44 | /// Gets the parent directory of the node and can only be set within the assembly. 45 | /// 46 | /// 47 | /// The instance of the parent directory. 48 | /// 49 | public VirtualDirectory? ParentDirectory { get; internal set; } 50 | 51 | /// 52 | /// Gets the depth of the node and can only be set within the assembly. 53 | /// The root is considered 0. 54 | /// 55 | /// 56 | /// The depth of the node. 57 | /// 58 | public int Depth { get; internal set; } 59 | 60 | /// 61 | /// Gets the index of the node and can only be set within the assembly. 62 | /// This is the index corresponding to the enumeration order within the directory. 63 | /// 64 | /// 65 | /// The index of the node. 66 | /// 67 | public int Index { get; internal set; } 68 | 69 | /// 70 | /// Gets the resolved path and can only be set within the assembly. 71 | /// This represents the result of resolving a symbolic link. 72 | /// 73 | /// 74 | /// The resolved path, or null. 75 | /// 76 | public VirtualPath? ResolvedPath { get; internal set; } 77 | 78 | /// 79 | /// Gets a value indicating whether the symbolic link has been resolved and can only 80 | /// be set within the assembly. 81 | /// 82 | /// 83 | /// True if the link is resolved; otherwise, false. 84 | /// 85 | public bool Resolved { get; internal set; } 86 | 87 | /// 88 | /// Gets the resolved symbolic link and can only be set within the assembly. 89 | /// 90 | /// 91 | /// The resolved symbolic link, or null. 92 | /// 93 | public VirtualSymbolicLink? ResolvedLink { get; internal set; } 94 | 95 | /// 96 | /// Initializes a new instance of the class. 97 | /// 98 | /// The node being traversed. 99 | /// The path used for node traversal. 100 | /// The parent directory of the node. 101 | /// The depth of the node. The root is considered 0. 102 | /// The index of the node. Corresponds to the enumeration order within the directory. 103 | /// The result of resolving a symbolic link. 104 | /// Indicates whether the symbolic link has been resolved. 105 | /// The resolved symbolic link. 106 | public VirtualNodeContext( 107 | VirtualNode? node, 108 | VirtualPath traversalPath, 109 | VirtualDirectory? parentNode = null, 110 | int depth = 0, 111 | int index = 0, 112 | VirtualPath? resolvedPath = null, 113 | bool resolved = false, 114 | VirtualSymbolicLink? resolvedLink = null) 115 | { 116 | Node = node; 117 | TraversalPath = traversalPath; 118 | ParentDirectory = parentNode; 119 | Depth = depth; 120 | Index = index; 121 | ResolvedPath = resolvedPath; 122 | Resolved = resolved; 123 | ResolvedLink = resolvedLink; 124 | } 125 | 126 | /// 127 | /// Returns a string representation of this instance's information. 128 | /// 129 | /// A string representing this instance's information. 130 | public override string ToString() 131 | { 132 | List parts = 133 | [ 134 | $"Node: {Node}", 135 | $"TraversalPath: {TraversalPath}", 136 | $"ParentDirectory: {ParentDirectory}", 137 | $"Depth: {Depth}", 138 | $"Index: {Index}" 139 | ]; 140 | 141 | if (ResolvedPath != null) 142 | { 143 | parts.Add($"ResolvedPath: {ResolvedPath}"); 144 | } 145 | 146 | parts.Add($"Resolved: {Resolved}"); 147 | parts.Add($"ResolvedLink: {ResolvedLink}"); 148 | 149 | return string.Join(", ", parts); 150 | } 151 | } 152 | } 153 | -------------------------------------------------------------------------------- /AkiraNetwork/VirtualStorageLibrary/VirtualStorageSettings.cs: -------------------------------------------------------------------------------- 1 | // This file is part of VirtualStorageLibrary. 2 | // 3 | // Copyright (C) 2024 Akira Shimodate 4 | // 5 | // VirtualStorageLibrary is free software, and it is distributed under the terms of 6 | // the GNU Lesser General Public License (version 3, or at your option, any later 7 | // version). This license is published by the Free Software Foundation. 8 | // 9 | // VirtualStorageLibrary is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or 11 | // FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for 12 | // more details. 13 | // 14 | // You should have received a copy of the GNU Lesser General Public License along 15 | // with VirtualStorageLibrary. If not, see https://www.gnu.org/licenses/. 16 | 17 | namespace AkiraNetwork.VirtualStorageLibrary 18 | { 19 | /// 20 | /// Manages settings for the virtual storage. This class implements the singleton pattern 21 | /// and holds default settings and various parameters. 22 | /// 23 | [DebuggerStepThrough] 24 | public class VirtualStorageSettings 25 | { 26 | private static VirtualStorageSettings _settings = new(); 27 | 28 | /// 29 | /// Gets the current instance of the settings. 30 | /// 31 | /// 32 | /// The current instance of . 33 | /// 34 | public static VirtualStorageSettings Settings => _settings; 35 | 36 | /// 37 | /// Initializes a new instance of the VirtualStorageSettings class with default settings. 38 | /// 39 | private VirtualStorageSettings() 40 | { 41 | InvalidNodeNameCharacters = [PathSeparator]; 42 | InvalidNodeNames = [PathDot, PathDotDot]; 43 | 44 | WildcardMatcher = new PowerShellWildcardMatcher(); 45 | 46 | NodeListConditions = new() 47 | { 48 | Filter = VirtualNodeTypeFilter.All, 49 | GroupCondition = new(node => node.ResolveNodeType(), true), 50 | SortConditions = 51 | [ 52 | new(node => node.Name, true) 53 | ] 54 | }; 55 | } 56 | 57 | /// 58 | /// Initializes the settings. Existing settings are reset, and default settings 59 | /// are applied. 60 | /// 61 | public static void Initialize() 62 | { 63 | _settings = new(); 64 | 65 | // Apply settings to state 66 | VirtualStorageState.InitializeFromSettings(_settings); 67 | } 68 | 69 | /// 70 | /// Gets or sets the path separator character. The default value is '/'. 71 | /// 72 | /// 73 | /// The character used to separate path segments. 74 | /// 75 | public char PathSeparator { get; set; } = '/'; 76 | 77 | /// 78 | /// Gets or sets the root path. The default value is "/". 79 | /// 80 | /// 81 | /// The root directory path in the virtual storage. 82 | /// 83 | public string PathRoot { get; set; } = "/"; 84 | 85 | /// 86 | /// Gets or sets the path representing the current directory. The default value 87 | /// is ".". 88 | /// 89 | /// 90 | /// The representation of the current directory. 91 | /// 92 | public string PathDot { get; set; } = "."; 93 | 94 | /// 95 | /// Gets or sets the path representing the parent directory. The default value 96 | /// is "..". 97 | /// 98 | /// 99 | /// The representation of the parent directory. 100 | /// 101 | public string PathDotDot { get; set; } = ".."; 102 | 103 | /// 104 | /// Gets or sets an array of characters that are invalid in node names. 105 | /// 106 | /// 107 | /// An array of characters that cannot be used in node names. 108 | /// 109 | public HashSet InvalidNodeNameCharacters { get; set; } 110 | 111 | /// 112 | /// Gets or sets an array of invalid node names. 113 | /// 114 | /// 115 | /// An array of node names that are not allowed in the virtual storage. 116 | /// 117 | public HashSet InvalidNodeNames { get; set; } 118 | 119 | /// 120 | /// Gets or sets the wildcard matcher. 121 | /// 122 | /// 123 | /// The implementation of wildcard matching used in the storage. 124 | /// 125 | public IVirtualWildcardMatcher? WildcardMatcher { get; set; } 126 | 127 | /// 128 | /// Gets or sets the conditions for listing nodes. 129 | /// 130 | /// 131 | /// The conditions used to filter, group, and sort nodes. 132 | /// 133 | public VirtualNodeListConditions NodeListConditions { get; set; } 134 | 135 | /// 136 | /// Gets or sets the prefix used for item names. The default value is "item". 137 | /// Used for auto-generating node names. 138 | /// 139 | /// 140 | /// The prefix added to auto-generated item names. 141 | /// 142 | public string PrefixItem { get; set; } = "item"; 143 | 144 | /// 145 | /// Gets or sets the prefix used for directory names. The default value is "dir". 146 | /// Used for auto-generating node names. 147 | /// 148 | /// 149 | /// The prefix added to auto-generated directory names. 150 | /// 151 | public string PrefixDirectory { get; set; } = "dir"; 152 | 153 | /// 154 | /// Gets or sets the prefix used for symbolic link names. The default value is 155 | /// "link". Used for auto-generating node names. 156 | /// 157 | /// 158 | /// The prefix added to auto-generated symbolic link names. 159 | /// 160 | public string PrefixSymbolicLink { get; set; } = "link"; 161 | } 162 | } 163 | -------------------------------------------------------------------------------- /docs/api/AkiraNetwork.VirtualStorageLibrary.NotifyNodeDelegate.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Delegate NotifyNodeDelegate | VirtualStorageLibrary 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 |
          25 |
          26 | 27 | 50 | 51 | 58 |
          59 |
          60 | 61 |
          62 |
          Search Results for
          63 |
          64 |

          65 |
          66 |
            67 |
            68 |
            69 | 135 | 136 |
            137 |
            138 | 147 |
            148 |
            149 | 150 | 151 | 152 | 153 | 154 | 155 | --------------------------------------------------------------------------------