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

@@ -33,8 +33,6 @@
#include <utility>
#include <vector>
#include <wpi/Twine.h>
#include "frc/spline/Spline.h"
#include "units/angle.h"
#include "units/curvature.h"

View File

@@ -5,9 +5,7 @@
#pragma once
#include <string>
#include <wpi/StringRef.h>
#include <wpi/Twine.h>
#include <string_view>
#include "frc/trajectory/Trajectory.h"
@@ -25,7 +23,7 @@ class TrajectoryUtil {
* @return The interpolated state.
*/
static void ToPathweaverJson(const Trajectory& trajectory,
const wpi::Twine& path);
std::string_view path);
/**
* Imports a Trajectory from a PathWeaver-style JSON file.
*
@@ -33,7 +31,7 @@ class TrajectoryUtil {
*
* @return The trajectory represented by the file.
*/
static Trajectory FromPathweaverJson(const wpi::Twine& path);
static Trajectory FromPathweaverJson(std::string_view path);
/**
* Deserializes a Trajectory from PathWeaver-style JSON.
@@ -51,6 +49,6 @@ class TrajectoryUtil {
*
* @return the string containing the serialized JSON
*/
static Trajectory DeserializeTrajectory(wpi::StringRef json_str);
static Trajectory DeserializeTrajectory(std::string_view json_str);
};
} // namespace frc