Machine.h 1.6 KB

1234567891011121314151617181920212223242526272829303132
  1. 
  2. #ifndef DSR_BUILDER_MACHINE_MODULE
  3. #define DSR_BUILDER_MACHINE_MODULE
  4. #include "../../../DFPSR/api/stringAPI.h"
  5. #include "builderTypes.h"
  6. using namespace dsr;
  7. // Returns the first case insensitive match for key in target, or -1 if not found.
  8. int64_t findFlag(const Machine &target, const dsr::ReadableString &key);
  9. // Returns the value of key in target, or defaultValue if not found.
  10. ReadableString getFlag(const Machine &target, const dsr::ReadableString &key, const dsr::ReadableString &defaultValue);
  11. // Returns the value of key in target, defaultValue if not found, or 0 if not an integer.
  12. int64_t getFlagAsInteger(const Machine &target, const dsr::ReadableString &key, int64_t defaultValue = 0);
  13. // Assigns value to key in target. Allocates key in target if it does not already exist.
  14. void assignValue(Machine &target, const dsr::ReadableString &key, const dsr::ReadableString &value, bool inherited);
  15. // Modifies the flags in target, while listing source files to context, using the script in scriptPath.
  16. // Recursively including other scripts using the script's folder as the origin for relative paths.
  17. void evaluateScript(Machine &target, const ReadableString &scriptPath);
  18. void inheritMachine(Machine &child, const Machine &parent);
  19. void cloneMachine(Machine &child, const Machine &parent);
  20. void argumentsToSettings(Machine &settings, const List<String> &arguments, int64_t firstArgument, int64_t lastArgument);
  21. void printSettings(const Machine &settings);
  22. void validateSettings(const Machine &settings, const dsr::ReadableString &eventDescription);
  23. #endif