13 #include "llvm/StringRef.h"
20 #define NT_DEPRECATED(msg) __declspec(deprecated(msg))
21 #elif defined(__GNUC__)
22 #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 8)
23 #if __cplusplus > 201103L
24 #define NT_DEPRECATED(msg) [[deprecated(msg)]]
26 #define NT_DEPRECATED(msg) [[gnu::deprecated(msg)]]
29 #define NT_DEPRECATED(msg) __attribute__((deprecated(msg)))
31 #elif __cplusplus > 201103L
32 #define NT_DEPRECATED(msg) [[deprecated(msg)]]
34 #define NT_DEPRECATED(msg)
75 virtual std::vector<std::string>
GetKeys(
int types = 0)
const = 0;
80 virtual std::vector<std::string>
GetSubTables()
const = 0;
155 std::shared_ptr<nt::Value> value) = 0;
176 NT_DEPRECATED(
"Raises an exception if key not found; "
177 "use GetNumber(StringRef key, double defaultValue) instead")
188 virtual double GetNumber(
llvm::StringRef key,
double defaultValue)
const = 0;
209 NT_DEPRECATED(
"Raises an exception if key not found; "
210 "use GetString(StringRef key, StringRef defaultValue) instead")
247 NT_DEPRECATED(
"Raises an exception if key not found; "
248 "use GetBoolean(StringRef key, bool defaultValue) instead")
260 virtual bool GetBoolean(
llvm::StringRef key,
bool defaultValue)
const = 0;
376 bool immediateNotify) = 0;
387 unsigned int flags) = 0;
398 bool immediateNotify) = 0;
410 unsigned int flags) = 0;
425 bool localNotify) = 0;
virtual bool PutNumber(llvm::StringRef key, double value)=0
Put a number in the table.
virtual bool PutNumberArray(llvm::StringRef key, llvm::ArrayRef< double > value)=0
Put a number array in the table.
A table whose values can be read and written to.
Definition: ITable.h:43
virtual void ClearPersistent(llvm::StringRef key)=0
Stop making a key's value persistent through program restarts.
virtual void AddTableListener(ITableListener *listener)=0
Add a listener for changes to the table.
virtual std::string GetRaw(llvm::StringRef key, llvm::StringRef defaultValue) const =0
Returns the raw value (byte array) the key maps to.
virtual bool PutBooleanArray(llvm::StringRef key, llvm::ArrayRef< int > value)=0
Put a boolean array in the table.
virtual std::shared_ptr< ITable > GetSubTable(llvm::StringRef key) const =0
Gets the subtable in this table for the given name.
virtual void Delete(llvm::StringRef key)=0
Deletes the specified key in this table.
virtual void AddSubTableListener(ITableListener *listener)=0
This will immediately notify the listener of all current sub tables.
virtual unsigned int GetFlags(llvm::StringRef key) const =0
Returns the flags for the specified key.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
Definition: ArrayRef.h:54
virtual bool ContainsKey(llvm::StringRef key) const =0
Determines whether the given key is in this table.
virtual bool PutStringArray(llvm::StringRef key, llvm::ArrayRef< std::string > value)=0
Put a string array in the table.
virtual std::vector< std::string > GetSubTables() const =0
virtual bool IsPersistent(llvm::StringRef key) const =0
Returns whether the value is persistent through program restarts.
virtual bool PutString(llvm::StringRef key, llvm::StringRef value)=0
Put a string in the table.
virtual std::vector< std::string > GetKeys(int types=0) const =0
virtual bool PutBoolean(llvm::StringRef key, bool value)=0
Put a boolean in the table.
virtual void RemoveTableListener(ITableListener *listener)=0
Remove a listener from receiving table events.
virtual std::shared_ptr< nt::Value > GetValue(llvm::StringRef key) const =0
Gets the value associated with a key as an object.
A listener that listens to changes in values in a ITable.
Definition: ITableListener.h:18
virtual void SetFlags(llvm::StringRef key, unsigned int flags)=0
Sets flags on the specified key in this table.
virtual std::vector< std::string > GetStringArray(llvm::StringRef key, llvm::ArrayRef< std::string > defaultValue) const =0
Returns the string array the key maps to.
virtual std::vector< double > GetNumberArray(llvm::StringRef key, llvm::ArrayRef< double > defaultValue) const =0
Returns the number array the key maps to.
virtual void ClearFlags(llvm::StringRef key, unsigned int flags)=0
Clears flags on the specified key in this table.
virtual bool ContainsSubTable(llvm::StringRef key) const =0
Determines whether there exists a non-empty subtable for this key in this table.
virtual bool PutValue(llvm::StringRef key, std::shared_ptr< nt::Value > value)=0
Put a value in the table.
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:39
virtual std::vector< int > GetBooleanArray(llvm::StringRef key, llvm::ArrayRef< int > defaultValue) const =0
Returns the boolean array the key maps to.
virtual void AddTableListenerEx(ITableListener *listener, unsigned int flags)=0
Add a listener for changes to the table.
virtual bool PutRaw(llvm::StringRef key, llvm::StringRef value)=0
Put a raw value (byte array) in the table.
virtual void SetPersistent(llvm::StringRef key)=0
Makes a key's value persistent through program restarts.