[![Boost.URL](https://raw.githubusercontent.com/vinniefalco/url/master/doc/images/repo-logo.png)](http://master.url.cpp.al/)
Branch | [`master`](https://github.com/boostorg/url/tree/master) | [`develop`](https://github.com/boostorg/url/tree/develop) |
--------------- |-----------------------------------------------------------------------------------------------------------------------------------------------------| ------------------------------------------------------------- |
Docs | [![Documentation](https://img.shields.io/badge/docs-master-brightgreen.svg)](http://master.url.cpp.al/) | [![Documentation](https://img.shields.io/badge/docs-develop-brightgreen.svg)](http://develop.url.cpp.al/)
[Drone](https://drone.io/) | [![Build Status](https://drone.cpp.al/api/badges/boostorg/url/status.svg?ref=refs/heads/master)](https://drone.cpp.al/boostorg/url) | [![Build Status](https://drone.cpp.al/api/badges/boostorg/url/status.svg?ref=refs/heads/develop)](https://drone.cpp.al/boostorg/url)
[GitHub Actions](https://github.com/) | [![CI](https://github.com/boostorg/url/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/boostorg/url/actions/workflows/ci.yml) | [![CI](https://github.com/boostorg/url/actions/workflows/ci.yml/badge.svg?branch=develop)](https://github.com/boostorg/url/actions/workflows/ci.yml)
[codecov.io](https://codecov.io) | [![codecov](https://codecov.io/gh/boostorg/url/branch/master/graph/badge.svg)](https://codecov.io/gh/boostorg/url/branch/master) | [![codecov](https://codecov.io/gh/boostorg/url/branch/develop/graph/badge.svg)](https://codecov.io/gh/boostorg/url/branch/develop)
Matrix | [![Matrix](https://img.shields.io/badge/matrix-master-brightgreen.svg)](http://www.boost.org/development/tests/master/developer/url.html) | [![Matrix](https://img.shields.io/badge/matrix-develop-brightgreen.svg)](http://www.boost.org/development/tests/develop/developer/url.html)
# Boost.URL
## Overview
Boost.URL is a portable C++ library which provides containers and algorithms
which model a "URL", more formally described using the Uniform Resource
Identifier (URI) specification (henceforth referred to as rfc3986). A URL
is a compact sequence of characters that identifies an abstract or physical
resource. For example, this is a valid URL which satisfies the
absolute-URI grammar:
```
https://www.example.com/path/to/file.txt?userid=1001&page=2&results=full
```
This library understands the various grammars related to URLs and provides
for validating and parsing of strings, manipulation of URL strings, and
algorithms operating on URLs such as normalization and resolution. While
the library is general purpose, special care has been taken to ensure that
the implementation and data representation are friendly to network programs
which need to handle URLs efficiently and securely, including the case where
the inputs come from untrusted sources. Interfaces are provided for using
error codes instead of exceptions as needed, and all algorithms provide a
mechanism for avoiding memory allocations entirely if desired. Another
feature of the library is that all container mutations leave the URL in
a valid state. Code which uses Boost.URL will be easy to read, flexible,
and performant.
Network programs such as those using Boost.Asio or Boost.Beast often
encounter the need to process, generate, or modify URLs. This library
provides a very much needed modular component for handling these
use-cases.
## Example
```cpp
using namespace boost::urls;
// Parse a URL. This allocates no memory. The view
// references the character buffer without taking ownership.
//
url_view uv( "https://www.example.com/path/to/file.txt?id=1001&name=John%20Doe&results=full" );
// Print the query parameters with percent-decoding applied
//
for( auto v : uv.params() )
std::cout << v.key << "=" << v.value << " ";
// Prints: id=1001 name=John Doe results=full
// Create a modifiable copy of `uv`, with ownership of the buffer
//
url u = uv;
// Change some elements in the URL
//
u.set_scheme( "http" )
.set_encoded_host( "boost.org" )
.set_encoded_path( "/index.htm" )
.remove_query()
.remove_fragment()
.params().append( {"key", "value"} );
std::cout << u;
// Prints: http://boost.org/index.htm?key=value
```
## Design Goals
The library achieves these goals:
* Require only C++11
* Works without exceptions
* Fast compilation, no templates
* Strict compliance with rfc3986
* Allocate memory or use inline storage
* Optional header-only, without linking to a library
## Requirements
* Requires Boost and a compiler supporting at least C++11
* Aliases for standard types use their Boost equivalents
* Link to a built static or dynamic Boost library, or use header-only (see below)
* Supports -fno-exceptions, detected automatically
### Header-Only
To use as header-only; that is, to eliminate the requirement to
link a program to a static or dynamic Boost.URL library, simply
place the following line in exactly one new or existing source
file in your project.
```cpp
#include <boost/url/src.hpp>
```
### Embedded
Boost.URL works great on embedded devices. It can be used in a way
that avoids all dynamic memory allocations. Furthermore it is designed
to work without exceptions if desired.
### Supported Compilers
Boost.URL is tested with the following compilers:
* clang: 3.8, 4, 5, 6, 7, 8, 9, 10, 11, 12
* gcc: 4.8, 4.9, 5, 6, 7, 8, 9, 10, 11
* msvc: 14.0, 14.1, 14.2, 14.3
and these architectures: x86, x64, ARM64, S390x
### Quality Assurance
The development infrastructure for the library includes
these per-commit analyses:
* Coverage reports
* Benchmark performance comparisons
* Compilation and tests on Drone.io
## Visual Studio Solution Generation
cmake -G "Visual Studio 16 2019" -A Win32 -B bin -DCMAKE_TOOLCHAIN_FILE=cmake/toolchains/msvc.cmake
cmake -G "Visual Studio 16 2019" -A x64 -B bin64 -DCMAKE_TOOLCHAIN_FILE=cmake/toolchains/msvc.cmake
## License
Distributed under the Boost Software License, Version 1.0.
(See accompanying file [LICENSE_1_0.txt](LICENSE_1_0.txt) or copy at
https://www.boost.org/LICENSE_1_0.txt)
没有合适的资源?快使用搜索试试~ 我知道了~
Boost.URL是一个用于操作统一资源标识符(URI)和定位器(URL)的库。.zip
共421个文件
hpp:154个
cpp:99个
ipp:68个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 160 浏览量
2023-03-31
22:47:13
上传
评论
收藏 976KB ZIP 举报
温馨提示
Boost.URL是一个用于操作统一资源标识符(URI)和定位器(URL)的库。
资源推荐
资源详情
资源评论
收起资源包目录
Boost.URL是一个用于操作统一资源标识符(URI)和定位器(URL)的库。.zip (421个子文件)
drone.bat 755B
msvc.cmake 889B
common.cmake 712B
gcc.cmake 163B
clang.cmake 132B
ada.cpp 356KB
url_base.cpp 58KB
snippets.cpp 51KB
url.cpp 42KB
format.cpp 37KB
url_view.cpp 29KB
segments_encoded_ref.cpp 28KB
segments_ref.cpp 28KB
params_ref.cpp 26KB
params_encoded_ref.cpp 24KB
magnet.cpp 17KB
url_view_base.cpp 15KB
ipv6_address.cpp 14KB
router.cpp 12KB
finicky.cpp 12KB
params_encoded_base.cpp 11KB
params_base.cpp 11KB
authority_view.cpp 11KB
test_main.cpp 11KB
param.cpp 10KB
mailto.cpp 10KB
decode_view.cpp 9KB
doc_grammar.cpp 9KB
segments_encoded_base.cpp 9KB
router.cpp 9KB
segments_base.cpp 8KB
range_rule.cpp 7KB
ipv4_address.cpp 6KB
params_encoded_view.cpp 6KB
file_router.cpp 5KB
static_url.cpp 5KB
ci_string.cpp 5KB
pct_string_view.cpp 5KB
segments_encoded_view.cpp 4KB
encode.cpp 4KB
params_view.cpp 4KB
natvis.cpp 4KB
segments_view.cpp 3KB
scheme.cpp 3KB
main.cpp 3KB
tuple_rule.cpp 3KB
doc_3_urls.cpp 3KB
qrcode.cpp 3KB
unsigned_rule.cpp 2KB
lut_chars.cpp 2KB
reserved_chars.cpp 2KB
charset.cpp 2KB
suffix_list.cpp 2KB
string_token.cpp 2KB
error.cpp 2KB
authority_rule.cpp 2KB
not_empty_rule.cpp 2KB
parse.cpp 2KB
absolute_uri_rule.cpp 2KB
variant_rule.cpp 2KB
grammar_error.cpp 2KB
uri_rule.cpp 2KB
optional_rule.cpp 2KB
literal_rule.cpp 1KB
fuzz_parse.cpp 1KB
hexdig_chars.cpp 1KB
delim_rule.cpp 1KB
dec_octet_rule.cpp 1KB
unreserved_chars.cpp 1KB
recycled.cpp 1KB
pchars.cpp 1KB
token_rule.cpp 1KB
alnum_chars.cpp 1013B
alpha_chars.cpp 987B
grammar_parse.cpp 970B
sub_delim_chars.cpp 962B
gen_delim_chars.cpp 954B
digit_chars.cpp 927B
pct_encoded_rule.cpp 866B
uri_reference_rule.cpp 845B
relative_ref_rule.cpp 830B
vchars.cpp 829B
parse_path.cpp 789B
ipv6_address_rule.cpp 787B
parse_query.cpp 783B
origin_form_rule.cpp 774B
ipv4_address_rule.cpp 759B
type_traits.cpp 676B
string_view_base.cpp 643B
copied_strings.cpp 642B
limits.cpp 562B
encoding_opts.cpp 429B
query_rule.cpp 382B
error_types.cpp 363B
string_view.cpp 363B
ignore_case.cpp 363B
host_type.cpp 361B
optional.cpp 360B
variant.cpp 359B
grammar.cpp 359B
共 421 条
- 1
- 2
- 3
- 4
- 5
资源评论
快撑死的鱼
- 粉丝: 1w+
- 资源: 9156
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功