From 3e588f0ac994ff57189818ef7f5cbe0b952332cc Mon Sep 17 00:00:00 2001 From: yyc12345 Date: Sun, 19 Apr 2026 16:10:04 +0800 Subject: [PATCH] doc: update some doc --- README.md | 14 +++++++------- wfassoc-exec/README.md | 6 ++++-- wfassoc/README.md | 13 +++++++++++-- wfassoc/src/highlevel.rs | 29 ++++++++++++++++++++++++++++- 4 files changed, 50 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index a975c0a..ce83b0a 100644 --- a/README.md +++ b/README.md @@ -7,20 +7,20 @@ ## Introduction * `wfassoc`: Core Rust library. Rust programmer can directly utilize it. -* `wfassoc_dylib`: A dynamic library exposed for C/C++ and other languages users. -* `wfassoc_exec`: A executable configuring file assocation according to user given profile and request. +* `wfassoc-cdylib`: A dynamic library exposed for C/C++ and other languages users. +* `wfassoc-exec`: A executable configuring file assocation according to user given profile and request. If you are a programmer who just want to silently set your file associations for user, -`wfassoc_exec` would be your best choice. +`wfassoc-exec` would be your best choice. The only thing you need to do is that write a manifest TOML file, -and provide it and `wfassoc_exec` with your executable. -By executing `wfassoc_exec` with this TOML file in your executable, +and provide it and `wfassoc-exec` with your executable. +By executing `wfassoc-exec` with this TOML file in your executable, you can simply achieve this goal, by analyse its return value to check whether it success. However, if you are prefering that let user decide which file associations should be created, even have an UI displaying all current file associations related with this program (like 7-Zip File Manager does), -you can choose `wfassoc_dylib` as your solution. -`wfassoc_dylib` exposes all essential functions for this task. +you can choose `wfassoc-cdylib` as your solution. +`wfassoc-cdylib` exposes all essential functions for this task. And you can build it with your own program. At last, if all scenarios above can not cover your requirements, diff --git a/wfassoc-exec/README.md b/wfassoc-exec/README.md index 1e6f5eb..e48afef 100644 --- a/wfassoc-exec/README.md +++ b/wfassoc-exec/README.md @@ -2,6 +2,8 @@ For the syntax of this executable's parameters, execute it with `--help` for more. -For how to write manifest TOML file passed to `config` parameter, please see our example located in `example/ppic.toml`. +For how to write manifest TOML file passed to `config` parameter, +please see our example located in `example/manifest/ppic.toml`. -Please note that the value passed to `for` parameter should be consistent when calling `query`, `register` and `unregister`. For example you should not call `register` with `--for user`, and call `unregister` with `--for system` later. +Please note that the value passed to `for` parameter should be consistent when calling `query`, `register` and `unregister`. +For example you should not call `register` with `--for user`, and call `unregister` with `--for system` later. diff --git a/wfassoc/README.md b/wfassoc/README.md index 373a503..7aad4d5 100644 --- a/wfassoc/README.md +++ b/wfassoc/README.md @@ -1,3 +1,12 @@ -# Wfassoc Core +# WFassoc Core -Most Windows related struct are located in `assoc` module. The top module only contain structs exposed for convenient use of end user. +This crate provides low level API and high level API for manipulating Windows file associations at the same time. +For the convenient use of this project, the root module of this crate re-expose high level API. +So programmers can directly use them. + +High level API is type-safe and very easy to use for common application. +For visiting high level API, please use crate root module directly or `highlevel` module. +Oppositely, for visiting low level API, please use `lowlevel` module. + +If you are a programmer who want to take a deep into the internal implementations, +see `win32` module and its submodules for detail. diff --git a/wfassoc/src/highlevel.rs b/wfassoc/src/highlevel.rs index 5f6493d..6df9bc9 100644 --- a/wfassoc/src/highlevel.rs +++ b/wfassoc/src/highlevel.rs @@ -23,6 +23,10 @@ pub enum ProgramError {} // endregion +// region: Schema + +// region: Schema Body + /// Schema is the sketchpad of complete Program. /// /// We will create a Schema first, fill some properties, add file extensions, @@ -125,6 +129,10 @@ impl Schema { } } +// endregion + +// region: Schema Internals + /// Internal used struct as the Schema file extensions hashmap value type. #[derive(Debug)] struct SchemaExt { @@ -143,8 +151,18 @@ impl SchemaExt { } } +// endregion + +// endregion + +// region: Program + +// region: Program Body + /// Program is a complete and immutable program representer -pub struct Program {} +pub struct Program { + +} impl TryFrom for Program { type Error = ParseProgramError; @@ -159,3 +177,12 @@ impl Program { todo!() } } + +// endregion + +// region: Program Internals + + +// endregion + +// endregion