Commit Graph

7 Commits

Author SHA1 Message Date
Peter Johnson
b2c3b2dd8e Use std::string_view and fmtlib across all libraries (#3402)
- Twine, StringRef, Format, and NativeFormatting have been removed
- Logging now uses fmtlib style formatting
- Nearly all uses of wpi::outs/errs have been replaced with fmt::print() or
std::puts()/std::fputs() (for unformatted strings).
- A wpi/fmt/raw_ostream.h header has been added to enable
fmt::print() with wpi::raw_ostream
2021-06-06 16:13:58 -07:00
Peter Johnson
2aed432b4b Add braces to C++ single-line loops and conditionals (NFC) (#2973)
This makes code easier to read and more consistent between C++ and Java.
Also update clang-format settings to always add a line break (even if no braces are used).
2020-12-28 12:58:06 -08:00
Peter Johnson
8f1f64ffb6 Remove year from file copyright message (NFC) (#2972)
Also update copyright to include "and other WPILib contributors" and clarify
license referral language to not be restricted to FIRST teams.
2020-12-26 14:12:05 -08:00
Tyler Veness
f432f65bef Update copyright year in license to 2019 (#1524)
Also update clang-format to 6.0.
2019-05-17 17:35:09 -07:00
Peter Johnson
608d82423d wpiutil: Use scoped connections to ensure cleanup (#1474) 2018-12-09 01:36:36 -08:00
Peter Johnson
0fb24538a7 wpiutil: HttpServerConnection: add SendStaticResponse
This function is intended for use when the content is a static const variable.
It allows gzipped static data, but doesn't provide the functionality to ungzip
it if the client doesn't support gzip.  This is because it would add a
dependency on zlib and basically all clients support gzip.

Change extraHeader on all Send functions to include the final newline,
this makes it easier to build up extra headers incrementally.

Expose sig::Connection for messageComplete and headerConn to allow them to
be disconnected by users of the class.  This is commonly needed for things
like WebSocket upgrades.
2018-12-09 00:58:04 -08:00
Peter Johnson
9e37ee13de Add wpi::HttpServerConnection and an example of its use (#1281) 2018-08-20 13:11:39 -07:00