File tree Expand file tree Collapse file tree 4 files changed +61
-4
lines changed Expand file tree Collapse file tree 4 files changed +61
-4
lines changed Original file line number Diff line number Diff line change @@ -7,9 +7,11 @@ license = "MIT/NCSA"
77documentation = " https://docs.rs/msvc-demangler/"
88description = " A rust library that demangles / undecorates C++ symbols mangled by MSVC"
99repository = " https://github.com/mstange/msvc-demangler-rust"
10+ readme = " README.md"
1011
1112[dependencies ]
1213bitflags = " 1.0.1"
1314
1415[[bin ]]
1516name = " undname"
17+ path = " src/bin/undname.rs"
Original file line number Diff line number Diff line change @@ -28,3 +28,9 @@ test: test-cargo test-wasm-build
2828lint :
2929 @rustup component add clippy --toolchain stable 2> /dev/null
3030 @cargo +stable clippy --all --tests -- -D clippy::all
31+ .PHONY : lint
32+
33+ update-readme :
34+ @cargo-readme -V & > /dev/null || cargo install cargo-readme
35+ @cargo readme > README.md
36+ .PHONY : update-readme
Original file line number Diff line number Diff line change 1+ # msvc-demangler
2+
3+ msvc-demangler is a crate for Rust that can demangle C++ symbols which use
4+ the MSVC mangling scheme. These are emitted by the Microsoft C++ compiler
5+ for Windows as well as some others.
6+
7+ ## Example
8+
9+ ``` rust
10+ use msvc_demangler;
11+ let flags = msvc_demangler :: DemangleFlags :: llvm ();
12+ let result = msvc_demangler :: demangle (" ??_0klass@@QEAAHH@Z" , flags ). unwrap ();
13+ println! (" {}" , result );
14+ ```
15+
16+ ## Behavior
17+
18+ It's functionality is similar to ` undname ` on Windows and the underlying
19+ ` UnDecorateSymbolName ` function. Since Microsoft does not document the
20+ mangling scheme this is likely not to be entirely accurate. When unclear
21+ the implementation tries to follow what LLVM does.
22+
23+ ## License
24+
25+ This msvc-demangler is dual licensed under the MIT and the University of
26+ Illinois Open Source Licenses.
27+
28+ License: MIT/NCSA
Original file line number Diff line number Diff line change 1- // This file is dual licensed under the MIT and the University of Illinois Open
2- // Source Licenses. See LICENSE.TXT for details.
3- //
4- // This file defines a demangler for MSVC-style mangled symbols.
1+ //! msvc-demangler is a crate for Rust that can demangle C++ symbols which use
2+ //! the MSVC mangling scheme. These are emitted by the Microsoft C++ compiler
3+ //! for Windows as well as some others.
4+ //!
5+ //! # Example
6+ //!
7+ //! ```
8+ //! use msvc_demangler;
9+ //! let flags = msvc_demangler::DemangleFlags::llvm();
10+ //! let result = msvc_demangler::demangle("??_0klass@@QEAAHH@Z", flags).unwrap();
11+ //! println!("{}", result);
12+ //! ```
13+ //!
14+ //! # Behavior
15+ //!
16+ //! It's functionality is similar to `undname` on Windows and the underlying
17+ //! `UnDecorateSymbolName` function. Since Microsoft does not document the
18+ //! mangling scheme this is likely not to be entirely accurate. When unclear
19+ //! the implementation tries to follow what LLVM does.
20+ //!
21+ //! # License
22+ //!
23+ //! This msvc-demangler is dual licensed under the MIT and the University of
24+ //! Illinois Open Source Licenses.
525
626#[ macro_use]
727extern crate bitflags;
@@ -30,6 +50,7 @@ impl From<std::str::Utf8Error> for Error {
3050 }
3151 }
3252}
53+
3354impl From < std:: string:: FromUtf8Error > for Error {
3455 fn from ( t : std:: string:: FromUtf8Error ) -> Error {
3556 Error {
You can’t perform that action at this time.
0 commit comments