13 #include "llvm/StringRef.h"
15 #include "support/deprecated.h"
30 virtual bool ContainsKey(llvm::StringRef key)
const = 0;
48 virtual std::shared_ptr<ITable>
GetSubTable(llvm::StringRef key)
const = 0;
54 virtual std::vector<std::string>
GetKeys(
int types = 0)
const = 0;
59 virtual std::vector<std::string>
GetSubTables()
const = 0;
82 virtual bool IsPersistent(llvm::StringRef key)
const = 0;
91 virtual void SetFlags(llvm::StringRef key,
unsigned int flags) = 0;
100 virtual void ClearFlags(llvm::StringRef key,
unsigned int flags) = 0;
108 virtual unsigned int GetFlags(llvm::StringRef key)
const = 0;
115 virtual void Delete(llvm::StringRef key) = 0;
124 virtual std::shared_ptr<nt::Value>
GetValue(llvm::StringRef key)
const = 0;
133 std::shared_ptr<nt::Value> defaultValue) = 0;
142 virtual bool PutValue(llvm::StringRef key,
143 std::shared_ptr<nt::Value> value) = 0;
152 virtual bool PutNumber(llvm::StringRef key,
double value) = 0;
160 virtual bool SetDefaultNumber(llvm::StringRef key,
double defaultValue) = 0;
173 "Raises an exception if key not found; "
174 "use GetNumber(StringRef key, double defaultValue) instead")
175 virtual double GetNumber(llvm::StringRef key)
const = 0;
185 virtual double GetNumber(llvm::StringRef key,
double defaultValue)
const = 0;
194 virtual bool PutString(llvm::StringRef key, llvm::StringRef value) = 0;
203 llvm::StringRef defaultValue) = 0;
216 "Raises an exception if key not found; "
217 "use GetString(StringRef key, StringRef defaultValue) instead")
218 virtual std::string GetString(llvm::StringRef key)
const = 0;
232 virtual std::string GetString(llvm::StringRef key,
233 llvm::StringRef defaultValue)
const = 0;
242 virtual bool PutBoolean(llvm::StringRef key,
bool value) = 0;
263 "Raises an exception if key not found; "
264 "use GetBoolean(StringRef key, bool defaultValue) instead")
265 virtual bool GetBoolean(llvm::StringRef key)
const = 0;
276 virtual bool GetBoolean(llvm::StringRef key,
bool defaultValue)
const = 0;
289 llvm::ArrayRef<int> value) = 0;
298 llvm::ArrayRef<int> defaultValue) = 0;
316 llvm::StringRef key, llvm::ArrayRef<int> defaultValue)
const = 0;
325 llvm::ArrayRef<double> value) = 0;
334 llvm::ArrayRef<double> defaultValue) = 0;
348 llvm::StringRef key, llvm::ArrayRef<double> defaultValue)
const = 0;
357 llvm::ArrayRef<std::string> value) = 0;
366 llvm::StringRef key, llvm::ArrayRef<std::string> defaultValue) = 0;
380 llvm::StringRef key, llvm::ArrayRef<std::string> defaultValue)
const = 0;
388 virtual bool PutRaw(llvm::StringRef key, llvm::StringRef value) = 0;
397 llvm::StringRef defaultValue) = 0;
410 virtual std::string
GetRaw(llvm::StringRef key,
411 llvm::StringRef defaultValue)
const = 0;
428 bool immediateNotify) = 0;
439 unsigned int flags) = 0;
450 bool immediateNotify) = 0;
462 unsigned int flags) = 0;
477 bool localNotify) = 0;
virtual bool SetDefaultNumber(llvm::StringRef key, double defaultValue)=0
Gets the current value in the table, setting it if it does not exist.
virtual bool PutNumber(llvm::StringRef key, double value)=0
Put a number in the table.
virtual bool SetDefaultValue(llvm::StringRef key, std::shared_ptr< nt::Value > defaultValue)=0
Gets the current value in the table, setting it if it does not exist.
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:22
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 bool SetDefaultNumberArray(llvm::StringRef key, llvm::ArrayRef< double > defaultValue)=0
Gets the current value in the table, setting it if it does not exist.
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 bool SetDefaultBooleanArray(llvm::StringRef key, llvm::ArrayRef< int > defaultValue)=0
Gets the current value in the table, setting it if it does not exist.
virtual bool SetDefaultString(llvm::StringRef key, llvm::StringRef defaultValue)=0
Gets the current value in the table, setting it if it does not exist.
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.
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 bool SetDefaultStringArray(llvm::StringRef key, llvm::ArrayRef< std::string > defaultValue)=0
Gets the current value in the table, setting it if it does not exist.
virtual std::vector< double > GetNumberArray(llvm::StringRef key, llvm::ArrayRef< double > defaultValue) const =0
Returns the number array the key maps to.
virtual bool SetDefaultRaw(llvm::StringRef key, llvm::StringRef defaultValue)=0
Gets the current value in the table, setting it if it does not exist.
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.
virtual bool SetDefaultBoolean(llvm::StringRef key, bool defaultValue)=0
Gets the current value in the table, setting it if it does not exist.
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.