mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-25 01:41:43 +00:00
Remove deprecated throwing get functions. (#213)
This commit is contained in:
@@ -286,21 +286,6 @@ class NetworkTable : public ITable {
|
||||
virtual bool SetDefaultNumber(llvm::StringRef key,
|
||||
double defaultValue) override;
|
||||
|
||||
/**
|
||||
* Gets the number associated with the given name.
|
||||
*
|
||||
* @param key the key to look up
|
||||
* @return the value associated with the given key
|
||||
* @throws TableKeyNotDefinedException if there is no value associated with
|
||||
* the given key
|
||||
* @deprecated This exception-raising method has been replaced by the
|
||||
* default-taking method.
|
||||
*/
|
||||
WPI_DEPRECATED(
|
||||
"Raises an exception if key not found; "
|
||||
"use GetNumber(StringRef key, double defaultValue) instead")
|
||||
virtual double GetNumber(llvm::StringRef key) const override;
|
||||
|
||||
/**
|
||||
* Gets the number associated with the given name.
|
||||
*
|
||||
@@ -330,21 +315,6 @@ class NetworkTable : public ITable {
|
||||
virtual bool SetDefaultString(llvm::StringRef key,
|
||||
llvm::StringRef defaultValue) override;
|
||||
|
||||
/**
|
||||
* Gets the string associated with the given name.
|
||||
*
|
||||
* @param key the key to look up
|
||||
* @return the value associated with the given key
|
||||
* @throws TableKeyNotDefinedException if there is no value associated with
|
||||
* the given key
|
||||
* @deprecated This exception-raising method has been replaced by the
|
||||
* default-taking method.
|
||||
*/
|
||||
WPI_DEPRECATED(
|
||||
"Raises an exception if key not found; "
|
||||
"use GetString(StringRef key, StringRef defaultValue) instead")
|
||||
virtual std::string GetString(llvm::StringRef key) const override;
|
||||
|
||||
/**
|
||||
* Gets the string associated with the given name. If the key does not
|
||||
* exist or is of different type, it will return the default value.
|
||||
@@ -375,21 +345,6 @@ class NetworkTable : public ITable {
|
||||
virtual bool SetDefaultBoolean(llvm::StringRef key,
|
||||
bool defaultValue) override;
|
||||
|
||||
/**
|
||||
* Gets the boolean associated with the given name.
|
||||
*
|
||||
* @param key the key to look up
|
||||
* @return the value associated with the given key
|
||||
* @throws TableKeyNotDefinedException if there is no value associated with
|
||||
* the given key
|
||||
* @deprecated This exception-raising method has been replaced by the
|
||||
* default-taking method.
|
||||
*/
|
||||
WPI_DEPRECATED(
|
||||
"Raises an exception if key not found; "
|
||||
"use GetBoolean(StringRef key, bool defaultValue) instead")
|
||||
virtual bool GetBoolean(llvm::StringRef key) const override;
|
||||
|
||||
/**
|
||||
* Gets the boolean associated with the given name. If the key does not
|
||||
* exist or is of different type, it will return the default value.
|
||||
|
||||
@@ -159,21 +159,6 @@ class ITable {
|
||||
*/
|
||||
virtual bool SetDefaultNumber(llvm::StringRef key, double defaultValue) = 0;
|
||||
|
||||
/**
|
||||
* Gets the number associated with the given name.
|
||||
*
|
||||
* @param key the key to look up
|
||||
* @return the value associated with the given key
|
||||
* @throws TableKeyNotDefinedException if there is no value associated with
|
||||
* the given key
|
||||
* @deprecated This exception-raising method has been replaced by the
|
||||
* default-taking method.
|
||||
*/
|
||||
WPI_DEPRECATED(
|
||||
"Raises an exception if key not found; "
|
||||
"use GetNumber(StringRef key, double defaultValue) instead")
|
||||
virtual double GetNumber(llvm::StringRef key) const = 0;
|
||||
|
||||
/**
|
||||
* Gets the number associated with the given name.
|
||||
*
|
||||
@@ -202,21 +187,6 @@ class ITable {
|
||||
virtual bool SetDefaultString(llvm::StringRef key,
|
||||
llvm::StringRef defaultValue) = 0;
|
||||
|
||||
/**
|
||||
* Gets the string associated with the given name.
|
||||
*
|
||||
* @param key the key to look up
|
||||
* @return the value associated with the given key
|
||||
* @throws TableKeyNotDefinedException if there is no value associated with
|
||||
* the given key
|
||||
* @deprecated This exception-raising method has been replaced by the
|
||||
* default-taking method.
|
||||
*/
|
||||
WPI_DEPRECATED(
|
||||
"Raises an exception if key not found; "
|
||||
"use GetString(StringRef key, StringRef defaultValue) instead")
|
||||
virtual std::string GetString(llvm::StringRef key) const = 0;
|
||||
|
||||
/**
|
||||
* Gets the string associated with the given name. If the key does not
|
||||
* exist or is of different type, it will return the default value.
|
||||
@@ -249,21 +219,6 @@ class ITable {
|
||||
*/
|
||||
virtual bool SetDefaultBoolean(llvm::StringRef key, bool defaultValue) = 0;
|
||||
|
||||
/**
|
||||
* Gets the boolean associated with the given name.
|
||||
*
|
||||
* @param key the key to look up
|
||||
* @return the value associated with the given key
|
||||
* @throws TableKeyNotDefinedException if there is no value associated with
|
||||
* the given key
|
||||
* @deprecated This exception-raising method has been replaced by the
|
||||
* default-taking method.
|
||||
*/
|
||||
WPI_DEPRECATED(
|
||||
"Raises an exception if key not found; "
|
||||
"use GetBoolean(StringRef key, bool defaultValue) instead")
|
||||
virtual bool GetBoolean(llvm::StringRef key) const = 0;
|
||||
|
||||
/**
|
||||
* Gets the boolean associated with the given name. If the key does not
|
||||
* exist or is of different type, it will return the default value.
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) FIRST 2015. All Rights Reserved. */
|
||||
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
||||
/* must be accompanied by the FIRST BSD license file in the root directory of */
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef TABLEKEYNOTDEFINEDEXCEPTION_H_
|
||||
#define TABLEKEYNOTDEFINEDEXCEPTION_H_
|
||||
|
||||
#include <exception>
|
||||
#include "llvm/StringRef.h"
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#define NT_NOEXCEPT throw()
|
||||
#else
|
||||
#define NT_NOEXCEPT noexcept
|
||||
#endif
|
||||
|
||||
/**
|
||||
* An exception thrown when the lookup a a key-value fails in a {@link ITable}
|
||||
*/
|
||||
class TableKeyNotDefinedException : public std::exception {
|
||||
public:
|
||||
/**
|
||||
* @param key the key that was not defined in the table
|
||||
*/
|
||||
TableKeyNotDefinedException(llvm::StringRef key);
|
||||
~TableKeyNotDefinedException() NT_NOEXCEPT;
|
||||
const char* what() const NT_NOEXCEPT override;
|
||||
|
||||
private:
|
||||
std::string msg;
|
||||
};
|
||||
|
||||
#endif // TABLEKEYNOTDEFINEDEXCEPTION_H_
|
||||
Reference in New Issue
Block a user