141 #ifdef OT_USE_SCRIPT_CHAI
206 #ifdef OT_USE_SCRIPT_CHAI
208 if (script_type ==
"" || script_type ==
"chai")
210 std::shared_ptr<OTScript> pChaiScript(
new OTScriptChai);
223 if (script_type ==
"") {
224 otErr <<
"\n\n WARNING 1: script_type == noscript. \n\n";
226 std::shared_ptr<OTScript> pNoScript(
new OTScript);
231 otErr << __FUNCTION__ <<
": Script language (" << script_type
234 std::shared_ptr<OTScript> retVal;
239 const std::string& script_contents)
242 #ifdef OT_USE_SCRIPT_CHAI
244 if (script_type ==
"" || script_type ==
"chai")
246 std::shared_ptr<OTScript> pChaiScript(
247 new OTScriptChai(script_contents));
260 if (script_type ==
"") {
261 otErr <<
"\n\n WARNING 2: script_type == noscript. \n\n";
263 std::shared_ptr<OTScript> pNoScript(
new OTScript);
268 otErr << __FUNCTION__ <<
": Script language (" << script_type
271 std::shared_ptr<OTScript> retVal;
280 : m_str_script(strValue.Get())
285 : m_str_script(new_string)
290 : m_str_script(new_string, sizeLength)
295 : m_str_script(new_string)
330 if (
nullptr != new_string)
m_str_script.assign(new_string, sizeLength);
355 std::pair<std::string, OTParty*>(str_party_name, &theParty));
366 std::pair<std::string, OTPartyAccount*>(str_acct_name, &theAcct));
385 std::pair<std::string, OTVariable*>(str_var_name, &theVar));
407 const std::string str_var_name = theVar.
GetName().
Get();
418 otErr <<
"OTScript::ExecuteScript: Scripting has been disabled.\n";
EXPORT void RemoveVariable(OTVariable &theVar)
void AddParty(std::string str_party_name, OTParty &theParty)
mapOfParties m_mapParties
EXPORT OTVariable * FindVariable(std::string str_var_name)
EXPORT void UnregisterScript()
void RegisterAccountsForExecution(OTScript &theScript)
EXPORT bool Exists() const
EXPORT const OTString & GetName() const
void AddAccount(std::string str_acct_name, OTPartyAccount &theAcct)
EXPORT void SetScript(const OTString &strValue)
EXPORT const char * Get() const
OTLOG_IMPORT OTLogStream otErr
EXPORT void AddVariable(std::string str_var_name, OTVariable &theVar)
mapOfPartyAccounts m_mapAccounts
mapOfVariables m_mapVariables
EXPORT std::shared_ptr< OTScript > OTScriptFactory(const std::string &script_type="")
virtual bool ExecuteScript(OTVariable *pReturnVar=nullptr)