16 #include <networktables/NetworkTable.h>
18 #include "frc/ErrorBase.h"
50 std::vector<std::string>
GetKeys();
202 std::shared_ptr<nt::NetworkTable> m_table;
203 NT_EntryListener m_listener;
void RemoveAll()
Remove all preferences.
WPILib FRC namespace.
Definition: SPIAccelerometerSim.h:18
The preferences class provides a relatively simple way to save important values to the roboRIO to acc...
Definition: Preferences.h:36
std::vector< std::string > GetKeys()
Returns a vector of all the keys.
void PutInt(wpi::StringRef key, int value)
Puts the given int into the preferences table.
void PutBoolean(wpi::StringRef key, bool value)
Puts the given boolean into the preferences table.
int GetInt(wpi::StringRef key, int defaultValue=0)
Returns the int at the given key.
void PutFloat(wpi::StringRef key, float value)
Puts the given float into the preferences table.
void Remove(wpi::StringRef key)
Remove a preference.
bool ContainsKey(wpi::StringRef key)
Returns whether or not there is a key with the given name.
std::string GetString(wpi::StringRef key, wpi::StringRef defaultValue="")
Returns the string at the given key.
void PutLong(wpi::StringRef key, int64_t value)
Puts the given long (int64_t) into the preferences table.
float GetFloat(wpi::StringRef key, float defaultValue=0.0)
Returns the float at the given key.
int64_t GetLong(wpi::StringRef key, int64_t defaultValue=0)
Returns the long (int64_t) at the given key.
void PutDouble(wpi::StringRef key, double value)
Puts the given double into the preferences table.
Base class for most objects.
Definition: ErrorBase.h:74
bool GetBoolean(wpi::StringRef key, bool defaultValue=false)
Returns the boolean at the given key.
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:49
void PutString(wpi::StringRef key, wpi::StringRef value)
Puts the given string into the preferences table.
double GetDouble(wpi::StringRef key, double defaultValue=0.0)
Returns the double at the given key.
static Preferences * GetInstance()
Get the one and only Preferences object.