mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-26 01:51:41 +00:00
Changed const char* -> string in most of wpilibc.
The HAL will remain untouched in order to maintain C-style compatibility. A few places in wpilibc were left as C-style strings, especially if special formatting (eg, elaborate uses of snprintf or sscanf) was being used. In general, const char* was changed to std::string. character buffers used for formatting were either untouched, changed to std::stringstream, or changed to std::string, depending on what was done with the buffer. Change-Id: I5e431ddf1cc4d9a6d534e1f21b16ea23be26e7f1
This commit is contained in:
@@ -56,14 +56,17 @@ void LiveWindow::SetEnabled(bool enabled) {
|
||||
* @param name The name of this component.
|
||||
* @param component A LiveWindowSendable component that represents a sensor.
|
||||
*/
|
||||
void LiveWindow::AddSensor(const char *subsystem, const char *name,
|
||||
void LiveWindow::AddSensor(const std::string &subsystem, const std::string &name,
|
||||
::std::shared_ptr<LiveWindowSendable> component) {
|
||||
m_components[component].subsystem = subsystem;
|
||||
m_components[component].name = name;
|
||||
m_components[component].isSensor = true;
|
||||
}
|
||||
|
||||
void LiveWindow::AddSensor(const char *subsystem, const char *name, LiveWindowSendable *component) {
|
||||
[[deprecated(
|
||||
"Raw pointers are deprecated; pass the component using shared_ptr "
|
||||
"instead.")]]
|
||||
void LiveWindow::AddSensor(const std::string &subsystem, const std::string &name, LiveWindowSendable *component) {
|
||||
AddSensor(subsystem, name, ::std::shared_ptr<LiveWindowSendable>(
|
||||
component, NullDeleter<LiveWindowSendable>()));
|
||||
}
|
||||
@@ -75,14 +78,17 @@ void LiveWindow::AddSensor(const char *subsystem, const char *name, LiveWindowSe
|
||||
* @param name The name of this component.
|
||||
* @param component A LiveWindowSendable component that represents a actuator.
|
||||
*/
|
||||
void LiveWindow::AddActuator(const char *subsystem, const char *name,
|
||||
void LiveWindow::AddActuator(const std::string &subsystem, const std::string &name,
|
||||
::std::shared_ptr<LiveWindowSendable> component) {
|
||||
m_components[component].subsystem = subsystem;
|
||||
m_components[component].name = name;
|
||||
m_components[component].isSensor = false;
|
||||
}
|
||||
|
||||
void LiveWindow::AddActuator(const char *subsystem, const char *name,
|
||||
[[deprecated(
|
||||
"Raw pointers are deprecated; pass the component using shared_ptr "
|
||||
"instead.")]]
|
||||
void LiveWindow::AddActuator(const std::string &subsystem, const std::string &name,
|
||||
LiveWindowSendable *component) {
|
||||
AddActuator(subsystem, name,
|
||||
::std::shared_ptr<LiveWindowSendable>(
|
||||
|
||||
Reference in New Issue
Block a user