[wpilib] Preferences: Deprecate Put* in favor of Set* (#3337)

This naming is more consistent with other APIs.

Co-authored-by: Tyler Veness <calcmogul@gmail.com>
This commit is contained in:
Noam Zaks
2021-05-06 18:25:37 +03:00
committed by GitHub
parent 497b712f67
commit d6cfdd3bae
3 changed files with 177 additions and 13 deletions

View File

@@ -11,6 +11,7 @@
#include <vector>
#include <networktables/NetworkTable.h>
#include <wpi/deprecated.h>
namespace frc {
@@ -114,6 +115,18 @@ class Preferences {
* @param key the key
* @param value the value
*/
void SetString(wpi::StringRef key, wpi::StringRef value);
/**
* Puts the given string into the preferences table.
*
* The value may not have quotation marks, nor may the key have any whitespace
* nor an equals sign.
*
* @param key the key
* @param value the value
*/
WPI_DEPRECATED("Use SetString instead.")
void PutString(wpi::StringRef key, wpi::StringRef value);
/**
@@ -130,6 +143,17 @@ class Preferences {
* @param key the key
* @param value the value
*/
void SetInt(wpi::StringRef key, int value);
/**
* Puts the given int into the preferences table.
*
* The key may not have any whitespace nor an equals sign.
*
* @param key the key
* @param value the value
*/
WPI_DEPRECATED("Use SetInt instead.")
void PutInt(wpi::StringRef key, int value);
/**
@@ -146,6 +170,17 @@ class Preferences {
* @param key the key
* @param value the value
*/
void SetDouble(wpi::StringRef key, double value);
/**
* Puts the given double into the preferences table.
*
* The key may not have any whitespace nor an equals sign.
*
* @param key the key
* @param value the value
*/
WPI_DEPRECATED("Use SetDouble instead.")
void PutDouble(wpi::StringRef key, double value);
/**
@@ -162,6 +197,17 @@ class Preferences {
* @param key the key
* @param value the value
*/
void SetFloat(wpi::StringRef key, float value);
/**
* Puts the given float into the preferences table.
*
* The key may not have any whitespace nor an equals sign.
*
* @param key the key
* @param value the value
*/
WPI_DEPRECATED("Use SetFloat instead.")
void PutFloat(wpi::StringRef key, float value);
/**
@@ -178,6 +224,17 @@ class Preferences {
* @param key the key
* @param value the value
*/
void SetBoolean(wpi::StringRef key, bool value);
/**
* Puts the given boolean into the preferences table.
*
* The key may not have any whitespace nor an equals sign.
*
* @param key the key
* @param value the value
*/
WPI_DEPRECATED("Use SetBoolean instead.")
void PutBoolean(wpi::StringRef key, bool value);
/**
@@ -194,6 +251,17 @@ class Preferences {
* @param key the key
* @param value the value
*/
void SetLong(wpi::StringRef key, int64_t value);
/**
* Puts the given long (int64_t) into the preferences table.
*
* The key may not have any whitespace nor an equals sign.
*
* @param key the key
* @param value the value
*/
WPI_DEPRECATED("Use SetLong instead.")
void PutLong(wpi::StringRef key, int64_t value);
/**