Audacity 3.2.0
CommandBuilder.h
Go to the documentation of this file.
1/**********************************************************************
2
3 Audacity - A Digital Audio Editor
4 Copyright 1999-2009 Audacity Team
5 File License: wxWidgets
6
7 Dan Horgan
8
9******************************************************************//*******************************************************************/
15
16#ifndef __COMMANDBUILDER__
17#define __COMMANDBUILDER__
18
19#include <memory>
20#include <wx/string.h>
21
22class AudacityProject;
23class ResponseTarget;
24using ResponseTargetPointer = std::shared_ptr<ResponseTarget>;
25class OldStyleCommand;
26using OldStyleCommandPointer = std::shared_ptr<OldStyleCommand>;
27class wxString;
28
29// CommandBuilder has the task of validating and interpreting a command string.
30// If the string represents a valid command, it builds the command object.
31
33{
34 private:
35 bool mValid;
38 wxString mError;
39
40 void Failure(const wxString &msg = {});
41 void Success(const OldStyleCommandPointer &cmd);
43 const wxString &cmdName, const wxString &cmdParams);
44 void BuildCommand( AudacityProject &project, const wxString &cmdString);
45 public:
46 CommandBuilder(AudacityProject &project, const wxString &cmdString);
47 CommandBuilder(AudacityProject &project, const wxString &cmdName,
48 const wxString &cmdParams);
50 bool WasValid();
52 wxString GetResponse();
53};
54#endif /* End of include guard: __COMMANDBUILDER__ */
std::shared_ptr< ResponseTarget > ResponseTargetPointer
const auto project
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Definition: Project.h:90
A type of factory for Commands of various sorts.
void Failure(const wxString &msg={})
void Success(const OldStyleCommandPointer &cmd)
wxString GetResponse()
void BuildCommand(AudacityProject &project, const wxString &cmdName, const wxString &cmdParams)
ResponseTargetPointer mResponse
OldStyleCommandPointer GetCommand()
CommandBuilder(AudacityProject &project, const wxString &cmdString)
OldStyleCommandPointer mCommand
Abstract base class for command interface. This is the version created by Dan Horgan....
Definition: Command.h:30
OldStyleCommandPointer is a unique_ptr to an OldStyleCommand.
Constructs a response (to be sent back to a script)