Expand description
§Windy
Windows string library for ANSI strings and wide strings.
§Features
- Owned ANSI strings:
AString. - Owned wide strings:
WString. - Borrowed ANSI strings:
AStr. - Borrowed wide strings:
WStr. - Dynamically-code-paged ANSI strings:
DAStringandDAStr. - Windows
ANSI_STRINGandUNICODE_STRINGwrappers. - Conversions between ANSI strings, wide strings, and UTF-8
Stringvalues. no_stdsupport for borrowed string types.
§Installation
Add this crate to Cargo.toml:
[dependencies]
windy = "0.4.0"§no_std support
Disable default features to build without std:
--no-default-featuresOwned string types are available only with the std feature.
§Macros
The companion windy-macros crate provides compile-time conversion from
UTF-8 string literals to WString or AString.
[dependencies]
windy = "0.4.0"
windy-macros = "0.3.0"§License
This software is released under the MIT or Apache-2.0 License, see LICENSE-MIT or LICENSE-APACHE.
Modules§
Structs§
- ANSI_
STRING - ANSI_STRING
- AStr
- A borrowed NUL-terminated ANSI string for code page
CP. - AString
- An owned NUL-terminated ANSI string for code page
CP. - Ansi
String - A borrowed wrapper for a Windows
ANSI_STRING. - DAStr
- A borrowed NUL-terminated ANSI string with a runtime-selected code page.
- DAString
- An owned NUL-terminated ANSI string with a runtime-selected code page.
- UNICODE_
STRING - UNICODE_STRING
- Unicode
String - A borrowed wrapper for a Windows
UNICODE_STRING. - WStr
- A borrowed NUL-terminated wide string.
- WString
- An owned NUL-terminated wide string.
Enums§
- Convert
Error - An error returned by string validation or conversion.
- String
Format Error - An invalid NUL-terminated string format.
Constants§
- CP_ACP
- CP_UTF8
- ERROR_
INSUFFICIENT_ BUFFER - ERROR_
INVALID_ PARAMETER - ERROR_
NO_ UNICODE_ TRANSLATION - MB_
ERR_ INVALID_ CHARS - WC_
ERR_ INVALID_ CHARS - WC_
NO_ BEST_ FIT_ CHARS
Functions§
- is_
acceptable_ code_ page - Returns
trueif the specified code page identifier can be used with types such asAStr. - is_
valid_ code_ page - Returns whether
code_pageidentifies a code page installed on the current operating system, as determined byIsValidCodePage.
Type Aliases§
- ACPAnsi
String - Alias for
AnsiStringusing the process ANSI code page. - ACPStr
- Borrowed ANSI string using
CP_ACP. - ACPString
- Owned ANSI string using
CP_ACP. - Convert
Result - Result type for fallible string operations.