mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-30 02:31:44 +00:00
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:
@@ -5,9 +5,9 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <string_view>
|
||||
|
||||
#include <wpi/StringMap.h>
|
||||
#include <wpi/StringRef.h>
|
||||
#include <wpi/deprecated.h>
|
||||
|
||||
#include "frc/smartdashboard/SendableBuilder.h"
|
||||
@@ -56,7 +56,7 @@ class SendableChooser : public SendableChooserBase {
|
||||
* @param name the name of the option
|
||||
* @param object the option
|
||||
*/
|
||||
void AddOption(wpi::StringRef name, T object);
|
||||
void AddOption(std::string_view name, T object);
|
||||
|
||||
/**
|
||||
* Add the given object to the list of options and marks it as the default.
|
||||
@@ -67,7 +67,7 @@ class SendableChooser : public SendableChooserBase {
|
||||
* @param name the name of the option
|
||||
* @param object the option
|
||||
*/
|
||||
void SetDefaultOption(wpi::StringRef name, T object);
|
||||
void SetDefaultOption(std::string_view name, T object);
|
||||
|
||||
/**
|
||||
* Adds the given object to the list of options.
|
||||
@@ -75,13 +75,13 @@ class SendableChooser : public SendableChooserBase {
|
||||
* On the SmartDashboard on the desktop, the object will appear as the given
|
||||
* name.
|
||||
*
|
||||
* @deprecated use AddOption(wpi::StringRef name, T object) instead.
|
||||
* @deprecated use AddOption(std::string_view name, T object) instead.
|
||||
*
|
||||
* @param name the name of the option
|
||||
* @param object the option
|
||||
*/
|
||||
WPI_DEPRECATED("use AddOption() instead")
|
||||
void AddObject(wpi::StringRef name, T object) { AddOption(name, object); }
|
||||
void AddObject(std::string_view name, T object) { AddOption(name, object); }
|
||||
|
||||
/**
|
||||
* Add the given object to the list of options and marks it as the default.
|
||||
@@ -89,13 +89,13 @@ class SendableChooser : public SendableChooserBase {
|
||||
* Functionally, this is very close to AddOption() except that it will use
|
||||
* this as the default option if none other is explicitly selected.
|
||||
*
|
||||
* @deprecated use SetDefaultOption(wpi::StringRef name, T object) instead.
|
||||
* @deprecated use SetDefaultOption(std::string_view name, T object) instead.
|
||||
*
|
||||
* @param name the name of the option
|
||||
* @param object the option
|
||||
*/
|
||||
WPI_DEPRECATED("use SetDefaultOption() instead")
|
||||
void AddDefault(wpi::StringRef name, T object) {
|
||||
void AddDefault(std::string_view name, T object) {
|
||||
SetDefaultOption(name, object);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user