Audacity  2.3.1
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 "../MemoryX.h"
20 #include <wx/string.h>
21 
22 class OldStyleCommand;
23 using OldStyleCommandPointer = std::shared_ptr<OldStyleCommand>;
24 class wxString;
25 
26 // CommandBuilder has the task of validating and interpreting a command string.
27 // If the string represents a valid command, it builds the command object.
28 
30 {
31  private:
32  bool mValid;
34  wxString mError;
35 
36  void Failure(const wxString &msg = wxEmptyString);
37  void Success(const OldStyleCommandPointer &cmd);
38  void BuildCommand(const wxString &cmdName, const wxString &cmdParams);
39  void BuildCommand(const wxString &cmdString);
40  public:
41  CommandBuilder(const wxString &cmdString);
42  CommandBuilder(const wxString &cmdName,
43  const wxString &cmdParams);
45  bool WasValid();
47  const wxString &GetErrorMessage();
48 };
49 #endif /* End of include guard: __COMMANDBUILDER__ */
CommandBuilder(const wxString &cmdString)
const wxString & GetErrorMessage()
OldStyleCommandPointer mCommand
void BuildCommand(const wxString &cmdName, const wxString &cmdParams)
void Failure(const wxString &msg=wxEmptyString)
void Success(const OldStyleCommandPointer &cmd)
OldStyleCommandPointer is a unique_ptr to an OldStyleCommand.
OldStyleCommandPointer GetCommand()
A type of factory for Commands of various sorts.
Abstract base class for command interface. This is the version created by Dan Horgan. It was previously a factory for other command classes. It created a separation between the type of a command and the command itself, which is being removed. These Cmmands were managed by CommandDirectory.
Definition: Command.h:33