Added readme to repository

This commit is contained in:
Armin Ronacher
2019-07-14 21:21:18 +02:00
parent e5fb0d98b5
commit 0ad994d1fe
4 changed files with 61 additions and 4 deletions
+2
View File
@@ -7,9 +7,11 @@ license = "MIT/NCSA"
documentation = "https://docs.rs/msvc-demangler/"
description = "A rust library that demangles / undecorates C++ symbols mangled by MSVC"
repository = "https://github.com/mstange/msvc-demangler-rust"
readme = "README.md"
[dependencies]
bitflags = "1.0.1"
[[bin]]
name = "undname"
path = "src/bin/undname.rs"
+6
View File
@@ -28,3 +28,9 @@ test: test-cargo test-wasm-build
lint:
@rustup component add clippy --toolchain stable 2> /dev/null
@cargo +stable clippy --all --tests -- -D clippy::all
.PHONY: lint
update-readme:
@cargo-readme -V &> /dev/null || cargo install cargo-readme
@cargo readme > README.md
.PHONY: update-readme
+28
View File
@@ -0,0 +1,28 @@
# msvc-demangler
msvc-demangler is a crate for Rust that can demangle C++ symbols which use
the MSVC mangling scheme. These are emitted by the Microsoft C++ compiler
for Windows as well as some others.
## Example
```rust
use msvc_demangler;
let flags = msvc_demangler::DemangleFlags::llvm();
let result = msvc_demangler::demangle("??_0klass@@QEAAHH@Z", flags).unwrap();
println!("{}", result);
```
## Behavior
It's functionality is similar to `undname` on Windows and the underlying
`UnDecorateSymbolName` function. Since Microsoft does not document the
mangling scheme this is likely not to be entirely accurate. When unclear
the implementation tries to follow what LLVM does.
## License
This msvc-demangler is dual licensed under the MIT and the University of
Illinois Open Source Licenses.
License: MIT/NCSA
+25 -4
View File
@@ -1,7 +1,27 @@
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
// This file defines a demangler for MSVC-style mangled symbols.
//! msvc-demangler is a crate for Rust that can demangle C++ symbols which use
//! the MSVC mangling scheme. These are emitted by the Microsoft C++ compiler
//! for Windows as well as some others.
//!
//! # Example
//!
//! ```
//! use msvc_demangler;
//! let flags = msvc_demangler::DemangleFlags::llvm();
//! let result = msvc_demangler::demangle("??_0klass@@QEAAHH@Z", flags).unwrap();
//! println!("{}", result);
//! ```
//!
//! # Behavior
//!
//! It's functionality is similar to `undname` on Windows and the underlying
//! `UnDecorateSymbolName` function. Since Microsoft does not document the
//! mangling scheme this is likely not to be entirely accurate. When unclear
//! the implementation tries to follow what LLVM does.
//!
//! # License
//!
//! This msvc-demangler is dual licensed under the MIT and the University of
//! Illinois Open Source Licenses.
#[macro_use]
extern crate bitflags;
@@ -30,6 +50,7 @@ impl From<std::str::Utf8Error> for Error {
}
}
}
impl From<std::string::FromUtf8Error> for Error {
fn from(t: std::string::FromUtf8Error) -> Error {
Error {