mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-27 02:01:42 +00:00
[hal] Replace const char* with std::string_view in Driver Station sim functions (#4532)
This commit is contained in:
@@ -234,20 +234,20 @@ void DriverStationSim::SetJoystickType(int stick, int type) {
|
||||
HALSIM_SetJoystickType(stick, type);
|
||||
}
|
||||
|
||||
void DriverStationSim::SetJoystickName(int stick, const char* name) {
|
||||
HALSIM_SetJoystickName(stick, name);
|
||||
void DriverStationSim::SetJoystickName(int stick, std::string_view name) {
|
||||
HALSIM_SetJoystickName(stick, name.data(), name.size());
|
||||
}
|
||||
|
||||
void DriverStationSim::SetJoystickAxisType(int stick, int axis, int type) {
|
||||
HALSIM_SetJoystickAxisType(stick, axis, type);
|
||||
}
|
||||
|
||||
void DriverStationSim::SetGameSpecificMessage(const char* message) {
|
||||
HALSIM_SetGameSpecificMessage(message);
|
||||
void DriverStationSim::SetGameSpecificMessage(std::string_view message) {
|
||||
HALSIM_SetGameSpecificMessage(message.data(), message.size());
|
||||
}
|
||||
|
||||
void DriverStationSim::SetEventName(const char* name) {
|
||||
HALSIM_SetEventName(name);
|
||||
void DriverStationSim::SetEventName(std::string_view name) {
|
||||
HALSIM_SetEventName(name.data(), name.size());
|
||||
}
|
||||
|
||||
void DriverStationSim::SetMatchType(DriverStation::MatchType type) {
|
||||
|
||||
@@ -337,7 +337,7 @@ class DriverStationSim {
|
||||
* @param stick The joystick number
|
||||
* @param name The value of name
|
||||
*/
|
||||
static void SetJoystickName(int stick, const char* name);
|
||||
static void SetJoystickName(int stick, std::string_view name);
|
||||
|
||||
/**
|
||||
* Sets the types of Axes for a joystick.
|
||||
@@ -353,14 +353,14 @@ class DriverStationSim {
|
||||
*
|
||||
* @param message the game specific message
|
||||
*/
|
||||
static void SetGameSpecificMessage(const char* message);
|
||||
static void SetGameSpecificMessage(std::string_view message);
|
||||
|
||||
/**
|
||||
* Sets the event name.
|
||||
*
|
||||
* @param name the event name
|
||||
*/
|
||||
static void SetEventName(const char* name);
|
||||
static void SetEventName(std::string_view name);
|
||||
|
||||
/**
|
||||
* Sets the match type.
|
||||
|
||||
Reference in New Issue
Block a user