| Name | Modified | Size | Downloads / Week |
|---|---|---|---|
| Parent folder | |||
| coost v3.0.0 released.tar.gz | 2022-09-02 | 313.8 kB | |
| coost v3.0.0 released.zip | 2022-09-02 | 405.0 kB | |
| README.md | 2022-09-02 | 3.6 kB | |
| Totals: 3 Items | 722.4 kB | 0 | |
New features & improvement
-
Improve cmake scripts and support Conan. Improve export of symbols in shared library. Thanks to SpaceIm.
-
A better JSON library. Support precision control for float point numbers in Json. ```cpp // {"a":23,"b":false,"s":"xx","v":[1,2,3],"o":{"xx":0}} Json x = { { "a", 23 }, { "b", false }, { "s", "xx" }, { "v", {1,2,3} }, { "o", { {"xx", 0} }}, };
// equal to x Json y = Json() .add_member("a", 23) .add_member("b", false) .add_member("s", "xx") .add_member("v", Json().push_back(1).push_back(2).push_back(3)) .add_member("o", Json().add_member("xx", 0));
x.get("a").as_int(); // 23 x.get("s").as_string(); // "xx" x.get("v", 0).as_int(); // 1 x.get("v", 2).as_int(); // 3 x.get("o", "xx").as_int(); // 0 ```
-
Add TLOG to print logs which are grouped by topics.
cpp TLOG("rpc") << "hello " << 23; TLOG("xxx") << "hello " << 23; -
Improve exception handling in
co/logon Windows. Thanks to 909254. -
Remove path from
__FILE__inco/log. -
Support alias for flag. Add api
flag::alias().cpp DEF_bool(debug, false, ""); // no alias DEF_bool(debug, false, "", d); // d is an alias of debug DEF_bool(debug, false, "", d, dbg); // 2 aliases -
Ignore non-existing flags in config file.
-
Add
--versionforco/flag. -
--helpshows only user-defined flags inco/flagby default, and limit flag level to [0-9]. -
Add api
flag::set_value()for setting value of a flag. -
Add
log::set_write_cb()to set a callback for writting logs. -
Add macros
__arch64,__arch32,__fname__and__fnlen__inco/def.h. -
Add a fast memory allocator. Provide
co::stl_allocatorfor STL. -
Provide containers based on
co::stl_allocator. Seeco/stl.hfor details. -
Improve atomic operations, support memory order. Add
atomic_casas an alias ofatomic_compare_swapand addatomic_bool_cas. -
Add
nanoid(),md5digest(),sha256()inco/hash.h. -
Support HTTP protocol for JSON-based RPC framework.
-
Support graceful exit for
tcp::Server,http::Server,rpc::Server. -
Add
fs::dirfor readding directory. -
Support
+mode for both read and write forfs::file. -
Support precision control for float point numbers.
```cpp fastream s; s << 3.14159; // "3.14159"
s.clear(); s.maxdp(3) << 3.14159; // "3.141"
s.clear(); s << co::maxdp(2) << 3.14159; // "3.14"
LOG << co::maxdp(2) << 1.234e-7; // "1.23e-7" ```
- Improve hook on macos with fishhook. Thanks to shuai132.
Changed
-
Remove flag
afromco/unitest, run all tests by default. -
Remove
log::init(),log::close(),log::set_single_write_cb(). -
Remove
co::init(),co::exit(). -
Rename
co::all_schedulers()toco::schedulers(). -
Rename
co::Tabletoco::table. -
Remove
atomic_get, useatomic_loadinstead. - Remove
atomic_set, useatomic_storeinstead. -
Remove
atomic_reset, useatomic_store(&x, 0)instead. -
Remove
err::get(),err::set(), useco::error()instead.
Bugs fixed
-
Fix hook for ioctl. Thanks to Itmit.
-
Fix hook for accept & accept4.
-
Fix a bug in
co::Event.