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
This commit is contained in:
Peter Johnson
2021-06-06 16:13:58 -07:00
committed by GitHub
parent 4f1cecb8e7
commit b2c3b2dd8e
441 changed files with 5061 additions and 9749 deletions

View File

@@ -22,8 +22,8 @@ namespace impl {
typedef std::pair<unsigned int, unsigned int> RpcIdPair;
struct RpcNotifierData : public RpcAnswer {
RpcNotifierData(NT_Entry entry_, NT_RpcCall call_, wpi::StringRef name_,
wpi::StringRef params_, const ConnectionInfo& conn_,
RpcNotifierData(NT_Entry entry_, NT_RpcCall call_, std::string_view name_,
std::string_view params_, const ConnectionInfo& conn_,
IRpcServer::SendResponseFunc send_response_)
: RpcAnswer{entry_, call_, name_, params_, conn_},
send_response{std::move(send_response_)} {}
@@ -55,7 +55,7 @@ class RpcServerThread
void DoCallback(std::function<void(const RpcAnswer& call)> callback,
const RpcNotifierData& data) {
DEBUG4("rpc calling " << data.name);
DEBUG4("rpc calling {}", data.name);
unsigned int local_id = Handle{data.entry}.GetIndex();
unsigned int call_uid = Handle{data.call}.GetIndex();
RpcIdPair lookup_uid{local_id, call_uid};
@@ -94,12 +94,12 @@ class RpcServer
void RemoveRpc(unsigned int rpc_uid) override;
void ProcessRpc(unsigned int local_id, unsigned int call_uid,
wpi::StringRef name, wpi::StringRef params,
std::string_view name, std::string_view params,
const ConnectionInfo& conn, SendResponseFunc send_response,
unsigned int rpc_uid) override;
bool PostRpcResponse(unsigned int local_id, unsigned int call_uid,
wpi::StringRef result);
std::string_view result);
private:
int m_inst;