#include <API.h>
|
virtual | ~ISpecHasVariables ()=default |
|
virtual ISpecVariableCollection * | variables () const =0 |
|
ISpecVariableCollection * | vars () const |
|
bool | has_var (const char *name) const |
|
IVoidPointer * | var (const char *name) const |
|
template<typename T > |
T | var (const char *name) const |
|
template<typename T > |
T * | var (const char *name, T *value, bool destructable=true) |
|
template<typename T > |
void | var (const char *name, T &&value, bool destructable=true) |
|
template<typename T > |
T * | managed_var (const char *name, T *value) |
|
template<typename T > |
void | managed_var (const char *name, T &&value) |
|
template<typename T > |
T * | unmanaged_var (const char *name, T *value) |
|
template<typename T > |
void | unmanaged_var (const char *name, T &&value) |
|
const char * | var_text (const char *name) |
|
const char * | var_text (const char *name, const char *value) |
|
Definition at line 219 of file API.h.
◆ ~ISpecHasVariables()
virtual SpecsCpp::ISpecHasVariables::~ISpecHasVariables |
( |
| ) |
|
|
virtualdefault |
◆ has_var()
bool SpecsCpp::ISpecHasVariables::has_var |
( |
const char * |
name | ) |
const |
|
inline |
◆ managed_var() [1/2]
template<typename T >
void SpecsCpp::ISpecHasVariables::managed_var |
( |
const char * |
name, |
|
|
T && |
value |
|
) |
| |
|
inline |
Definition at line 260 of file API.h.
260 {
261 variables()->
set(name,
new VoidPointer<T>(
new T(std::forward<T>(value))),
true);
262 }
virtual void set(const char *name, IVoidPointer *, bool destructable=true)=0
◆ managed_var() [2/2]
template<typename T >
T * SpecsCpp::ISpecHasVariables::managed_var |
( |
const char * |
name, |
|
|
T * |
value |
|
) |
| |
|
inline |
Definition at line 254 of file API.h.
254 {
255 variables()->
set(name,
new VoidPointer<T>(value),
true);
256 return value;
257 }
◆ unmanaged_var() [1/2]
template<typename T >
void SpecsCpp::ISpecHasVariables::unmanaged_var |
( |
const char * |
name, |
|
|
T && |
value |
|
) |
| |
|
inline |
Definition at line 271 of file API.h.
271 {
272 variables()->
set(name,
new VoidPointer<T>(
new T(std::forward<T>(value))),
false);
273 }
◆ unmanaged_var() [2/2]
template<typename T >
T * SpecsCpp::ISpecHasVariables::unmanaged_var |
( |
const char * |
name, |
|
|
T * |
value |
|
) |
| |
|
inline |
Definition at line 265 of file API.h.
265 {
266 variables()->
set(name,
new VoidPointer<T>(value),
false);
267 return value;
268 }
◆ var() [1/4]
IVoidPointer * SpecsCpp::ISpecHasVariables::var |
( |
const char * |
name | ) |
const |
|
inline |
◆ var() [2/4]
template<typename T >
T SpecsCpp::ISpecHasVariables::var |
( |
const char * |
name | ) |
const |
|
inline |
Definition at line 238 of file API.h.
238 {
239 return var(name)->as<T>();
240 }
IVoidPointer * var(const char *name) const
◆ var() [3/4]
template<typename T >
void SpecsCpp::ISpecHasVariables::var |
( |
const char * |
name, |
|
|
T && |
value, |
|
|
bool |
destructable = true |
|
) |
| |
|
inline |
Definition at line 249 of file API.h.
249 {
250 variables()->
set(name,
new VoidPointer<T>(
new T(std::forward<T>(value))), destructable);
251 }
◆ var() [4/4]
template<typename T >
T * SpecsCpp::ISpecHasVariables::var |
( |
const char * |
name, |
|
|
T * |
value, |
|
|
bool |
destructable = true |
|
) |
| |
|
inline |
Definition at line 243 of file API.h.
243 {
244 variables()->
set(name,
new VoidPointer<T>(value), destructable);
245 return value;
246 }
◆ var_text() [1/2]
const char * SpecsCpp::ISpecHasVariables::var_text |
( |
const char * |
name | ) |
|
|
inline |
Definition at line 275 of file API.h.
275 {
276 char* value =
var(name)->as<
char*>();
277 return value ? value : nullptr;
278 }
Referenced by var_text().
◆ var_text() [2/2]
const char * SpecsCpp::ISpecHasVariables::var_text |
( |
const char * |
name, |
|
|
const char * |
value |
|
) |
| |
|
inline |
Definition at line 280 of file API.h.
280 {
281 char* copy = new char[strlen(value) + 1];
282
283#ifdef _WIN32
284 strcpy_s(copy, strlen(value) + 1, value);
285#else
286 strcpy(copy, value);
287#endif
288
291 }
const char * var_text(const char *name)
◆ variables()
Implemented in SpecsCpp::SpecGroup, and SpecsCpp::SpecTest.
Referenced by has_var(), managed_var(), managed_var(), unmanaged_var(), unmanaged_var(), var(), var(), var(), var_text(), and vars().
◆ vars()
The documentation for this struct was generated from the following file:
- Specs.API/include/Specs/API/Internal/Undocumented/API.h