mirror of
https://gitee.com/zyjblog/oatpp.git
synced 2025-01-05 17:42:23 +08:00
85 lines
2.8 KiB
Markdown
85 lines
2.8 KiB
Markdown
# Oat++ 1.4.0
|
|
|
|
Previous release - [1.3.0](1.3.0.md)
|
|
|
|
Feel free to ask questions - [Chat on Gitter!](https://gitter.im/oatpp-framework/Lobby)
|
|
|
|
Contents:
|
|
|
|
- [URL Encoder And Decoder](#url-encoder-and-decoder)
|
|
- [Introduce async::ConditionVariable](#async-condition-variable)
|
|
- [Restructuring](#restructuring)
|
|
|
|
|
|
## URL Encoder And Decoder
|
|
|
|
```cpp
|
|
#include "oatpp/encoding/Url.hpp"
|
|
|
|
...
|
|
|
|
oatpp::String data = "Hello URL-Encoder!!!";
|
|
|
|
oatpp::encoding::Url::Config config;
|
|
auto encoded = oatpp::encoding::Url::encode(data, config);
|
|
auto decoded = oatpp::encoding::Url::decode(encoded);
|
|
|
|
OATPP_ASSERT(decoded == data)
|
|
```
|
|
**Note**: Oat++ does NOT automatically decode URL and its parameters on endpoint hit.
|
|
|
|
## Async Condition Variable
|
|
|
|
```cpp
|
|
#include "oatpp/async/ConditionVariable.hpp"
|
|
|
|
...
|
|
|
|
oatpp::async::Lock* m_lock;
|
|
oatpp::async::ConditionVariable* m_cv;
|
|
|
|
...
|
|
|
|
Action act() override {
|
|
return m_cv->waitFor(m_lock, // async::Lock
|
|
[this]{return m_resource->counter == 100;}, // condition
|
|
std::chrono::seconds(5)) // timeout
|
|
.next(finish());
|
|
}
|
|
...
|
|
```
|
|
|
|
## Restructuring
|
|
|
|
### Files
|
|
|
|
| old file | new file |
|
|
|----------------------------------------|------------------------------|
|
|
| `oatpp/parser/json/*` | `oatpp/json/*` |
|
|
| `oatpp/parser/json/mapping/*` | `oatpp/json/*` |
|
|
| `oatpp/algorithm/CRC.hpp` | `oatpp/utils/CRC32.hpp` |
|
|
| `oatpp/core/utils/*` | `oatpp/utils/*` |
|
|
| `oatpp/core/utils/ConversionUtils.hpp` | `oatpp/utils/Conversion.hpp` |
|
|
| `oatpp/core/macro/*` | `oatpp/macro/*` |
|
|
| `oatpp/core/async/*` | `oatpp/async/*` |
|
|
| `oatpp/core/Types.hpp` | `oatpp/Types.hpp` |
|
|
| `oatpp/core/IODefinitions.hpp` | `oatpp/IODefinitions.hpp` |
|
|
| `oatpp/core/base/Environment.hpp` | `oatpp/Environment.hpp` |
|
|
| `oatpp/core/base/*` | `oatpp/base/*` |
|
|
| `oatpp/core/concurrency/*` | `oatpp/concurrency/*` |
|
|
| `oatpp/core/provider/*` | `oatpp/provider/*` |
|
|
| `oatpp/core/data/*` | `oatpp/data/*` |
|
|
| `oatpp/core/parser/*` | `oatpp/utils/parser/*` |
|
|
| `oatpp/data/mapping/type/*` | `oatpp/data/type/*` |
|
|
|
|
### Namespaces
|
|
|
|
| old namespace | new namespace |
|
|
|-----------------------------------|------------------------|
|
|
| `oatpp::parser::json::*` | `oatpp::json::*` |
|
|
| `oatpp::parser::json::mapping::*` | `oatpp::json::*` |
|
|
| `oatpp::algorithm::CRC` | `oatpp::utils::CRC32` |
|
|
| `oatpp::data::mapping::type::*` | `oatpp::data::type::*` |
|
|
|
|
|